Skip to content

Commit

Permalink
[gh-268] Merging test into staging
Browse files Browse the repository at this point in the history
git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1359 20a16fea-79d4-4915-8869-1ea9d5ebf173
  • Loading branch information
Eric Rasmussen committed Dec 19, 2011
1 parent 9f255a7 commit a0acf84
Show file tree
Hide file tree
Showing 12 changed files with 518 additions and 11 deletions.
Binary file added color/base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions color/color.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php

// Put the logo path into JavaScript for the live preview.
drupal_add_js(array('color' => array('logo' => theme_get_setting('logo', 'unl_wdn'))), 'setting');

$info = array(
// Available colors and color labels used in theme.
'fields' => array(
'top' => t('Navigation top'),
'bottom' => t('Navigation bottom'),
'navhovertop' => t('Nav hover top'),
'navhoverbottom' => t('Nav hover bottom'),
'footertop' => t('Footer top'),
'footerbottom' => t('Footer bottom'),
'link' => t('Link color'),
),
// Pre-defined color schemes.
'schemes' => array(
'default' => array(
'title' => t('UNL (default)'),
'colors' => array(
'top' => '#b70302',
'bottom' => '#9d0201',
'navhovertop' => '#c12726',
'navhoverbottom' => '#ac2625',
'footertop' => '#b70303',
'footerbottom' => '#9d0202',
'link' => '#ba0000',
),
),
'brown' => array(
'title' => t('Brown'),
'colors' => array(
'top' => '#906337',
'bottom' => '#654424',
'navhovertop' => '#a3774b',
'navhoverbottom' => '#765330',
'footertop' => '#654425',
'footerbottom' => '#513316',
'link' => '#0081AF',
),
),
'blue' => array(
'title' => t('Blue Steel'),
'colors' => array(
'top' => '#1972a7',
'bottom' => '#0e4e74',
'navhovertop' => '#208dcd',
'navhoverbottom' => '#1c94db',
'footertop' => '#0e4e74',
'footerbottom' => '#02314e',
'link' => '#0064f8',
),
),
),

// CSS files (excluding @import) to rewrite with new color scheme.
'css' => array(
'css/colors.css',
),

// Files to copy.
'copy' => array(
//'logo.png',
),

// Gradient definitions.
'gradients' => array(
array(
// (x, y, width, height).
'dimension' => array(0, 0, 0, 0),
// Direction of gradient ('vertical' or 'horizontal').
'direction' => 'vertical',
// Keys of colors to use for the gradient.
'colors' => array('top', 'bottom'),
),
),

// Color areas to fill (x, y, width, height).
'fill' => array(),

// Coordinates of all the theme slices (x, y, width, height)
// with their filename as used in the stylesheet.
'slices' => array(),

// Reference color used for blending. Matches the base.png's colors.
'blend_target' => '#ffffff',

// Preview files.
'preview_css' => 'color/preview.css',
'preview_js' => 'color/preview.js',
'preview_html' => 'color/preview.html',

// Base file for image generation. (Not used, but causes error without it.)
'base_image' => 'color/base.png',
);
132 changes: 132 additions & 0 deletions color/preview.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@

/* ---------- Color form ----------- */
#color_scheme_form #palette .form-item {
width: 25em;
}
#color_scheme_form #palette .form-item label {
width: 15em;
}

/* ---------- Preview Styles ----------- */

html.js #preview {
clear: both;
float: none !important;
}
#preview {
border: 12px solid #EEE;
border-radius: 10px;
box-shadow: 0px 1px 5px #AAA;
background-color: #fff;
font-family: "Lucida Grande",Verdana,Arial,sans-serif;
color: #333;
font-size: 12px;
line-height: 1.5;
overflow: hidden;
word-wrap: break-word;
margin-bottom: 10px;
}
#preview-header {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
position: relative;
}
#preview-logo {
float: left;
padding: 15px 15px 15px 10px;
}
#preview-site-name {
color: #555;
font-weight: normal;
font-size: 2.821em;
line-height: 1;
margin-bottom: 30px;
margin-left: 15px;
padding-top: 34px;
}

/* - Menu - */
#preview-main-menu {
font-size: 14px;
clear: both;
padding: 0 15px 3px;
margin: 0 12px;
border-radius: 5px;
}
#preview-main-menu-links a {
color: #fff;
padding: 0.6em 1em 0.4em;
text-shadow: 1px 1px 1px #424242;
}
#preview-main-menu-links {
margin: 0;
padding: 3px 0;
}

#preview-main-menu-links li {
display: inline;
list-style-type: none;
padding: 0.6em 0 0.4em;
}

