From 6b35cf821e735163cef17fff8714da5d022330f5 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 18 Apr 2012 18:15:02 +0800 Subject: [PATCH] some updates --- app/assets/javascripts/orbitdesktop.js | 39 ++++++++++++++- app/assets/javascripts/orbitdesktopAPI.js | 9 +++- app/assets/stylesheets/desktopmain.css | 33 +++++++------ app/views/desktop/settings/themes.html.erb | 55 +++++++++++----------- 4 files changed, 92 insertions(+), 44 deletions(-) diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index fe18b4d6..889d859c 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -495,8 +495,8 @@ var orbitDesktop = function(dom){ var bindHandlers = function(){ $(".theme_list > li").click(function(){ o.changeTheme($(this).attr("id")); - $(".theme_list > li").removeClass('thmc1').data('clicked',null).find('.theme_name').removeClass('thmtxt'); - $(this).addClass('thmc1').data('clicked',true).find('.theme_name').addClass('thmtxt'); + // $(".theme_list > li").removeClass('thmc1').data('clicked',null).find('.theme_name').removeClass('thmtxt'); + // $(this).addClass('thmc1').data('clicked',true).find('.theme_name').addClass('thmtxt'); $.post("/desktop/save_desktop_settings",{"save":"theme","desktopid":o.desktopId,"theme":$(this).attr("id")},function(result,status){ if(status=="success"){ if(result[0].success=="true") @@ -508,6 +508,19 @@ var orbitDesktop = function(dom){ } }); }); + $('.ssl .ssl_item').each(function(){ + $(this).on({ + click: function(){ + $(this).switchClass('','thmc1 active',300); + $(this).siblings('.thmc1').switchClass('thmc1 active','',100); + + if( $(this).find('.ssl_des') ){ + $(this).parents('.ssl').find('.ssl_des').removeClass('thmtxt'); + $(this).find('.ssl_des').addClass('thmtxt'); + } + } + }); + }); $('.tinycanvas').each(function(){ var h = $(this).parent().height(), sh = $(this).siblings('.s_tab').height(); @@ -585,6 +598,28 @@ var orbitDesktop = function(dom){ }) } + var loadthmc = function(){ + $('.color-picker').each(function(){ + var cc = $(this).attr('for'), hex, color; + switch(cc){ + case 'thmtxt': + case 'thmtxth': + hex = 'color'; + break; + case 'g_sep': + hex = 'border-left-color'; + break; + default: + hex = 'background-color'; + break; + } + if(cc=="background") + color = $("#theme_preview_area").css("background-color"); + else + color = $('#theme_preview_area .'+cc).css(hex); + $(this).miniColors("value", o.rgb2hex(color)); + }); + } $("div#settings div#panel_r").load("/desktop/settingthemes",function(){ $.getJSON("/desktop/get_desktop_settings",{"get":"theme","desktopid":o.desktopId},function(theme){ $("#st1 ul.theme_list li#"+theme).addClass("thmc1").find("span").addClass("thmtxt"); diff --git a/app/assets/javascripts/orbitdesktopAPI.js b/app/assets/javascripts/orbitdesktopAPI.js index a6de0df6..83e0af39 100644 --- a/app/assets/javascripts/orbitdesktopAPI.js +++ b/app/assets/javascripts/orbitdesktopAPI.js @@ -55,5 +55,12 @@ var orbitDesktopAPI = function(){ var A = key(a), B = key(b); return ((A < B) ? -1 : (A > B) ? +1 : 0) * [-1,1][+!!reverse]; } - } + }; + this.rgb2hex = function(rgb) { + rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); + var hex = function(x) { + return ("0" + parseInt(x).toString(16)).slice(-2); + } + return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); + }; }; diff --git a/app/assets/stylesheets/desktopmain.css b/app/assets/stylesheets/desktopmain.css index af14714c..f0a1e9a8 100644 --- a/app/assets/stylesheets/desktopmain.css +++ b/app/assets/stylesheets/desktopmain.css @@ -259,29 +259,34 @@ a:focus { outline: none; } /* Setting Page */ .theme_list {} -.theme_list li { +.theme_list .ssl_item, .stock_wallpaper .ssl_item { display: inline-block; vertical-align: top; - margin: 0 0 24px 0; + margin: 0 0 12px 0; padding: 6px 0px; width: 132px; text-align: center; cursor: pointer } -.theme_thumb { border: solid 1px #fff; width: 120px; margin: 0 auto; } -.theme_thumb img { display: block; } +.theme_thumb, .stock_wallpaper img { border: solid 1px #fff; width: 120px; margin: 0 auto; } +.theme_thumb img, .stock_wallpaper img { display: block; } .theme_name { font-size: 15px; padding: 8px 6px; display: block; } .theme_preview { width: 528px; height: 150px; line-height: 36px; font-size: 15px; } .theme_plate { overflow: hidden; } .theme_plate > div { float: left; margin-right: 12px; } .theme_plate > div:first-child { margin-right: 48px;} -.stock_background ul { overflow: hidden; } -.stock_background li { float: left; margin: 6px; } -.stock_background a { border: solid 3px #f6f6f6; display: block; } -.stock_background img { display: block; margin: 0 auto; border: solid 1px #fff; } +.stock_wallpaper { } +.stock_wallpaper .ssl_item { margin-bottom: 6px; } +.stock_wallpaper img { } .s_title { font-size: 15px; line-height: 60px; text-align: left; } -.s_action { padding: 24px 0; overflow: hidden; } +.s_action { + padding: 24px 0; + margin-top: 12px; + overflow: hidden; + border-top: solid 1px #eee; + background-color: #fff; +} .setting_btn { display: block; float: right; @@ -355,11 +360,11 @@ a:focus { outline: none; } .tinycanvas .viewport { width: auto; height: 100%; overflow: hidden; position: relative; } .tinycanvas .overview { position: absolute; left: 0; top: 0; } .tinycanvas .scrollbar { position: absolute; z-index: 9; } -.tinycanvas .scrollbar.sb_h { left: 0; bottom: 0; height: 12px; } -.tinycanvas .scrollbar.sb_v { right: 0; top: 0; width: 12px; } -.tinycanvas .track { height: 100%; width: 12px; position: relative; } -.tinycanvas .thumb { height: 12px; width: 12px; cursor: pointer; overflow: hidden; position: absolute; top: 0; } -.tinycanvas .thumb .end { overflow: hidden; height: 12px; width: 12px; } +.tinycanvas .scrollbar.sb_h { left: 0; bottom: 0; height: 6px; } +.tinycanvas .scrollbar.sb_v { right: 0; top: 0; width: 6px; } +.tinycanvas .track { height: 100%; width: 6px; position: relative; } +.tinycanvas .thumb { height: 6px; width: 6px; cursor: pointer; overflow: hidden; position: absolute; top: 0; } +.tinycanvas .thumb .end { overflow: hidden; height: 6px; width: 6px; } .tinycanvas .disable{ display: none; } /* Orbit Notification */ diff --git a/app/views/desktop/settings/themes.html.erb b/app/views/desktop/settings/themes.html.erb index 4d9b9141..9be87d27 100644 --- a/app/views/desktop/settings/themes.html.erb +++ b/app/views/desktop/settings/themes.html.erb @@ -2,7 +2,7 @@
@@ -10,18 +10,18 @@
-
    -
  • Default
  • -
  • Snake
  • -
  • Sexy
  • -
  • Vintage
  • -
  • Natural
  • -
  • Chris
  • -
+
+
Default
+
Snake
+
Sexy
+
Vintage
+
Natural
+
Chris
+
Preview
-
+
Theme Text1
@@ -31,14 +31,14 @@
- +
- +
Theme Color Line Color Text Color Background Color
@@ -63,22 +63,23 @@
-
-
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Confirm +