Index: API.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/API.txt,v
retrieving revision 1.1.2.13
diff -u -r1.1.2.13 API.txt
--- API.txt	19 Oct 2010 07:49:04 -0000	1.1.2.13
+++ API.txt	25 Oct 2010 13:24:29 -0000
@@ -350,19 +350,38 @@
 The variable in the database is 'sweaver_skin'.
 
 ------------------------------------------------------
-13. Theme info selectors.
+13. Theme extensions.
 ------------------------------------------------------
-You can define selectors per theme in the info file, eg:
 
-sweaver[body] = Body
-sweaver[h1] = Heading 1
+1. Palettes
+
+Every theme can define color palettes. These palettes are
+extra css files that can be added to your theme and that
+overwrite the default css.
+
+You can add a palette and 5 preview colors in your .info file, e.g.:
+
+sweaver[palettes][pink][name] = Pink
+sweaver[palettes][pink][file] = palettes/pink.css
+sweaver[palettes][pink][colors][] = #f98cf0
+sweaver[palettes][pink][colors][] = #af63a9
+sweaver[palettes][pink][colors][] = #af63a9
+sweaver[palettes][pink][colors][] = #cbb2c9
+sweaver[palettes][pink][colors][] = #cbb2c9 
+
+2. Selectors
+
+You can also define selectors per theme in the info file, eg:
+
+sweaver[selectors][body] = Body
+sweaver[selectors][h1] = Heading 1
 ...
 
 The order is how you define it in the info file.
 In the backend you can select if these selectors
 are to be used instead of those in the database.
 
-Note: if you add new selectors but they don't show up,
+Note: if you add new theme extensions but they don't show up,
 then you need to clear the theme registry.
 
 ------------------------------------------------------
Index: sweaver.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/Attic/sweaver.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 sweaver.inc
--- sweaver.inc	30 Sep 2010 14:19:49 -0000	1.1.2.2
+++ sweaver.inc	25 Oct 2010 13:12:27 -0000
@@ -169,7 +169,7 @@
         $css->type = 'draft';
       }
       else {
-        $css = db_fetch_object(db_query("SELECT style_id, theme, style, css, customcss, themesettings, active FROM {sweaver_style} where theme = '%s' and active = 1", $this->theme));
+        $css = db_fetch_object(db_query("SELECT style_id, theme, style, css, customcss, palette, themesettings, active FROM {sweaver_style} where theme = '%s' and active = 1", $this->theme));
         $css->type = 'live';
       }
       if (!isset($css->style_id)) {
Index: sweaver.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/sweaver.install,v
retrieving revision 1.1.2.26
diff -u -r1.1.2.26 sweaver.install
--- sweaver.install	13 Oct 2010 12:17:50 -0000	1.1.2.26
+++ sweaver.install	25 Oct 2010 12:16:04 -0000
@@ -136,13 +136,14 @@
     'sweaver_plugin_editor' => -49,
     'sweaver_plugin_styles' => -48,
     'sweaver_plugin_customcss' => -47,
-    'sweaver_plugin_images' => -46,
-    'sweaver_plugin_themeswitch' => -45,
-    'sweaver_plugin_themesettings' => -44,
-    'sweaver_plugin_themeclasses' => -43,
-    'sweaver_plugin_fontface' => -42,
-    'sweaver_plugin_ds' => -41,
-    'sweaver_plugin_kb' => -40,
+    'sweaver_plugin_palettes' => -46,
+    'sweaver_plugin_images' => -45,
+    'sweaver_plugin_themeswitch' => -44,
+    'sweaver_plugin_themesettings' => -43,
+    'sweaver_plugin_themeclasses' => -42,
+    'sweaver_plugin_fontface' => -41,
+    'sweaver_plugin_ds' => -40,
+    'sweaver_plugin_kb' => -39,
   );
   variable_set('sweaver_plugins_weight', $plugins_weight);
 
@@ -206,6 +207,13 @@
         'type' => 'text',
         'size' => 'big'
       ),
+      'palette' => array(
+        'description' => 'Palette',
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+        'default' => ''
+      ),
       'themesettings' => array(
         'description' => 'Theme settings',
         'type' => 'text',
@@ -255,6 +263,11 @@
         'type' => 'text',
         'size' => 'big'
       ),
+      'palette' => array(
+        'description' => 'Palette',
+        'type' => 'text',
+        'size' => 'big'
+      ),
       'themesettings' => array(
         'description' => 'Theme settings',
         'type' => 'text',
Index: sweaver.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/sweaver.module,v
retrieving revision 1.1.2.32
diff -u -r1.1.2.32 sweaver.module
--- sweaver.module	11 Oct 2010 08:40:12 -0000	1.1.2.32
+++ sweaver.module	25 Oct 2010 11:59:06 -0000
@@ -326,6 +326,12 @@
       $vars['styles'] = drupal_get_css();
     }
   }
+
+  foreach (array_keys($sweaver->get_plugins_registry(TRUE)) as $plugin_name) {
+    $sweaver_plugin = $sweaver->get_plugin($plugin_name);
+    // Fire preprocess.
+    $sweaver_plugin->sweaver_preprocess_page(&$vars);
+  }
 }
 
 /**
Index: sweaver.registry.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/sweaver.registry.inc,v
retrieving revision 1.1.2.28
diff -u -r1.1.2.28 sweaver.registry.inc
--- sweaver.registry.inc	13 Oct 2010 12:12:37 -0000	1.1.2.28
+++ sweaver.registry.inc	19 Oct 2010 09:11:49 -0000
@@ -167,6 +167,15 @@
       'parent' => 'sweaver_plugin',
     ),
   );
+  $plugins['sweaver_plugin_palettes'] = array(
+    'handler' => array(
+      'tab' => t('Palettes'),
+      'path' => drupal_get_path('module', 'sweaver') .'/plugins/sweaver_plugin_palettes',
+      'file' => 'sweaver_plugin_palettes.inc',
+      'class' => 'sweaver_plugin_palettes',
+      'parent' => 'sweaver_plugin',
+    ),
+  );
 
   return $plugins;
 }
Index: sweaver_plugin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/Attic/sweaver_plugin.inc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 sweaver_plugin.inc
--- sweaver_plugin.inc	30 Sep 2010 13:54:02 -0000	1.1.2.1
+++ sweaver_plugin.inc	22 Oct 2010 07:31:34 -0000
@@ -57,6 +57,13 @@
   }
 
   /**
+   * Preprocess page function.
+   */
+  public function sweaver_preprocess_page(&$vars) {
+    // Initial things to do.
+  }
+
+  /**
    * Sweaver dependencies.
    */
   public function sweaver_dependencies() {
Index: plugins/sweaver_plugin_editor/sweaver_plugin_editor.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/plugins/sweaver_plugin_editor/sweaver_plugin_editor.inc,v
retrieving revision 1.1.2.23
diff -u -r1.1.2.23 sweaver_plugin_editor.inc
--- plugins/sweaver_plugin_editor/sweaver_plugin_editor.inc	14 Oct 2010 08:03:38 -0000	1.1.2.23
+++ plugins/sweaver_plugin_editor/sweaver_plugin_editor.inc	25 Oct 2010 13:15:07 -0000
@@ -334,8 +334,8 @@
 
     if (variable_get('sweaver_selectors_source', FALSE)) {
       $theme_info = sweaver_get_theme_info($theme_key);
-      if (isset($theme_info['sweaver'])) {
-        foreach ($theme_info['sweaver'] as $selector_name => $selector_description) {
+      if (isset($theme_info['sweaver']['selectors'])) {
+        foreach ($theme_info['sweaver']['selectors'] as $selector_name => $selector_description) {
           $selector = new stdClass;
           $name = str_replace(array('', '.', '-'), array(''), $selector_name);
           $selector->name = $name;
Index: plugins/sweaver_plugin_editor/sweaver_plugin_editor.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/plugins/sweaver_plugin_editor/sweaver_plugin_editor.js,v
retrieving revision 1.1.2.56
diff -u -r1.1.2.56 sweaver_plugin_editor.js
--- plugins/sweaver_plugin_editor/sweaver_plugin_editor.js	19 Oct 2010 07:49:04 -0000	1.1.2.56
+++ plugins/sweaver_plugin_editor/sweaver_plugin_editor.js	22 Oct 2010 09:39:05 -0000
@@ -171,6 +171,7 @@
 	          }
 	          else {
 	            if (value) {
+	              // IE7 bug with font-weight apparently
 	              $("#sweaver_plugin_editor #edit-" + object).val(value.replace('px', ''));
 	            }
 	          }
Index: plugins/sweaver_plugin_styles/sweaver_plugin_styles.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/plugins/sweaver_plugin_styles/sweaver_plugin_styles.inc,v
retrieving revision 1.1.2.62
diff -u -r1.1.2.62 sweaver_plugin_styles.inc
--- plugins/sweaver_plugin_styles/sweaver_plugin_styles.inc	19 Oct 2010 07:49:04 -0000	1.1.2.62
+++ plugins/sweaver_plugin_styles/sweaver_plugin_styles.inc	25 Oct 2010 12:02:27 -0000
@@ -620,6 +620,7 @@
     $style->style = t('Temporary');
     $style->css = $_POST['css'];
     $style->customcss = $_POST['customcss'];
+    $style->palette = $_POST['palette'];
 
     // Get the themesettings if applicable and overwrite style id & style name.
     $sweaver = Sweaver::get_instance();
Index: plugins/sweaver_plugin_styles/sweaver_plugin_styles.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/plugins/sweaver_plugin_styles/Attic/sweaver_plugin_styles.js,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 sweaver_plugin_styles.js
--- plugins/sweaver_plugin_styles/sweaver_plugin_styles.js	18 Sep 2010 13:33:25 -0000	1.1.2.9
+++ plugins/sweaver_plugin_styles/sweaver_plugin_styles.js	25 Oct 2010 12:22:51 -0000
@@ -27,16 +27,18 @@
   if (Drupal.Sweaver.changed) {
     Drupal.Sweaver.changed = false;
 	  
-    // Get values for css & customcss (if available)
+    // Get values for css, customcss & palette (if available)
     var css = $('#edit-css').val();
     var customcss = $('#edit-sweaver-plugin-custom-css').val();
+    var palette = $('#edit-sweaver-plugin-palette').val();    
 
     $.ajax({
       type: "POST",
       url: Drupal.settings.basePath + 'index.php?q=sweaver-autosave',
       data: {
         css: css,
-        customcss: customcss
+        customcss: customcss,
+        palette: palette        
       },
       dataType: 'json',
       timeout: 5000,
Index: plugins/sweaver_plugin_themesettings/sweaver_plugin_themesettings.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sweaver/plugins/sweaver_plugin_themesettings/sweaver_plugin_themesettings.inc,v
retrieving revision 1.1.2.29
diff -u -r1.1.2.29 sweaver_plugin_themesettings.inc
--- plugins/sweaver_plugin_themesettings/sweaver_plugin_themesettings.inc	19 Oct 2010 07:49:04 -0000	1.1.2.29
+++ plugins/sweaver_plugin_themesettings/sweaver_plugin_themesettings.inc	25 Oct 2010 13:13:10 -0000
@@ -215,6 +215,7 @@
           $style->style = t('Temporary');
           $style->css = '';
           $style->customcss = '';
+          $style->palette = '';
         }
         $style->themesettings = serialize($theme_values);
         ctools_object_cache_set('sweaver-styling', 'sweaver-styling', $style);

