]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - js/userdesign.go.js
Merge branch 'master' of gitorious.org:statusnet/mainline
[quix0rs-gnu-social.git] / js / userdesign.go.js
index 18f72f96a43d0545ccc5ffc028ca519cd32e0a8a..f6c696759dc1080ced6b3a34b346376c4ea150d2 100644 (file)
@@ -2,7 +2,7 @@
  *
  * @package   StatusNet
  * @author Sarven Capadisli <csarven@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -16,7 +16,7 @@ $(document).ready(function() {
                 $(E).val(rgb2hex($('#content').css('background-color')));
                 break;
             case 3:
-                $(E).val(rgb2hex($('#aside_primary').css('background-color')));
+                $(E).val(rgb2hex($('#aside_primary_wrapper, #site_nav_local_views_wrapper').css('background-color')));
                 break;
             case 4:
                 $(E).val(rgb2hex($('html body').css('color')));
@@ -27,11 +27,12 @@ $(document).ready(function() {
         }
     }
 
-    /* rgb2hex written by R0bb13 <robertorebollo@gmail.com> */
     function rgb2hex(rgb) {
+        if (rgb.slice(0,1) == '#') { return rgb; }
         rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
         return '#' + dec2hex(rgb[1]) + dec2hex(rgb[2]) + dec2hex(rgb[3]);
     }
+    /* dec2hex written by R0bb13 <robertorebollo@gmail.com> */
     function dec2hex(x) {
         hexDigits = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
         return isNaN(x) ? '00' : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
@@ -44,10 +45,10 @@ $(document).ready(function() {
                 $('body').css({'background-color':C});
                 break;
             case 2:
-                $('#content, #site_nav_local_views .current a').css({'background-color':C});
+                $('#content').css({'background-color':C});
                 break;
             case 3:
-                $('#aside_primary').css({'background-color':C});
+                $('#aside_primary_wrapper, #site_nav_local_views_wrapper').css({'background-color':C});
                 break;
             case 4:
                 $('html body').css({'color':C});