summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-17 18:49:25 -0700
committerZach Copley <zach@controlyourself.ca>2009-06-17 18:49:25 -0700
commit6c7bdf9df67d02d26d3052e7fba5a80c482aacb8 (patch)
tree41bb18e5c8e3d873aefaf3a07bf9fd287f2aaeed /js
parent85b4c24188502ce3f8cef32cfba37ab91c8a648f (diff)
parent00736bddd199b2a43820367c3476b9e9ec84c0db (diff)
Merge branch 'userdesign' into 0.8.x
* userdesign: (56 commits) Fix for background image repetition for various page heights Removed height:100% for better background image repetition A little more specific selector for notice reply Have user favorites page show user's design Placed a check to make sure there is a reply button in a notice before Make MailboxAction read only Remove stale reference to deprecated personal.php Uppercase hex color values Default to image being on, no tile after upload Fix sidebar color bug default design Update background image settings to use bitflags It was accidently removed Dynamically tile background image and turn background image on or off Show a background img in settings form IE7/8 CSS update for user design Enable tiling of background imgs for Designs Added background image tile flag to Design Init styles for tile and image use on/off for user design settings Added form option to tile background image and to turn it on and off Add background dir ...
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
-rw-r--r--js/util.js4
3 files changed, 46 insertions, 16 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
diff --git a/js/util.js b/js/util.js
index ce0c20d31..17ae4c071 100644
--- a/js/util.js
+++ b/js/util.js
@@ -235,7 +235,7 @@ $(document).ready(function(){
});
function NoticeReply() {
- if ($('#notice_data-text').length > 0) {
+ if ($('#notice_data-text').length > 0 && $('#content .notice_reply').length > 0) {
$('#content .notice').each(function() {
var notice = $(this)[0];
$($('.notice_reply', notice)[0]).click(function() {
@@ -308,4 +308,4 @@ function NoticeAttachments() {
$(this).closest(".entry-title").removeClass('ov');
}
);
-} \ No newline at end of file
+}