We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 030477b0 authored by Sarven Capadisli's avatar Sarven Capadisli

Separation of themes (i.e., layout, typography) and skins (i.e., background

images, colours).

A theme can have multiple skins.

Majority of the changes in this commit are due to restructuring the
path/files for themes and skins.

Both theme and skin will be set to 'default' if not set in
config.php.

This commit also allows each instance of this software to create
its own theme without having to override any style from the default
distribution.

Added Cloudy theme.
parent 1f33df47
......@@ -18,6 +18,7 @@ $config['site']['server'] = 'localhost';
$config['site']['path'] = 'laconica';
#$config['site']['fancy'] = false;
#$config['site']['theme'] = 'default';
#$config['site']['skin'] = 'default';
#To enable the built-in mobile style sheet, defaults to false.
#$config['site']['mobile'] = true;
#For contact email, defaults to $_SERVER["SERVER_ADMIN"]
......
......@@ -194,37 +194,37 @@ class Action extends HTMLOutputter // lawsuit
if (Event::handle('StartShowLaconicaStyles', array($this))) {
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
'href' => theme_path('css/display.css', 'base') . '?version=' . LACONICA_VERSION,
'href' => theme_path('base/css/display.css') . '?version=' . LACONICA_VERSION,
'media' => 'screen, projection, tv'));
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION,
'href' => skin_path('css/display.css') . '?version=' . LACONICA_VERSION,
'media' => 'screen, projection, tv'));
if (common_config('site', 'mobile')) {
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
'href' => theme_path('css/mobile.css', 'base') . '?version=' . LACONICA_VERSION,
'href' => theme_path('base/css/mobile.css') . '?version=' . LACONICA_VERSION,
// TODO: "handheld" CSS for other mobile devices
'media' => 'only screen and (max-device-width: 480px)')); // Mobile WebKit
}
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
'href' => theme_path('css/print.css', 'base') . '?version=' . LACONICA_VERSION,
'href' => theme_path('base/css/print.css') . '?version=' . LACONICA_VERSION,
'media' => 'print'));
Event::handle('EndShowLaconicaStyles', array($this));
}
if (Event::handle('StartShowUAStyles', array($this))) {
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
'href="'.theme_path('css/ie.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]');
'href="'.theme_path('base/css/ie.css').'?version='.LACONICA_VERSION.'" /><![endif]');
foreach (array(6,7) as $ver) {
if (file_exists(theme_file('css/ie'.$ver.'.css', 'base'))) {
if (file_exists(theme_file('base/css/ie'.$ver.'.css'))) {
// Yes, IE people should be put in jail.
$this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '.
'href="'.theme_path('css/ie'.$ver.'.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]');
'href="'.theme_path('base/css/ie'.$ver.'.css').'?version='.LACONICA_VERSION.'" /><![endif]');
}
}
$this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]');
'href="'.skin_path('css/ie.css').'?version='.LACONICA_VERSION.'" /><![endif]');
Event::handle('EndShowUAStyles', array($this));
}
Event::handle('EndShowStyles', array($this));
......
......@@ -71,6 +71,7 @@ $config =
array('name' => 'Just another Laconica microblog',
'server' => $_server,
'theme' => 'default',
'skin' => 'default',
'path' => $_path,
'logfile' => null,
'logo' => null,
......
......@@ -69,4 +69,31 @@ function theme_path($relative, $theme=null)
} else {
return common_path('theme/'.$theme.'/'.$relative);
}
}
\ No newline at end of file
}
/**
* Gets the full URL of a file in a skin dir based on its relative name
*
* @param string $relative relative path within the theme, skin directory
* @param string $theme name of the theme; defaults to current theme
* @param string $skin name of the skin; defaults to current theme
*
* @return string URL of the file
*/
function skin_path($relative, $theme=null, $skin=null)
{
if (!$theme) {
$theme = common_config('site', 'theme');
}
if (!$skin) {
$skin = common_config('site', 'skin');
}
$server = common_config('theme', 'server');
if ($server) {
return 'http://'.$server.'/'.$theme.'/skin/'.$skin.'/'.$relative;
} else {
return common_path('theme/'.$theme.'/skin/'.$skin.'/'.$relative);
}
}
/** theme: cloudy
*
* @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/
*/
* { margin:0; padding:0; }
img { display:block; border:0; }
a abbr { cursor: pointer; border-bottom:0; }
table { border-collapse:collapse; }
ol { list-style-position:inside; }
html { font-size: 100%; background-color:#fff; height:100%; }
body {
background-color:#fff;
color:#000;
font-family:sans-serif;
font-size:0.75em;
line-height:normal;
position:relative;
height:100%;
}
h1,h2,h3,h4,h5,h6 {
margin-bottom:7px;
overflow:hidden;
}
h1 {
font-size:1.4em;
margin-bottom:18px;
}
h2 { font-size:1.3em; }
h3 { font-size:1.2em; }
h4 { font-size:1.1em; }
h5 { font-size:1em; }
h6 { font-size:0.9em; }
caption {
font-weight:bold;
}
legend {
font-weight:bold;
font-size:1.3em;
}
input, textarea, select, option {
padding:4px;
font-family:sans-serif;
font-size:1em;
}
input, textarea, select {
border-width:2px;
border-style: solid;
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
}
input.submit {
font-weight:bold;
cursor:pointer;
}
textarea {
overflow:auto;
}
option {
padding-bottom:0;
}
fieldset {
padding:0;
border:0;
}
form ul li {
list-style-type:none;
margin:0 0 18px 0;
}
form label {
font-weight:bold;
}
input.checkbox {
position:relative;
top:2px;
left:0;
border:0;
}
.error,
.success {
padding:4px 7px;
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
margin-bottom:18px;
}
form label.submit {
display:none;
}
.form_settings {
clear:both;
}
.form_settings fieldset {
margin-bottom:29px;
}
.form_settings input.remove {
margin-left:11px;
}
.form_settings .form_data li {
width:100%;
float:left;
}
.form_settings .form_data label {
float:left;
}
.form_settings .form_data textarea,
.form_settings .form_data select,
.form_settings .form_data input {
margin-left:11px;
float:left;
}
.form_settings .form_data input.submit {
margin-left:0;
}
.form_settings label {
margin-top:2px;
width:145px;
}
.form_actions label {
display:none;
}
.form_guide {
font-style:italic;
}
.form_settings #settings_autosubscribe label {
display:inline;
font-weight:bold;
}
#form_settings_profile legend,
#form_login legend,
#form_register legend,
#form_password legend,
#form_settings_avatar legend,
#newgroup legend,
#editgroup legend,
#form_tag_user legend,
#form_remote_subscribe legend,
#form_openid_login legend,
#form_search legend,
#form_invite legend,
#form_notice_delete legend,
#form_password_recover legend,
#form_password_change legend {
display:none;
}
.form_settings .form_data p.form_guide {
clear:both;
margin-left:155px;
margin-bottom:0;
}
.form_settings p {
margin-bottom:11px;
}
.form_settings input.checkbox {
margin-top:0;
margin-left:0;
}
.form_settings label.checkbox {
font-weight:normal;
margin-top:0;
margin-right:0;
margin-left:11px;
float:left;
width:90%;
}
#form_login p.form_guide,
#form_register #settings_rememberme p.form_guide,
#form_openid_login #settings_rememberme p.form_guide,
#settings_twitter_remove p.form_guide,
#form_search ul.form_data #q {
margin-left:0;
}
.form_settings .form_note {
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
padding:0 7px;
}
.form_settings input.form_action-secondary {
margin-left:29px;
padding:0;
}
#form_search .submit {
margin-left:11px;
}
address {
float:left;
margin-bottom:18px;
margin-left:18px;
}
address.vcard img.logo {
margin-right:0;
}
address .fn {
font-weight:bold;
}
address img + .fn {
display:none;
}
#header {
width:100%;
position:relative;
float:left;
padding-top:18px;
margin-bottom:11px;
z-index:1;
}
#site_nav_global_primary {
float:right;
margin-right:0;
margin-bottom:11px;
margin-left:18px;
padding-top:7px;
padding-bottom:7px;
padding-right:11px;
-moz-border-radius:4px;
border-radius:4px;
-webkit-border-radius:4px;
}
#site_nav_global_primary ul li {
display:inline;
margin-left:11px;
}
#site_nav_global_primary a {
text-decoration:none;
}
.system_notice dt {
font-weight:bold;
text-transform:uppercase;
display:none;
}
#site_notice {
position:absolute;
top:65px;
right:18px;
width:250px;
width:24%;
}
#page_notice {
clear:both;
margin-bottom:18px;
}
#anon_notice {
clear:both;
width:99.8%;
padding-top:36px;
line-height:1.5;
font-size:1.3em;
font-weight:bold;
}
#anon_notice p {
border-style:solid;
border-width:1px;
width:96%;
padding:2%;
}
#footer {
float:left;
margin-bottom:1em;
padding:7px;
-moz-border-radius:4px;
border-radius:4px;
-webkit-border-radius:4px;
}
#footer a {
text-decoration:none;
}
#site_nav_local_views {
width:203px;
float:right;
margin-right:0;
-moz-border-radius-topright:4px;
border-radius-topright:4px;
-webkit-border-top-right-radius:4px;
}
#site_nav_local_views dt {
display:none;
}
#site_nav_local_views li {
list-style-type:none;
padding:0;
border-width:1px;
border-style:solid;
border-top:0;
border-right:0;
}
#site_nav_local_views a {
text-decoration:none;
padding:13px;
border-width:1px;
border-style:solid;
border-bottom:0;
text-shadow: 2px 2px 2px #ddd;
font-weight:bold;
font-size:1em;
display:block;
}
#site_nav_local_views .nav {
float:left;
width:100%;
}
#site_nav_global_primary dt,
#site_nav_global_secondary dt {
display:none;
}
#site_nav_global_secondary {
margin-bottom:11px;
}
#site_nav_global_secondary ul li {
display:inline;
margin-right:11px;
}
#export_data li a {
padding-left:20px;
}
#export_data li a.foaf {
padding-left:30px;
}
#export_data li a.export_vcard {
padding-left:28px;
}
#export_data ul {
display:inline;
}
#export_data li {
list-style-type:none;
display:inline;
margin:0 18px 7px 0;
float:left;
}
#export_data li:first-child {
margin-left:0;
}
#licenses {
font-size:0.9em;
}
#licenses dt {
font-weight:bold;
display:none;
}
#licenses dd {
margin-bottom:11px;
line-height:1.5;
}
#site_content_license_cc {
margin-bottom:0;
}
#site_content_license_cc img {
display:inline;
vertical-align:top;
margin-right:4px;
}
#wrap {
margin:0 auto;
width: 763px;
min-width:760px;
max-width:1003px;
overflow:hidden;
}
#core {
position:relative;
width:100%;
float:left;
margin-bottom:1em;
padding-top:10px;
}
#content {
width:518px;
min-height:322px;
padding:20px;
float:left;
border-radius-topleft:4px;
-moz-border-radius-topleft:4px;
-webkit-border-top-left-radius:4px;
border-style:solid;
border-width:1px;
}
#content_inner {
position:relative;
width:100%;
float:left;
}
#aside_primary {
width:182px;
min-height:259px;
float:left;
margin-left:0;
padding:10px;
border-width:1px;
border-style:solid;
border-right:0;
border-top:0;
}
#form_notice {