summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2012-04-19 08:14:22 (GMT)
committerJohnAlbin2012-04-19 08:14:22 (GMT)
commit2d4677828d16978456cb37a74a3c597adfd15de4 (patch)
tree4316e33d0bfaf0e314a2e0f90bd754d5745d8dda
parentc8aaf81dc0c97eb3007101c979bd3810c4bdd00f (diff)
Copy color support from Bartik.1053734-color
-rw-r--r--STARTERKIT/color/base.pngbin0 -> 106 bytes
-rw-r--r--STARTERKIT/color/color.inc132
-rw-r--r--STARTERKIT/color/preview.css200
-rw-r--r--STARTERKIT/color/preview.html65
-rw-r--r--STARTERKIT/color/preview.js39
-rw-r--r--STARTERKIT/color/preview.pngbin0 -> 106 bytes
-rw-r--r--template.php14
7 files changed, 450 insertions, 0 deletions
diff --git a/STARTERKIT/color/base.png b/STARTERKIT/color/base.png
new file mode 100644
index 0000000..58cc088
--- /dev/null
+++ b/STARTERKIT/color/base.png
Binary files differ
diff --git a/STARTERKIT/color/color.inc b/STARTERKIT/color/color.inc
new file mode 100644
index 0000000..d55bb2e
--- /dev/null
+++ b/STARTERKIT/color/color.inc
@@ -0,0 +1,132 @@
+<?php
+
+// Put the logo path into JavaScript for the live preview.
+drupal_add_js(array('color' => array('logo' => theme_get_setting('logo', 'STARTERKIT'))), 'setting');
+
+$info = array(
+ // Available colors and color labels used in theme.
+ 'fields' => array(
+ 'top' => t('Header top'),
+ 'bottom' => t('Header bottom'),
+ 'bg' => t('Main background'),
+ 'sidebar' => t('Sidebar background'),
+ 'sidebarborders' => t('Sidebar borders'),
+ 'footer' => t('Footer background'),
+ 'titleslogan' => t('Title and slogan'),
+ 'text' => t('Text color'),
+ 'link' => t('Link color'),
+ ),
+ // Pre-defined color schemes.
+ 'schemes' => array(
+ 'default' => array(
+ 'title' => t('Blue Lagoon (default)'),
+ 'colors' => array(
+ 'top' => '#0779bf',
+ 'bottom' => '#48a9e4',
+ 'bg' => '#ffffff',
+ 'sidebar' => '#f6f6f2',
+ 'sidebarborders' => '#f9f9f9',
+ 'footer' => '#292929',
+ 'titleslogan' => '#fffeff',
+ 'text' => '#3b3b3b',
+ 'link' => '#0071B3',
+ ),
+ ),
+ 'firehouse' => array(
+ 'title' => t('Firehouse'),
+ 'colors' => array(
+ 'top' => '#cd2d2d',
+ 'bottom' => '#cf3535',
+ 'bg' => '#ffffff',
+ 'sidebar' => '#f1f4f0',
+ 'sidebarborders' => '#ededed',
+ 'footer' => '#1f1d1c',
+ 'titleslogan' => '#fffeff',
+ 'text' => '#3b3b3b',
+ 'link' => '#d6121f',
+ ),
+ ),
+ 'ice' => array(
+ 'title' => t('Ice'),
+ 'colors' => array(
+ 'top' => '#d0d0d0',
+ 'bottom' => '#c2c4c5',
+ 'bg' => '#ffffff',
+ 'sidebar' => '#ffffff',
+ 'sidebarborders' => '#cccccc',
+ 'footer' => '#24272c',
+ 'titleslogan' => '#000000',
+ 'text' => '#4a4a4a',
+ 'link' => '#019dbf',
+ ),
+ ),
+ 'plum' => array(
+ 'title' => t('Plum'),
+ 'colors' => array(
+ 'top' => '#4c1c58',
+ 'bottom' => '#593662',
+ 'bg' => '#fffdf7',
+ 'sidebar' => '#edede7',
+ 'sidebarborders' => '#e7e7e7',
+ 'footer' => '#2c2c28',
+ 'titleslogan' => '#ffffff',
+ 'text' => '#301313',
+ 'link' => '#9d408d',
+ ),
+ ),
+ 'slate' => array(
+ 'title' => t('Slate'),
+ 'colors' => array(
+ 'top' => '#4a4a4a',
+ 'bottom' => '#4e4e4e',
+ 'bg' => '#ffffff',
+ 'sidebar' => '#ffffff',
+ 'sidebarborders' => '#d0d0d0',
+ 'footer' => '#161617',
+ 'titleslogan' => '#ffffff',
+ 'text' => '#3b3b3b',
+ 'link' => '#0073b6',
+ ),
+ ),
+ ),
+
+ // 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.
+ 'base_image' => 'color/base.png',
+);
diff --git a/STARTERKIT/color/preview.css b/STARTERKIT/color/preview.css
new file mode 100644
index 0000000..48a4a83
--- /dev/null
+++ b/STARTERKIT/color/preview.css
@@ -0,0 +1,200 @@
+
+/* ---------- 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 {
+ background-color: #fff;
+ font-family: Georgia, "Times New Roman", Times, serif;
+ font-size: 14px;
+ 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: #686868;
+ font-weight: normal;
+ font-size: 1.821em;
+ line-height: 1;
+ margin-bottom: 30px;
+ margin-left: 15px;
+ padding-top: 34px;
+}
+#preview-main-menu {
+ clear: both;
+ padding: 0 15px 3px;
+}
+#preview-main-menu-links a {
+ color: #d9d9d9;
+ padding: 0.6em 1em 0.4em;
+}
+#preview-main-menu-links {
+ font-size: 0.929em;
+ margin: 0;
+ padding: 0;
+}
+#preview-main-menu-links a {
+ color: #333;
+ background: #ccc;
+ background: rgba(255, 255, 255, 0.7);
+ text-shadow: 0 1px #eee;
+ -khtml-border-radius-topleft: 8px;
+ -moz-border-radius-topleft: 8px;
+ -webkit-border-top-left-radius: 8px;
+ border-top-left-radius: 8px;
+ -khtml-border-radius-topright: 8px;
+ -moz-border-radius-topright: 8px;
+ -webkit-border-top-right-radius: 8px;
+ border-top-right-radius: 8px;
+}
+#preview-main-menu-links a:hover,
+#preview-main-menu-links a:focus {
+ background: #fff;
+ background: rgba(255, 255, 255, 0.95);
+}
+#preview-main-menu-links a:active {
+ background: #b3b3b3;
+ background: rgba(255, 255, 255, 1);
+}
+#preview-main-menu-links li a.active {
+ border-bottom: none;
+}
+#preview-main-menu-links li {
+ display: inline;
+ list-style-type: none;
+ padding: 0.6em 0 0.4em;
+}
+#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 {
+ font-size: 2em;
+ font-weight: normal;
+ line-height: 1;
+ margin: 1em 0 0.5em;
+}
+#preview-footer-wrapper {
+ color: #c0c0c0;
+ color: rgba(255, 255, 255, 0.65);
+ display: block !important;
+ font-size: 0.857em;
+ padding: 20px 20px 25px;
+}
+#preview-footer-wrapper a {
+ color: #fcfcfc;
+ color: rgba(255, 255, 255, 0.8);
+}
+#preview-footer-wrapper a:hover,
+#preview-footer-wrapper a:focus {
+ color: #fefefe;
+ color: rgba(255, 255, 255, 0.95);
+ text-decoration: underline;
+}
+#preview-footer-wrapper .preview-footer-column {
+ display: inline;
+ float: left;
+ padding: 0 10px;
+ position: relative;
+ width: 220px;
+}
+#preview-footer-wrapper .preview-block {
+ border: 1px solid #444;
+ border-color: rgba(255, 255, 255, 0.1);
+ margin: 20px 0;
+ padding: 10px;
+}
+#preview-footer-columns .preview-block-menu {
+ border: none;
+ margin: 0;
+ padding: 0;
+}
+#preview-footer-columns h2 {
+ border-bottom: 1px solid #555;
+ border-color: rgba(255, 255, 255, 0.15);
+ font-size: 1em;
+ margin-bottom: 0;
+ padding-bottom: 3px;
+ text-transform: uppercase;
+}
+#preview-footer-columns .preview-content {
+ margin-top: 0;
+}
+#preview-footer-columns .preview-content ul {
+ margin-left: 0;
+ padding-left: 0;
+}
+#preview-footer-columns .preview-content li {
+ list-style: none;
+ list-style-image: none;
+ margin: 0;
+ padding: 0;
+}
+#preview-footer-columns .preview-content li a {
+ border-bottom: 1px solid #555;
+ border-color: rgba(255, 255, 255, 0.15);
+ display: block;
+ line-height: 1.2;
+ padding: 0.8em 2px 0.8em 20px;
+ text-indent: -15px;
+}
+#preview-footer-columns .preview-content li a:hover,
+#preview-footer-columns .preview-content li a:focus {
+ background-color: #1f1f21;
+ background-color: rgba(255, 255, 255, 0.05);
+ text-decoration: none;
+}
diff --git a/STARTERKIT/color/preview.html b/STARTERKIT/color/preview.html
new file mode 100644
index 0000000..04614fc
--- /dev/null
+++ b/STARTERKIT/color/preview.html
@@ -0,0 +1,65 @@
+<div id="preview">
+
+ <div id="preview-header">
+ <div id="preview-logo"><img src="../../../themes/STARTERKIT/logo.png" alt="Site Logo" /></div>
+ <div id="preview-site-name">STARTERKIT</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">
+ <div id="preview-footer-columns" class="clearfix">
+ <div class="preview-footer-column">
+ <div class="preview-block">
+ <h2>Etiam est risus</h2>
+ <div class="content">
+ Maecenas id porttitor Ut enim ad minim veniam, quis nostrudfelis.
+ Laboris nisi ut aliquip ex ea.
+ </div>
+ </div>
+ </div>
+ <div class="preview-footer-column">
+ <div class="preview-block preview-block-menu">
+ <h2>Erisus dolor</h2>
+ <div class="preview-content">
+ <ul>
+ <li><a>Donec placerat</a></li>
+ <li><a>Nullam nibh dolor</a></li>
+ <li><a>Blandit sed</a></li>
+ <li><a>Fermentum id</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+</div>
diff --git a/STARTERKIT/color/preview.js b/STARTERKIT/color/preview.js
new file mode 100644
index 0000000..b40bcf7
--- /dev/null
+++ b/STARTERKIT/color/preview.js
@@ -0,0 +1,39 @@
+
+(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');
+ }
+
+ // Solid background.
+ $('#preview', form).css('backgroundColor', $('#palette input[name="palette[bg]"]', form).val());
+
+ // Text preview.
+ $('#preview #preview-main h2, #preview .preview-content', form).css('color', $('#palette input[name="palette[text]"]', form).val());
+ $('#preview #preview-content a', form).css('color', $('#palette input[name="palette[link]"]', form).val());
+
+ // Sidebar block.
+ $('#preview #preview-sidebar #preview-block', form).css('background-color', $('#palette input[name="palette[sidebar]"]', form).val());
+ $('#preview #preview-sidebar #preview-block', form).css('border-color', $('#palette input[name="palette[sidebarborders]"]', form).val());
+
+ // Footer wrapper background.
+ $('#preview #preview-footer-wrapper', form).css('background-color', $('#palette input[name="palette[footer]"]', form).val());
+
+ // CSS3 Gradients.
+ var gradient_start = $('#palette input[name="palette[top]"]', form).val();
+ var gradient_end = $('#palette input[name="palette[bottom]"]', form).val();
+
+ $('#preview #preview-header', 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 + ");");
+
+ $('#preview #preview-site-name', form).css('color', $('#palette input[name="palette[titleslogan]"]', form).val());
+ }
+ };
+})(jQuery);
diff --git a/STARTERKIT/color/preview.png b/STARTERKIT/color/preview.png
new file mode 100644
index 0000000..58cc088
--- /dev/null
+++ b/STARTERKIT/color/preview.png
Binary files differ
diff --git a/template.php b/template.php
index b4e4a0a..4b9abb2 100644
--- a/template.php
+++ b/template.php
@@ -184,6 +184,10 @@ function zen_preprocess_html(&$variables, $hook) {
* The name of the template being rendered ("html" in this case.)
*/
function zen_process_html(&$variables, $hook) {
+ // Hook into color.module.
+ if (module_exists('color')) {
+ _color_html_alter($variables);
+ }
// Flatten out html_attributes.
$variables['html_attributes'] = drupal_attributes($variables['html_attributes_array']);
}
@@ -234,6 +238,16 @@ function zen_preprocess_page(&$variables, $hook) {
}
/**
+ * Override or insert variables into the page template.
+ */
+function zen_process_page(&$variables, $hook) {
+ // Hook into color.module.
+ if (module_exists('color')) {
+ _color_page_alter($variables);
+ }
+}
+
+/**
* Override or insert variables into the maintenance page template.
*
* @param $variables