/* - Sidebar/Content - */
#preview-sidebar,
#preview-content {
display: inline;
float: left;
position: relative;
}
#preview-sidebar {
margin-left: 15px;
width: 210px;
}
#preview-content {
margin-left: 30px;
width: 26.5em;
}
#preview-sidebar .preview-block {
border: 1px solid;
margin: 20px 0;
padding: 15px 20px;
}
#preview-sidebar h2 {
border-bottom: 1px solid #d6d6d6;
font-size: 1.071em;
font-weight: normal;
line-height: 1.2;
margin: 0 0 0.5em;
padding-bottom: 5px;
text-shadow: 0 1px 0 #fff;
}
#preview .preview-block .preview-content {
margin-top: 1em;
}
#preview .preview-block-menu .preview-content,
#preview .preview-block-menu .preview-content ul {
margin-top: 0;
}
#preview-main {
margin-bottom: 40px;
margin-top: 20px;
}
#preview-page-title {
color: #535353;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 2em;
font-weight: bold;
line-height: 1.2;
padding-bottom: 0.3em;
padding-top: 0.4em;
}

/* - Footer - */
#preview-footer-wrapper {
color: #ffffff;
display: block !important;
font-size: 11px;
padding: 10px 20px 15px;
text-shadow: 0px 1px 0px #424242;
}
#preview-footer-wrapper a {
color: #ffffff;
text-decoration: underline;
}
43 changes: 43 additions & 0 deletions color/preview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<div id="preview">

<div id="preview-header">
<div id="preview-logo"><img src="../../../themes/unl_wdn/logo.png" alt="Site Logo" /></div>
<div id="preview-site-name">UNL WDN</div>
<div id="preview-main-menu">
<ul id="preview-main-menu-links">
<li><a>Home</a></li>
<li><a>Te Quidne</a></li>
<li><a>Vel Torqueo Quae Erat</a></li>
</ul>
</div>
</div>

<div id="preview-main" class="clearfix">
<div id="preview-sidebar">
<div id="preview-block" class="preview-block">
<h2>Etiam est risus</h2>
<div class="preview-content">
Maecenas id porttitor Ut enim ad minim veniam, quis nostrudfelis.
Laboris nisi ut aliquip ex ea.
</div>
</div>
</div>
<div id="preview-content">
<h1 id="preview-page-title">Lorem ipsum dolor</h1>
<div id="preview-node">
<div class="preview-content">
Sit amet, <a>consectetur adipisicing elit</a>, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud <a>exercitation ullamco</a> laboris nisi ut aliquip ex ea
commodo consequat. Maecenas id porttitor Ut enim ad minim veniam, quis nostr udfelis.
</div>
</div>
</div>
</div>

<div id="preview-footer-wrapper">
<p>Copyright University of Nebraska–Lincoln | Lincoln, NE 68588 | 402-472-7211 | <a>About UNL</a></p>
<p>UNL is an equal opportunity employer with a comprehensive plan for diversity.</p>
</div>

</div>
46 changes: 46 additions & 0 deletions color/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

(function ($) {
Drupal.color = {
logoChanged: false,
callback: function(context, settings, form, farb, height, width) {
// Change the logo to be the real one.
if (!this.logoChanged) {
$('#preview #preview-logo img').attr('src', Drupal.settings.color.logo);
this.logoChanged = true;
}
// Remove the logo if the setting is toggled off.
if (Drupal.settings.color.logo == null) {
$('div').remove('#preview-logo');
}

// Text preview.
$('#preview #preview-content a', form).css('color', $('#palette input[name="palette[link]"]', form).val());

// CSS3 Gradients - navigation.
var gradient_start = $('#palette input[name="palette[top]"]', form).val();
var gradient_end = $('#palette input[name="palette[bottom]"]', form).val();

$('#preview #preview-main-menu', form).attr('style', "background-color: " + gradient_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + gradient_start + "), to(" + gradient_end + ")); background-image: -moz-linear-gradient(-90deg, " + gradient_start + ", " + gradient_end + ");");

// CSS3 Gradients - navigation hover.
var navhover_start = $('#palette input[name="palette[navhovertop]"]', form).val();
var navhover_end = $('#palette input[name="palette[navhoverbottom]"]', form).val();

$('#preview #preview-main-menu', form).hover(
function(){
$(this).attr('style', "background-color: " + navhover_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + navhover_start + "), to(" + navhover_end + ")); background-image: -moz-linear-gradient(-90deg, " + navhover_start + ", " + navhover_end + ");");
},
function(){
$(this).attr('style', "background-color: " + gradient_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + gradient_start + "), to(" + gradient_end + ")); background-image: -moz-linear-gradient(-90deg, " + gradient_start + ", " + gradient_end + ");");
}
);

// CSS3 Gradients - footer.
var footer_start = $('#palette input[name="palette[footertop]"]', form).val();
var footer_end = $('#palette input[name="palette[footerbottom]"]', form).val();

$('#preview #preview-footer-wrapper', form).attr('style', "background-color: " + footer_start + "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(" + footer_start + "), to(" + footer_end + ")); background-image: -moz-linear-gradient(-90deg, " + footer_start + ", " + footer_end + ");");

}
};
})(jQuery);
Loading

0 comments on commit a0acf84

Please sign in to comment.