summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/farbtastic/farbtastic.js20
-rw-r--r--js/userdesign.go.js (renamed from js/farbtastic/farbtastic.go.js)38
2 files changed, 44 insertions, 14 deletions
diff --git a/js/farbtastic/farbtastic.js b/js/farbtastic/farbtastic.js
index 24a377803..d8b5ad9cd 100644
--- a/js/farbtastic/farbtastic.js
+++ b/js/farbtastic/farbtastic.js
@@ -1,5 +1,21 @@
-// $Id: farbtastic.js,v 1.2 2007/01/08 22:53:01 unconed Exp $
-// Farbtastic 1.2
+/**
+ * Farbtastic Color Picker 1.2
+ * © 2008 Steven Wittens
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
jQuery.fn.farbtastic = function (callback) {
$.farbtastic(this, callback);
diff --git a/js/farbtastic/farbtastic.go.js b/js/userdesign.go.js
index 0149eca7d..b54b492cc 100644
--- a/js/farbtastic/farbtastic.go.js
+++ b/js/userdesign.go.js
@@ -10,19 +10,19 @@ $(document).ready(function() {
function UpdateColors(S) {
C = $(S).val();
switch (parseInt(S.id.slice(-1))) {
- case 0: default:
- $('body').css({'background-color':C});
- break;
- case 1:
- $('#content').css({'background-color':C});
+ case 1: default:
+ $('html, body').css({'background-color':C});
break;
case 2:
- $('#aside_primary').css({'background-color':C});
+ $('#content, #site_nav_local_views .current a').css({'background-color':C});
break;
case 3:
- $('body').css({'color':C});
+ $('#aside_primary').css({'background-color':C});
break;
case 4:
+ $('html body').css({'color':C});
+ break;
+ case 5:
$('a').css({'color':C});
break;
}
@@ -49,7 +49,7 @@ $(document).ready(function() {
}
}
- function Init() {
+ function InitFarbtastic() {
$('#settings_design_color').append('<div id="color-picker"></div>');
$('#color-picker').hide();
@@ -59,7 +59,9 @@ $(document).ready(function() {
swatches
.each(SynchColors)
.blur(function() {
- $(this).val($(this).val().toUpperCase());
+ tv = $(this).val();
+ $(this).val(tv.toUpperCase());
+ (tv.length == 4) ? ((tv[0] == '#') ? $(this).val('#'+tv[1]+tv[1]+tv[2]+tv[2]+tv[3]+tv[3]) : '') : '';
})
.focus(function() {
$('#color-picker').show();
@@ -73,13 +75,25 @@ $(document).ready(function() {
}
var f, swatches;
- Init();
+ InitFarbtastic();
$('#form_settings_design').bind('reset', function(){
setTimeout(function(){
swatches.each(function(){UpdateColors(this);});
$('#color-picker').remove();
swatches.unbind();
- Init();
+ InitFarbtastic();
},10);
});
-});
+
+ $('#design_background-image_off').focus(function() {
+ $('body').css({'background-image':'none'});
+ });
+ $('#design_background-image_on').focus(function() {
+ var bis = $('#design_background-image_onoff img')[0].src;
+ $('body').css({'background-image':'url('+bis+')'});
+ });
+
+ $('#design_background-image_repeat').click(function() {
+ ($(this)[0].checked) ? $('body').css({'background-repeat':'repeat'}) : $('body').css({'background-repeat':'no-repeat'});
+ });
+}); \ No newline at end of file