custom theme settings

This commit is contained in:
devin committed 2012-04-10 17:44:36 +08:00
1 parent 6006f1b3c6
commit 360e5228b7
17 files changed
+610 -427

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+1
View File
@@ -8,6 +8,7 @@
//= require jquery_ujs
//= require jquery-ui
//= require jquery.tinyscrollbar.min
//= require jquery.miniColors.min
//= require bootstrap
//= require orbitdesktopAPI
//= require orbitdesktop
+9
View File
@@ -0,0 +1,9 @@
/*
* jQuery miniColors: A small color selector
*
* Copyright 2011 Cory LaViska for A Beautiful Site, LLC. (http://abeautifulsite.net/)
*
* Dual licensed under the MIT or GPL Version 2 licenses
*
*/
if(jQuery)(function($){$.extend($.fn,{miniColors:function(o,data){var create=function(input,o,data){var color=expandHex(input.val());if(!color)color='ffffff';var hsb=hex2hsb(color);var trigger=$('<a class="miniColors-trigger" style="background-color: #'+color+'" href="#"></a>');trigger.insertAfter(input);input.addClass('miniColors').data('original-maxlength',input.attr('maxlength')||null).data('original-autocomplete',input.attr('autocomplete')||null).data('letterCase','uppercase').data('trigger',trigger).data('hsb',hsb).data('change',o.change?o.change:null).attr('maxlength',7).attr('autocomplete','off').val('#'+convertCase(color,o.letterCase));if(o.readonly)input.prop('readonly',true);if(o.disabled)disable(input);trigger.bind('click.miniColors',function(event){event.preventDefault();if(input.val()==='')input.val('#');show(input)});input.bind('focus.miniColors',function(event){if(input.val()==='')input.val('#');show(input)});input.bind('blur.miniColors',function(event){var hex=expandHex(input.val());input.val(hex?'#'+convertCase(hex,input.data('letterCase')):'')});input.bind('keydown.miniColors',function(event){if(event.keyCode===9)hide(input)});input.bind('keyup.miniColors',function(event){setColorFromInput(input)});input.bind('paste.miniColors',function(event){setTimeout(function(){setColorFromInput(input)},5)})};var destroy=function(input){hide();input=$(input);input.data('trigger').remove();input.attr('autocomplete',input.data('original-autocomplete')).attr('maxlength',input.data('original-maxlength')).removeData().removeClass('miniColors').unbind('.miniColors');$(document).unbind('.miniColors')};var enable=function(input){input.prop('disabled',false).data('trigger').css('opacity',1)};var disable=function(input){hide(input);input.prop('disabled',true).data('trigger').css('opacity',0.5)};var show=function(input){if(input.prop('disabled'))return false;hide();var selector=$('<div class="miniColors-selector"></div>');selector.append('<div class="miniColors-colors" style="background-color: #FFF;"><div class="miniColors-colorPicker"></div></div>').append('<div class="miniColors-hues"><div class="miniColors-huePicker"></div></div>').css({top:input.is(':visible')?input.offset().top+input.outerHeight():input.data('trigger').offset().top+input.data('trigger').outerHeight(),left:input.is(':visible')?input.offset().left:input.data('trigger').offset().left,display:'none'}).addClass(input.attr('class'));var hsb=input.data('hsb');selector.find('.miniColors-colors').css('backgroundColor','#'+hsb2hex({h:hsb.h,s:100,b:100}));var colorPosition=input.data('colorPosition');if(!colorPosition)colorPosition=getColorPositionFromHSB(hsb);selector.find('.miniColors-colorPicker').css('top',colorPosition.y+'px').css('left',colorPosition.x+'px');var huePosition=input.data('huePosition');if(!huePosition)huePosition=getHuePositionFromHSB(hsb);selector.find('.miniColors-huePicker').css('top',huePosition.y+'px');input.data('selector',selector).data('huePicker',selector.find('.miniColors-huePicker')).data('colorPicker',selector.find('.miniColors-colorPicker')).data('mousebutton',0);$('BODY').append(selector);selector.fadeIn(100);selector.bind('selectstart',function(){return false});$(document).bind('mousedown.miniColors touchstart.miniColors',function(event){input.data('mousebutton',1);if($(event.target).parents().andSelf().hasClass('miniColors-colors')){event.preventDefault();input.data('moving','colors');moveColor(input,event)}if($(event.target).parents().andSelf().hasClass('miniColors-hues')){event.preventDefault();input.data('moving','hues');moveHue(input,event)}if($(event.target).parents().andSelf().hasClass('miniColors-selector')){event.preventDefault();return}if($(event.target).parents().andSelf().hasClass('miniColors'))return;hide(input)});$(document).bind('mouseup.miniColors touchend.miniColors',function(event){event.preventDefault();input.data('mousebutton',0).removeData('moving')}).bind('mousemove.miniColors touchmove.miniColors',function(event){event.preventDefault();if(input.data('mousebutton')===1){if(input.data('moving')==='colors')moveColor(input,event);if(input.data('moving')==='hues')moveHue(input,event)}})};var hide=function(input){if(!input)input='.miniColors';$(input).each(function(){var selector=$(this).data('selector');$(this).removeData('selector');$(selector).fadeOut(100,function(){$(this).remove()})});$(document).unbind('.miniColors')};var moveColor=function(input,event){var colorPicker=input.data('colorPicker');colorPicker.hide();var position={x:event.pageX,y:event.pageY};if(event.originalEvent.changedTouches){position.x=event.originalEvent.changedTouches[0].pageX;position.y=event.originalEvent.changedTouches[0].pageY}position.x=position.x-input.data('selector').find('.miniColors-colors').offset().left-5;position.y=position.y-input.data('selector').find('.miniColors-colors').offset().top-5;if(position.x<=-5)position.x=-5;if(position.x>=144)position.x=144;if(position.y<=-5)position.y=-5;if(position.y>=144)positiLine truncated
+38 -4
View File
@@ -145,7 +145,7 @@ var orbitDesktop = function(dom){
}
});
$('#holder').tinyscrollbar({ axis: 'x'});
$('.tinycanvas').tinyscrollbar({ axis: 'x'});
$("div.scrollbar").hover(function(){
$(this).removeClass('op01');
}, function(){
@@ -221,7 +221,7 @@ var orbitDesktop = function(dom){
$(".group_search").html(allApps);
return false;
})
$('#holder').tinyscrollbar({ axis: 'x'});
$('.tinycanvas').tinyscrollbar({ axis: 'x'});
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
@@ -265,7 +265,7 @@ var orbitDesktop = function(dom){
$(this).find('span.tile').addClass('op06');
}
});
$('#holder').tinyscrollbar({ axis: 'x'});
$('.tinycanvas').tinyscrollbar({ axis: 'x'});
var $sdm = $('.sdm');
if( !$sdm.children('.sdm_o') ){
@@ -295,7 +295,41 @@ var orbitDesktop = function(dom){
$("select#change_theme").change(function(){
o.changeTheme($(this).val());
});
$('#panel_r').tinyscrollbar({ axis: 'y'});
$('.tinycanvas').each(function(){
var h = $(this).parent().height(),
sh = $(this).siblings('.s_tab').height();
$(this).css({'height': h-sh-24}).tinyscrollbar({ axis: 'y'});
});
// simple tab navgation
var $anchor = $('.s_tab a[href*=#]'),
$tabcontent = $('.st_c');
$anchor.each(function(){
$(this).click(function(){
var target = $(this).attr('href');
$anchor
.removeClass('thmc2 thmtxt admtxt')
.addClass('admtxt');
$(this).toggleClass('thmc2 thmtxt admtxt');
$tabcontent.hide();
$(target).show();
$('.tinycanvas').tinyscrollbar_update();
return false;
});
});
// simple menu
// miniColors
$('.color-picker').miniColors({
});
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
+2
View File
@@ -5,5 +5,7 @@
*= require style
*= require bootstrap
*= require bootstrap-orbit
*= require jquery.miniColors
*= require desktopmain
*= require desktopmedia
*/
+30 -12
View File
@@ -60,6 +60,7 @@ body {
background-color: #000;
}
a, a:hover { text-decoration: none; }
a:focus { outline: none; }
/* desktop layout */
#container {
margin: 48px 0 0 156px;
@@ -160,7 +161,7 @@ a, a:hover { text-decoration: none; }
line-height: 30px;
overflow: hidden;
cursor: default;
z-index: 2;
z-index: 3;
}
.w1.h1 .appname { text-align: center; }
.w2.h2 .appname { font-size: 21px; }
@@ -243,11 +244,27 @@ a, a:hover { text-decoration: none; }
.s_tab { font-size: 15px; line-height: 36px; }
.stb_h {}
.stb_v {}
.s_tab li { display: inline-block; }
.s_tab ul { overflow: hidden; }
.s_tab li { float: left; }
.s_tab a { display: block; }
.st_c { display: none; }
.st_c:first-child { display: block; }
/* Setting Page */
.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;}
.s_title { font-size: 15px; line-height: 60px; text-align: left; }
.s_action { padding: 24px 0; overflow: hidden; }
#theme_submit {
display: block;
float: right;
font-size: 15px;
line-height: 36px;
text-align: center;
}
/* theme color opacity */
.op10 { opacity: 1; }
.op09 { opacity: 0.9; }
@@ -269,7 +286,7 @@ a, a:hover { text-decoration: none; }
.wh2 { width: 36px; }
.wh3 { width: 60px; }
.w100 { width: 100%; }
.pw { width: 572px; }
.pw { width: 540px; }
.h1 { height: 96px; }
.h2 { height: 228px; }
@@ -309,15 +326,16 @@ a, a:hover { text-decoration: none; }
.clear { clear: both; }
/* tiny scrollbar */
#holder .viewport { width: auto; height: 516px; overflow: hidden; position: relative; }
#holder .overview { position: absolute; left: 0; top: 0; }
#holder .scrollbar { position: absolute; }
#holder .scrollbar.sb_h { left: 0; bottom: 0; height: 12px; }
#holder .scrollbar.sb_v { right: 0; top: 0; width: 12px; }
#holder .track { height: 100%; width: 12px; position: relative; }
#holder .thumb { height: 12px; width: 12px; cursor: pointer; overflow: hidden; position: absolute; top: 0; }
#holder .thumb .end { overflow: hidden; height: 12px; width: 12px; }
#holder .disable{ display: none; }
.tinycanvas { overflow: hidden; position: relative; height: 100%; }
.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 .disable{ display: none; }
/* Orbit Notification */
#orbitnote {
+10
View File
@@ -0,0 +1,10 @@
@media only screen and (min-width: 1200px){
#panel_r.pw { width: 800px; }
}
@media only screen and (min-width: 1900px){
#panel_r.pw { width: 1560px; }
}
+59
View File
@@ -0,0 +1,59 @@
.miniColors-trigger {
height: 36px;
width: 36px;
border: solid 3px #e8e8e8;
vertical-align: middle;
margin: 0 6px 0 0;
display: inline-block;
outline: none;
}
.miniColors-selector {
position: absolute;
width: 175px;
height: 150px;
background: #FFF;
border: solid 1px #BBB;
padding: 5px;
z-index: 999999;
}
.miniColors-selector.black {
background: #000;
border-color: #000;
}
.miniColors-colors {
position: absolute;
top: 5px;
left: 5px;
width: 150px;
height: 150px;
background: url(miniColors/gradient.png) center no-repeat;
cursor: crosshair;
}
.miniColors-hues {
position: absolute;
top: 5px;
left: 160px;
width: 20px;
height: 150px;
background: url(miniColors/rainbow.png) center no-repeat;
cursor: crosshair;
}
.miniColors-colorPicker {
position: absolute;
width: 11px;
height: 11px;
background: url(miniColors/circle.gif) center no-repeat;
}
.miniColors-huePicker {
position: absolute;
left: -3px;
width: 26px;
height: 3px;
background: url(miniColors/line.gif) center no-repeat;
}