Commit 21c4d80a6d8788fedc5b884ee104f07c3f31985a

Authored by Victor Costa
2 parents 0f384987 ebb39b44

Merge branch 'rails3_chat' into stable

Conflicts:
	public/javascripts/application.js
	public/stylesheets/application.css
public/javascripts/application.js
@@ -179,7 +179,7 @@ function loading_done(element_id) { @@ -179,7 +179,7 @@ function loading_done(element_id) {
179 jQuery(element_id).removeClass('small-loading-dark'); 179 jQuery(element_id).removeClass('small-loading-dark');
180 } 180 }
181 function open_loading(message) { 181 function open_loading(message) {
182 - jQuery('body').prepend("<div id='overlay_loading' class='ui-widget-overlay' style='display: none'/><div id='overlay_loading_modal' style='display: none'><p>"+message+"</p><img src='/images/loading-dark.gif'/></div>"); 182 + jQuery('body').prepend("<div id='overlay_loading' class='ui-widget-overlay' style='display: none'/><div id='overlay_loading_modal' style='display: none'><p>"+message+"</p><img src='" + noosfero_root() + "/images/loading-dark.gif'/></div>");
183 jQuery('#overlay_loading').show(); 183 jQuery('#overlay_loading').show();
184 jQuery('#overlay_loading_modal').center(); 184 jQuery('#overlay_loading_modal').center();
185 jQuery('#overlay_loading_modal').fadeIn('slow'); 185 jQuery('#overlay_loading_modal').fadeIn('slow');
@@ -527,7 +527,8 @@ jQuery(function($) { @@ -527,7 +527,8 @@ jQuery(function($) {
527 } 527 }
528 }); 528 });
529 529
530 - $.getJSON(noosfero_root() + '/account/user_data', function userDataCallBack(data) { 530 + var user_data = noosfero_root() + '/account/user_data';
  531 + $.getJSON(user_data, function userDataCallBack(data) {
531 if (data.login) { 532 if (data.login) {
532 $('head').append('<meta content="authenticity_token" name="csrf-param" />'); 533 $('head').append('<meta content="authenticity_token" name="csrf-param" />');
533 $('head').append('<meta content="'+$.cookie("_noosfero_.XSRF-TOKEN")+'" name="csrf-token" />'); 534 $('head').append('<meta content="'+$.cookie("_noosfero_.XSRF-TOKEN")+'" name="csrf-token" />');
@@ -539,32 +540,6 @@ jQuery(function($) { @@ -539,32 +540,6 @@ jQuery(function($) {
539 $(window).trigger("userDataLoaded", data); 540 $(window).trigger("userDataLoaded", data);
540 }); 541 });
541 542
542 - function chatOnlineUsersDataCallBack(data) {  
543 - if ($('#chat-online-users').length == 0) {  
544 - return;  
545 - }  
546 - var content = '';  
547 - $('#chat-online-users .amount_of_friends').html(data['amount_of_friends']);  
548 - $('#chat-online-users').fadeIn();  
549 - for (var user in data['friends_list']) {  
550 - var name = "<span class='friend_name'>%{name}</span>";  
551 - var avatar = data['friends_list'][user]['avatar'];  
552 - var jid = data['friends_list'][user]['jid'];  
553 - var status_name = data['friends_list'][user]['status'] || 'offline';  
554 - avatar = avatar ? '<img src="' + avatar + '" />' : ''  
555 - name = name.replace('%{name}',data['friends_list'][user]['name']);  
556 - open_chat_link = "onclick='open_chat_window(this, \"#" + jid + "\")'";  
557 - var status_icon = "<div class='chat-online-user-status icon-menu-"+ status_name + "-11'><span>" + status_name + '</span></div>';  
558 - content += "<li><a href='#' class='chat-online-user' " + open_chat_link + "><div class='chat-online-user-avatar'>" + avatar + '</div>' + name + status_icon + '</a></li>';  
559 - }  
560 - content ? $('#chat-online-users-hidden-content ul').html(content) : $('#anyone-online').show();  
561 - $('#chat-online-users-title').click(function(){  
562 - if($('#chat-online-users-content').is(':visible'))  
563 - $('#chat-online-users-content').hide();  
564 - else  
565 - $('#chat-online-users-content').show();  
566 - });  
567 - }  
568 }); 543 });
569 544
570 // controls the display of contact list 545 // controls the display of contact list
@@ -607,9 +582,12 @@ function display_notice(message) { @@ -607,9 +582,12 @@ function display_notice(message) {
607 } 582 }
608 583
609 function open_chat_window(self_link, anchor) { 584 function open_chat_window(self_link, anchor) {
610 - anchor = anchor || '#';  
611 - var noosfero_chat_window = window.open('/chat' + anchor,'noosfero_chat','width=900,height=500');  
612 - noosfero_chat_window.focus(); 585 + if(anchor) {
  586 + jQuery('#chat').show('fast');
  587 + jQuery("#chat" ).trigger('opengroup', anchor);
  588 + } else {
  589 + jQuery('#chat').toggle('fast');
  590 + }
613 return false; 591 return false;
614 } 592 }
615 593
public/stylesheets/application.css
@@ -5028,220 +5028,6 @@ h1#agenda-title { @@ -5028,220 +5028,6 @@ h1#agenda-title {
5028 height: 16px; 5028 height: 16px;
5029 padding-left: 18px; 5029 padding-left: 18px;
5030 } 5030 }
5031 -/* chat window {{{ */  
5032 -  
5033 -#title-bar {  
5034 - height: 25px;  
5035 - width: 100%;  
5036 - position: absolute;  
5037 - background: #ccc url(/images/icons-app/chat-22x22.png) 2px 2px no-repeat;  
5038 -}  
5039 -#title-bar .title {  
5040 - margin: 0;  
5041 - font-size: 12px;  
5042 - margin: 4px 0;  
5043 - padding-left: 30px;  
5044 -}  
5045 -#buddy-list {  
5046 - position: absolute;  
5047 - bottom: 0;  
5048 - top: 25px;  
5049 - -webkit-top: 5px;  
5050 - width: 250px;  
5051 - overflow-y: scroll;  
5052 -}  
5053 -#buddy-list .buddy-list {  
5054 - list-style-type: none;  
5055 - padding: 0;  
5056 - margin: 10px 0;  
5057 -}  
5058 -#buddy-list .buddy-list li {  
5059 - line-height: 21px;  
5060 -}  
5061 -#buddy-list .buddy-list li a, .occupant-list li a {  
5062 - background-position: 15px 50%;  
5063 - padding-left: 30px;  
5064 - display: block;  
5065 - text-decoration: none;  
5066 - border-top: 1px solid transparent;  
5067 - border-bottom: 1px solid transparent;  
5068 -}  
5069 -#buddy-list #environment-logo {  
5070 - text-align: center;  
5071 - padding: 15px 0;  
5072 -}  
5073 -#buddy-list .buddy-list li.offline, .occupant-list li.offline {  
5074 - display: none;  
5075 -}  
5076 -#buddy-list .toolbar {  
5077 - border-left: 0;  
5078 - border-right: 0;  
5079 - background-position: 90%;  
5080 - position: relative;  
5081 - height: 20px;  
5082 -}  
5083 -#buddy-list .toolbar .dialog-error {  
5084 - position: absolute;  
5085 - top: 30px;  
5086 - left: 10px;  
5087 - padding: 5px;  
5088 - width: 170px;  
5089 - -moz-border-radius: 5px;  
5090 - -webkit-border-radius: 5px;  
5091 - background: white;  
5092 - border: 1px solid #888;  
5093 -}  
5094 -#buddy-list .toolbar .dialog-error p {  
5095 - margin: 0 0 5px 0;  
5096 -}  
5097 -#chat-window {  
5098 - position: absolute;  
5099 - bottom: 0;  
5100 - right: 0;  
5101 - top: 25px;  
5102 - left: 250px;  
5103 - background: white;  
5104 -}  
5105 -.conversation {  
5106 - margin: 15px;  
5107 -}  
5108 -.conversation .input-div {  
5109 - position: absolute;  
5110 - left: 0;  
5111 - right: 25px;  
5112 - bottom: 40px;  
5113 - padding: 0 20px 10px 15px;  
5114 -}  
5115 -.msie7 .conversation .input-div {  
5116 - padding-left: 5px;  
5117 - margin-right: 10px;  
5118 -}  
5119 -.conversation .input-div .icon-chat {  
5120 - width: 16px;  
5121 - height: 16px;  
5122 - position: relative;  
5123 - bottom: -23px;  
5124 - left: 5px;  
5125 -}  
5126 -.msie7 .conversation .input-div .icon-chat {  
5127 - left: 20px;  
5128 -}  
5129 -.conversation textarea {  
5130 - height: 60px;  
5131 - width: 100%;  
5132 - padding-left: 25px;  
5133 - overflow: auto;  
5134 -}  
5135 -.conversation .history {  
5136 - position: absolute;  
5137 - right: 0px;  
5138 - top: 0px;  
5139 - bottom: 125px;  
5140 - left: 18px;  
5141 - overflow-y: scroll;  
5142 - padding-top: 5px;  
5143 -}  
5144 -.msie7 #chat-window .conversation .history {  
5145 - overflow-x: hidden;  
5146 -}  
5147 -#chat .unread-messages {  
5148 - background: red;  
5149 - position: absolute;  
5150 - right: 22px;  
5151 - margin: 2px 0;  
5152 - padding: 0 2px;  
5153 - color: white;  
5154 - display: block;  
5155 - line-height: 1em;  
5156 -}  
5157 -#chat .tabs-bottom .ui-tabs-nav {  
5158 - position: absolute;  
5159 - left: 0;  
5160 - bottom: 0;  
5161 - right:0;  
5162 - padding: 0 5px 10px 5px;  
5163 - border: 0;  
5164 - background: #eee;  
5165 -}  
5166 -#chat .tabs-bottom .ui-tabs-nav li {  
5167 - top: 0;  
5168 - margin-top: 0;  
5169 - margin-bottom: 0;  
5170 - border: 1px solid transparent;  
5171 - border-top: none;  
5172 -}  
5173 -#chat .tabs-bottom .ui-tabs-nav li a {  
5174 - padding: 0.3em 0.5em 0.3em 2.0em;  
5175 - background-position: 0.5em 50%;  
5176 -}  
5177 -#chat .tabs-bottom .ui-tabs-nav li:hover, #chat .tabs-bottom .ui-tabs-nav .ui-state-active {  
5178 - border: 1px solid #AAAAAA !important;  
5179 - border-top: 0 !important;  
5180 -}  
5181 -#chat .tabs-bottom li .ui-icon-close {  
5182 - margin: 0.4em 0.5em 0 0 !important;  
5183 -}  
5184 -#chat .ui-tabs .ui-tabs-panel {  
5185 - border: none;  
5186 -}  
5187 -#chat-window .history .message {  
5188 - padding: 0 50px 0 40px;  
5189 - position: relative;  
5190 -}  
5191 -#chat-window .history .message .time {  
5192 - position: absolute;  
5193 - right: 10px;  
5194 - top: 5px;  
5195 - color: gray;  
5196 - font-style: italic;  
5197 - font-size: 11px;  
5198 -}  
5199 -#chat-window .history .message h5, #chat-window .history .message p {  
5200 - margin: 0;  
5201 -}  
5202 -#chat-window .history .message p {  
5203 - max-width: 100%;  
5204 - overflow: auto;  
5205 -}  
5206 -  
5207 -#chat-window .history .message .avatar {  
5208 - position: absolute;  
5209 - left: 0;  
5210 - max-height: 32px;  
5211 - max-width: 32px;  
5212 - top: 10px;  
5213 -}  
5214 -#chat-window .history .notice {  
5215 - font-size: 10px;  
5216 - font-style: italic;  
5217 - color: gray;  
5218 - text-align: center;  
5219 - display: block;  
5220 -}  
5221 -.conversation .occupant-list {  
5222 - position: absolute;  
5223 - top: 0;  
5224 - right: 0;  
5225 - width: 200px;  
5226 - bottom: 125px;  
5227 -}  
5228 -.conversation .occupant-list ul {  
5229 - padding: 0;  
5230 - list-style: none;  
5231 - font-size: 12px;  
5232 -}  
5233 -#chat-window .history.room {  
5234 - right: 200px  
5235 -}  
5236 -#chat-window .comment-balloon-content {  
5237 - min-height: 50px;  
5238 - padding: 5px 0 5px 25px;  
5239 - position: relative;  
5240 -}  
5241 -#chat-window .comment-wrapper-1 {  
5242 - margin-left: 0;  
5243 -}  
5244 -/* chat window }}} */  
5245 5031
5246 #profile-activity ul, #profile-network ul, #profile-wall ul { 5032 #profile-activity ul, #profile-network ul, #profile-wall ul {
5247 padding-left: 0; 5033 padding-left: 0;
@@ -6277,7 +6063,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { @@ -6277,7 +6063,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img {
6277 6063
6278 #signup-form .checking { 6064 #signup-form .checking {
6279 border-color: #4A4A4A; 6065 border-color: #4A4A4A;
6280 - background-image: url(/images/login_checking.png); 6066 + background-image: url(../images/login_checking.png);
6281 } 6067 }
6282 6068
6283 #signup-form span.checking { 6069 #signup-form span.checking {
@@ -6602,28 +6388,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { @@ -6602,28 +6388,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img {
6602 vertical-align: middle; 6388 vertical-align: middle;
6603 text-align: center; 6389 text-align: center;
6604 width: 100px; 6390 width: 100px;
6605 - float: right;  
6606 - position: relative;  
6607 - top: 15px;  
6608 -}  
6609 -  
6610 -#custom-fields-container {  
6611 - margin-bottom: 25px;  
6612 -}  
6613 -  
6614 -#custom-fields-container label.required {  
6615 - font-weight: bold;  
6616 - color: #c00;  
6617 -}  
6618 -  
6619 -#custom-fields-container table {  
6620 - margin-bottom: 5px;  
6621 - border-bottom: 1px solid #c0c0c0;  
6622 -}  
6623 -  
6624 -#custom-fields-container th {  
6625 - border-top: 1px solid #c0c0c0;  
6626 - border-bottom: 1px solid #c0c0c0;  
6627 } 6391 }
6628 6392
6629 #profile_change_picture { 6393 #profile_change_picture {