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);
}
}
This diff is collapsed.
/** theme: twitter
*
* @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/
*/
html,
body,
a:active {
background-color:#9AE4E8;
}
body {
font-family:'Lucida Grande',sans-serif;
background:#9AE4E8 url(../images/illustrations/illu_clouds-01.gif) 0 0 no-repeat;
color:#333333;
}
#core {
background:url(../images/illustrations/illu_arrow-up-01.gif) no-repeat 25px 0;
}
input, textarea, select, option {
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}
input, textarea, select,
.entity_remote_subscribe {
border-color:#aaa;
}
#filter_tags ul li {
border-color:#ddd;
}
.form_settings input.form_action-secondary {
background:none;
}
input.submit,
#form_notice.warning #notice_text-count,
#nav_register a,
.form_settings .form_note,
.entity_remote_subscribe {
background-color:#9BB43E;
}
input:focus, textarea:focus, select:focus,
#form_notice.warning #notice_data-text {
border-color:#9BB43E;
}
input.submit,
#nav_register a,
.entity_remote_subscribe {
color:#fff;
}
a,
div.notice-options input,
.form_user_block input.submit,
.form_user_unblock input.submit,
.entity_send-a-message a,
.form_user_nudge input.submit,
.entity_nudge p,
.form_settings input.form_action-secondary {
color:#0084B4;
}
.notice,
.profile {
border-top-color:#DDFFCC;
}
.section .profile {
border-top-color:#87B4C8;
}
#content .notice p.entry-content a:visited {
background-color:#fcfcfc;
}
#content .notice p.entry-content .vcard a {
background-color:#fcfffc;
}
#aside_primary {
background-color:#DDFFCC;
}
#notice_text-count {
color:#333;
}
#form_notice.warning #notice_text-count {
color:#000;
}
#form_notice.processing #notice_action-submit {
background:#fff url(../../../base/images/icons/icon_processing.gif) no-repeat 47% 47%;
cursor:wait;
text-indent:-9999px;
}
#content,
#site_nav_local_views a,
#aside_primary {
border-color:#fff;
}
#content,
#site_nav_local_views .current a {
background-color:#fff;
}
#site_nav_local_views a {
background-color:rgba(135, 180, 200, 0.3);
}
#site_nav_local_views a:hover {
background-color:rgba(255, 255, 255, 0.7);
}
.error {
background-color:#F7E8E8;
}
.success {
background-color:#EFF3DC;
}
#anon_notice {
background-color:#FEFFDF;
color:#333;
border-color:#fff;
}
#showstream #anon_notice {
background-color:#FEFFDF;
}
#export_data li a {
background-repeat:no-repeat;
background-position:0 45%;
}
#export_data li a.rss {
background-image:url(../../../base/images/icons/icon_rss.png);
}
#export_data li a.atom {
background-image:url(../../../base/images/icons/icon_atom.png);
}
#export_data li a.foaf {
background-image:url(../../../base/images/icons/icon_foaf.gif);
}
.entity_edit a,
.entity_send-a-message a,
.form_user_nudge input.submit,
.form_user_block input.submit,
.form_user_unblock input.submit,
.entity_nudge p {
background-position: 0 40%;
background-repeat: no-repeat;
background-color:transparent;
}
.form_group_join input.submit,
.form_group_leave input.submit
.form_user_subscribe input.submit,
.form_user_unsubscribe input.submit {
background-color:#9BB43E;
color:#fff;
}
.form_user_unsubscribe input.submit,
.form_group_leave input.submit {
background-color:#87B4C8;
}
.entity_edit a {
background-image:url(../images/icons/twotone/green/edit.gif);
}
.entity_send-a-message a {
background-image:url(../images/icons/twotone/green/quote.gif);
}
.entity_nudge p,
.form_user_nudge input.submit {
background-image:url(../images/icons/twotone/green/mail.gif);
}
.form_user_block input.submit,
.form_user_unblock input.submit {
background-image:url(../images/icons/twotone/green/shield.gif);
}
/* NOTICES */
.notices li.over {
background-color:#fcfcfc;
}
.notice-options .notice_reply a,
.notice-options form input.submit {
background-color:transparent;
}
.notice-options .notice_reply a {
background:transparent url(../images/icons/icon_reply.gif) no-repeat 0 45%;
}
.notice-options form.form_favor input.submit {
background:transparent url(../images/icons/icon_favourite.gif) no-repeat 0 45%;
}
.notice-options form.form_disfavor input.submit {
background:transparent url(../images/icons/icon_disfavourite.gif) no-repeat 0 45%;
}
.notice-options .notice_delete a {
background:transparent url(../images/icons/icon_trash.gif) no-repeat 0 45%;
}
.notices div.entry-content,
.notices div.notice-options {
opacity:0.4;
}
.notices li.hover div.entry-content,
.notices li.hover div.notice-options {
opacity:1;
}
div.entry-content {
color:#333;
}
div.notice-options a,
div.notice-options input {
font-family:sans-serif;
}
.notices li.hover {
background-color:#fcfcfc;
}
/*END: NOTICES */
#new_group a {
background:transparent url(../images/icons/twotone/green/news.gif) no-repeat 0 45%;
}
#usergroups #new_group {
float: left;
margin-right: 2em;
}
.pagination .nav_prev a,
.pagination .nav_next a {
background-repeat:no-repeat;
border-color:#DDFFCC;
}
.pagination .nav_prev a {
background-image:url(../images/icons/twotone/green/arrow-left.gif);
background-position:10% 45%;
}
.pagination .nav_next a {
background-image:url(../images/icons/twotone/green/arrow-right.gif);
background-position:90% 45%;
}
/*--------------------------------------*/
#anon_notice {
background:url(../images/illustrations/illu_unicorn-01.png) no-repeat 0 0;
}
#showstream #anon_notice,
#content .notice p.entry-content a:visited,
content .notice p.entry-content .vcard a {
background-color:transparent;
}
#anon_notice p {
background-color:#FEFFDF;
border-color:#FFFF00;
}
#form_notice .form_note {
color:#CCC;
}
input.submit {
background-color:#eee;
color:#666;
}
.notices li.hover {
background-color:#F7F7F7;
}
.notice div.entry-content,
.notice div.entry-content a {
color:#999;
}
.notices div.entry-content,
.notices div.notice-options {
opacity:1;
}
#site_nav_local_views {
background-color:#DDFFCC;
}
#site_nav_local_views li,
#aside_primary {
border-color:#BDDCAD;
}
#site_nav_local_views a,
.aside .section h2 {
background-color:transparent;
border-color:transparent;
color:#4C4C4C;
}
#site_nav_local_views .current {
border-left-color:#fff;
}
#site_nav_local_views .current a,
#site_nav_global_primary,
#footer {
background-color:#fff;
}
/* IE specific styles */
.notice-options input.submit {
color:#fff;
}
#site_nav_local_views a {
background-color:#ddffcc;
}
#aside_primary {
width:181px;
}
#form_notice,
#anon_notice {
top:158px;
}
#public #content,
#groups #content,
#publictagcloud #content,
#featured #content,
#favorited #content,
#all #content,
#replies #content,
#showstream #content,
#showfavorites #content,
#inbox #content,
#outbox #content,
#subscriptions #content,
#subscribers #content {
padding-top:138px;
}
@import url("display.css");
@import url("../../identica/css/display.css");
* {
font-size:14px;
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
}
#wrap {
background-color:#F0F2F5;
padding-left:18px;
padding-right:18px;
width:auto;
}
p,label,
h1,h2,h3,h4,h5,h6 {
color:#000;
}
#content {
width:95%;
}
#site_nav_local_views a {
background-color:#D0DFE7;
}