summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-06-18 06:02:54 -0400
committerRobin Millette <millette@controlyourself.ca>2009-06-18 06:02:54 -0400
commitc442b400b985cb9e30bf036007bcffc96807d5a3 (patch)
treeaebb66931d6f15336df8bfcf05202b37ee4aff43 /js
parent65b4cfbb54f5b44820dd02bb9c3c2ca98dbbd321 (diff)
parent87f54c1136fa4ddc476baad0adeaf1b4e7097cc5 (diff)
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
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
+}