Skip to content
Extraits de code Groupes Projets
Valider 7fefdd37 rédigé par Daniel Vincent Grippi's avatar Daniel Vincent Grippi
Parcourir les fichiers

minor cleanup

parent c43d61e0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
$('#move_friends_link').live( 'click', $('#move_friends_link').live( 'click', function(){
function(){ $.post('/groups/move_friends',
$.post('/groups/move_friends', { 'moves' : $('#group_list').data() },
{'moves' : $('#group_list').data()}, function(){ $('#group_title').html("Groups edited successfully!");});
function(){ $('#group_title').html("Groups edited successfully!");});
$(".person").css('background-color','white');
$('#group_list').removeData();
$(".person").attr('from_group_id', function(){return $(this).parent().attr('id')})
});
$(function() { $(".person").css('background-color','white');
$("li .person").draggable({ $('#group_list').removeData();
revert: true $(".person").attr('from_group_id', function(){return $(this).parent().attr('id')})
});
$("li .person").draggable({
revert: true
});
$(".group ul").droppable({
drop: function(event, ui) { });
var move = {}; $(function() {
move[ 'friend_id' ] = ui.draggable[0].id $("li .person").draggable({
move[ 'to' ] = $(this)[0].id; revert: true
move[ 'from' ] = ui.draggable[0].getAttribute('from_group_id'); });
if (move['to'] == move['from']){
$('#group_list').data( ui.draggable[0].id, []); $(".group ul").droppable({
ui.draggable.css('background-color','white'); drop: function(event, ui) {
} else{ var move = {};
$('#group_list').data( ui.draggable[0].id, move); move[ 'friend_id' ] = ui.draggable[0].id
ui.draggable.css('background-color','orange'); move[ 'to' ] = $(this)[0].id;
} move[ 'from' ] = ui.draggable[0].getAttribute('from_group_id');
$(this).closest("ul").append(ui.draggable); if (move['to'] == move['from']){
$('#group_list').data( ui.draggable[0].id, []);
ui.draggable.css('background-color','white');
} else {
$('#group_list').data( ui.draggable[0].id, move);
ui.draggable.css('background-color','orange');
} }
}); $(this).closest("ul").append(ui.draggable);
}
});
});
$(".group h3").live( 'click', function() {
var $this = $(this);
var id = $this.closest("li").children("ul").attr("id");
var link = "/groups/"+ id;
}); $this.keypress(function(e) {
if (e.which == 13) {
e.preventDefault();
$this.blur();
//save changes
$.ajax({
type: "PUT",
url: link,
data: {"group" : {"name" : $this.text() }}
});
}
//update all other group links
$this.keyup(function(e) {
$("a[href='"+link+"']").text($this.text());
});
});
});
...@@ -16,7 +16,7 @@ $(document).ready(function(){ ...@@ -16,7 +16,7 @@ $(document).ready(function(){
}); });
//buttons////// //buttons//////
$("#add_group_button").fancybox(); $("#add_group_button").fancybox({ 'titleShow' : false });
$("#add_request_button").fancybox({ 'titleShow': false }); $("#add_request_button").fancybox({ 'titleShow': false });
$("input[type='submit']").addClass("button"); $("input[type='submit']").addClass("button");
...@@ -25,59 +25,31 @@ $(document).ready(function(){ ...@@ -25,59 +25,31 @@ $(document).ready(function(){
$(this).fadeIn("slow"); $(this).fadeIn("slow");
}); });
});//end document ready $("#global_search").hover(
function() {
$(".group h3").live( 'click', function() { $(this).fadeTo('fast', '1');
},
var $this = $(this); function() {
var id = $this.closest("li").children("ul").attr("id"); $(this).fadeTo('fast', '0.5');
var link = "/groups/"+ id;
$this.keypress(function(e) {
if (e.which == 13) {
e.preventDefault();
$this.blur();
//save changes
$.ajax({
type: "PUT",
url: link,
data: {"group" : {"name" : $this.text() }}
});
} }
//update all other group links );
$this.keyup(function(e) {
$("a[href='"+link+"']").text($this.text());
});
});
});
});//end document ready
function pane_toggler_button( name ) {
$("#add_" + name + "_button").toggle(
function(evt){
evt.preventDefault();
$("#add_" + name + "_pane").fadeIn(300);
},function(evt){
evt.preventDefault();
$("#add_" + name +"_pane").fadeOut(200);
}
);
}
//Called with $(selector).clearForm() //Called with $(selector).clearForm()
$.fn.clearForm = function() { $.fn.clearForm = function() {
return this.each(function() { return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase(); var type = this.type, tag = this.tagName.toLowerCase();
if (tag == 'form') if (tag == 'form')
return $(':input',this).clearForm(); return $(':input',this).clearForm();
if (type == 'text' || type == 'password' || tag == 'textarea') if (type == 'text' || type == 'password' || tag == 'textarea')
this.value = ''; this.value = '';
//else if (type == 'checkbox' || type == 'radio') //else if (type == 'checkbox' || type == 'radio')
//this.checked = false; //this.checked = false;
else if (tag == 'select') else if (tag == 'select')
this.selectedIndex = -1; this.selectedIndex = -1;
$(this).blur(); $(this).blur();
}); });
}; };
...@@ -78,6 +78,7 @@ header { ...@@ -78,6 +78,7 @@ header {
color: black; color: black;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#333333), to(black)); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#333333), to(black));
padding: 0; padding: 0;
padding-top: 5px;
border-bottom: 1px solid #cccccc; } border-bottom: 1px solid #cccccc; }
header #diaspora_text { header #diaspora_text {
z-index: 6; z-index: 6;
...@@ -85,8 +86,7 @@ header { ...@@ -85,8 +86,7 @@ header {
font-family: "BrandonGrotesqueLightRegular"; font-family: "BrandonGrotesqueLightRegular";
font-size: 16px; font-size: 16px;
border: none; border: none;
color: white; color: white; }
top: 3px; }
header #diaspora_text a { header #diaspora_text a {
color: #999999; } color: #999999; }
header #diaspora_text a:hover { header #diaspora_text a:hover {
...@@ -458,7 +458,7 @@ h1.big_text { ...@@ -458,7 +458,7 @@ h1.big_text {
#group_nav { #group_nav {
position: relative; position: relative;
color: black; color: black;
margin-top: 7px; margin-top: 8px;
margin-bottom: 1px; } margin-bottom: 1px; }
#group_nav #group_manage_button { #group_nav #group_manage_button {
display: inline; } display: inline; }
...@@ -562,6 +562,7 @@ h1.big_text { ...@@ -562,6 +562,7 @@ h1.big_text {
#global_search { #global_search {
display: inline; display: inline;
position: relative; position: relative;
opacity: 0.5;
padding-right: 167px; } padding-right: 167px; }
#global_search form { #global_search form {
display: inline; } display: inline; }
......
...@@ -83,6 +83,7 @@ header ...@@ -83,6 +83,7 @@ header
:color #000 :color #000
:background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#333333), to(#000000)) :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#333333), to(#000000))
:padding 0 :padding 0
:top 5px
:border :border
:bottom 1px solid #ccc :bottom 1px solid #ccc
...@@ -94,7 +95,6 @@ header ...@@ -94,7 +95,6 @@ header
:size 16px :size 16px
:border none :border none
:color #fff :color #fff
:top 3px
a a
:color #999 :color #999
...@@ -585,7 +585,7 @@ h1.big_text ...@@ -585,7 +585,7 @@ h1.big_text
:position relative :position relative
:color #000 :color #000
:margin :margin
:top 7px :top 8px
:bottom 1px :bottom 1px
...@@ -733,6 +733,7 @@ h1.big_text ...@@ -733,6 +733,7 @@ h1.big_text
#global_search #global_search
:display inline :display inline
:position relative :position relative
:opacity 0.5
:padding :padding
:right 167px :right 167px
...@@ -824,4 +825,3 @@ h1.big_text ...@@ -824,4 +825,3 @@ h1.big_text
:style italic :style italic
:color #666 :color #666
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter