Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
64237534fd
12 changed files with 636 additions and 730 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -14,6 +14,7 @@ public/stylesheets/ui.css
|
|||
|
||||
# Uploded files and local files
|
||||
public/uploads/*
|
||||
public/assets/*
|
||||
public/source.tar*
|
||||
tmp/**/*
|
||||
db/*.sqlite3
|
||||
|
|
|
|||
3
Gemfile
3
Gemfile
|
|
@ -45,7 +45,8 @@ gem 'magent', :git => 'git://github.com/maxwell/magent.git'
|
|||
gem 'carrierwave', :git => 'git://github.com/rsofaer/carrierwave.git' , :branch => 'master' #Untested mongomapper branch
|
||||
gem 'mini_magick'
|
||||
gem 'aws'
|
||||
|
||||
gem 'fastercsv', :require => false
|
||||
gem 'jammit'
|
||||
group :test, :development do
|
||||
gem 'factory_girl_rails'
|
||||
gem 'ruby-debug19' if RUBY_VERSION.include? "1.9"
|
||||
|
|
|
|||
10
Gemfile.lock
10
Gemfile.lock
|
|
@ -48,7 +48,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/maxwell/magent.git
|
||||
revision: af5ad4b58e27fc0ca49bea8ab11ec3f746e92f33
|
||||
revision: 534977e482cc6d9a205c6d67da6ccbb2486db5a8
|
||||
specs:
|
||||
magent (0.5.1)
|
||||
em-websocket
|
||||
|
|
@ -141,6 +141,7 @@ GEM
|
|||
uuidtools
|
||||
childprocess (0.1.4)
|
||||
ffi (~> 0.6.3)
|
||||
closure-compiler (0.3.3)
|
||||
columnize (0.3.2)
|
||||
configuration (1.1.0)
|
||||
crack (0.1.8)
|
||||
|
|
@ -173,6 +174,7 @@ GEM
|
|||
addressable (~> 2.2.2)
|
||||
multipart-post (~> 1.0.1)
|
||||
rack (>= 1.1.0, < 2)
|
||||
fastercsv (1.5.3)
|
||||
fastthread (1.0.7)
|
||||
ffi (0.6.3)
|
||||
rake (>= 0.8.7)
|
||||
|
|
@ -187,6 +189,9 @@ GEM
|
|||
httparty (0.6.1)
|
||||
crack (= 0.1.8)
|
||||
i18n (0.4.2)
|
||||
jammit (0.5.4)
|
||||
closure-compiler (>= 0.1.0)
|
||||
yui-compressor (>= 0.9.1)
|
||||
json (1.4.6)
|
||||
json_pure (1.4.6)
|
||||
launchy (0.3.7)
|
||||
|
|
@ -344,6 +349,7 @@ GEM
|
|||
crack (>= 0.1.7)
|
||||
will_paginate (3.0.pre2)
|
||||
xml-simple (1.0.12)
|
||||
yui-compressor (0.9.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
|
@ -365,8 +371,10 @@ DEPENDENCIES
|
|||
em-http-request!
|
||||
em-websocket!
|
||||
factory_girl_rails
|
||||
fastercsv
|
||||
haml
|
||||
http_accept_language!
|
||||
jammit
|
||||
jasmine!
|
||||
json
|
||||
launchy
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@
|
|||
module ApplicationHelper
|
||||
@@youtube_title_cache = Hash.new("no-title")
|
||||
|
||||
def modern_browser?
|
||||
false
|
||||
end
|
||||
|
||||
def current_aspect?(aspect)
|
||||
!@aspect.is_a?(Symbol) && @aspect.id == aspect.id
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
- content_for :head do
|
||||
= javascript_include_tag 'aspect-edit.js'
|
||||
= javascript_include_tag 'vendor/jquery-ui-1.8.6.custom.min'
|
||||
= include_javascripts :aspects
|
||||
|
||||
#section_header
|
||||
%h2=t('.manage_aspects')
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
= javascript_include_tag 'vendor/FABridge', 'vendor/swfobject', 'vendor/web_socket'
|
||||
:javascript
|
||||
WebSocket.__swfLocation = "#{javascript_path 'vendor/WebSocketMain.swf'}";
|
||||
$(document).ready(function(){
|
||||
|
|
|
|||
|
|
@ -15,28 +15,26 @@
|
|||
|
||||
%meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}
|
||||
|
||||
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
||||
|
||||
%link{:rel => 'shortcut icon', :href => '/favicon.ico'}
|
||||
%link{:rel => 'apple-touch-icon', :href => '/apple-touch-icon.png'}
|
||||
|
||||
= stylesheet_link_tag "blueprint/screen", :media => 'screen'
|
||||
= stylesheet_link_tag "blueprint/print", :media => 'print'
|
||||
= stylesheet_link_tag "application", "ui"
|
||||
= stylesheet_link_tag "vendor/jquery.fancybox-1.3.1"
|
||||
= stylesheet_link_tag "vendor/fileuploader"
|
||||
= stylesheet_link_tag "vendor/tipsy"
|
||||
= include_stylesheets :default, :media => 'all'
|
||||
|
||||
|
||||
= javascript_include_tag '//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'
|
||||
= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"
|
||||
|
||||
:javascript
|
||||
!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.4.js"%3E%3C/script%3E'))
|
||||
= include_javascripts :main
|
||||
|
||||
- if current_user
|
||||
= include_javascripts :flash_socket unless modern_browser?
|
||||
= render 'js/websocket_js'
|
||||
|
||||
= javascript_include_tag 'rails'
|
||||
= javascript_include_tag 'vendor/jquery.infieldlabel'
|
||||
= javascript_include_tag 'vendor/jquery.tipsy'
|
||||
= javascript_include_tag 'vendor/fancybox/jquery.fancybox-1.3.1.pack'
|
||||
= javascript_include_tag 'vendor/fileuploader'
|
||||
= javascript_include_tag 'view', 'image-picker', 'stream'
|
||||
= render 'js/websocket_js' if current_user
|
||||
= csrf_meta_tag
|
||||
|
||||
= yield(:head)
|
||||
= csrf_meta_tag
|
||||
|
|
|
|||
32
config/assets.yml
Normal file
32
config/assets.yml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
javascripts:
|
||||
flash_socket:
|
||||
- public/javascripts/vendor/FABridge.js
|
||||
- public/javascripts/vendor/swfobject.js
|
||||
- public/javascripts/vendor/web_socket.js
|
||||
main:
|
||||
- public/javascripts/rails.js
|
||||
- public/javascripts/vendor/jquery.infieldlabel.js
|
||||
- public/javascripts/vendor/jquery.tipsy.js
|
||||
- public/javascripts/vendor/fancybox/jquery.fancybox-1.3.1.pack.js
|
||||
- public/javascripts/vendor/fileuploader.js
|
||||
- public/javascripts/view.js
|
||||
- public/javascripts/image-picker.js
|
||||
- public/javascripts/stream.js
|
||||
mobile:
|
||||
- public/javascripts/vendor/jquery-ui-1.8.6.custom.min.js
|
||||
- public/javascripts/vendor/jquery_mobile_a2.min.js
|
||||
|
||||
photo:
|
||||
- public/javascripts/photo.js
|
||||
- public/javascripts/image-picker.js
|
||||
aspects:
|
||||
- public/javascripts/vendor/jquery-ui-1.8.6.custom.min.js
|
||||
- public/javascripts/aspect-edit.js
|
||||
|
||||
stylesheets:
|
||||
default:
|
||||
- public/stylesheets/application.css
|
||||
- public/stylesheets/ui.css
|
||||
- public/stylesheets/vendor/jquery.fancybox-1.3.1.css
|
||||
- public/stylesheets/vendor/fileuploader.css
|
||||
- public/stylesheets/vendor/tipsy.css
|
||||
31
lib/tasks/batch_inviter.rake
Normal file
31
lib/tasks/batch_inviter.rake
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
# licensed under the Affero General Public License version 3 or later. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
namespace :invites do
|
||||
|
||||
desc 'send a bunch of invites from a csv with rows of name, email'
|
||||
task :send, :filename, :number, :start do
|
||||
|
||||
unless args[:filename] && args[:number] && args[:start]
|
||||
raise "please give me {filename} {number of people to churn}, {where to start in the file}"
|
||||
end
|
||||
|
||||
|
||||
require File.dirname(__FILE__) + '/../../config/environment'
|
||||
require 'fastercsv'
|
||||
|
||||
filename = args[:filename]
|
||||
start = args[:start].to_i || 0
|
||||
number_of_backers = args[:number].to_i || 1000
|
||||
offset = 1 + start
|
||||
puts "emailing #{number_of_backers} listed in #{filename} starting at #{start}"
|
||||
backers = FasterCSV.read("bkr.csv")
|
||||
|
||||
#number_of_backers.times do |n|
|
||||
# backer_name = backers[n+offset][0]
|
||||
# backer_email = backers[n+offset][1].gsub('.ksr', '')
|
||||
# send_email(backer_name, backer_email)
|
||||
#end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||
* licensed under the Affero General Public License version 3 or later. See
|
||||
* the COPYRIGHT file.
|
||||
*/
|
||||
|
||||
var Publisher = {
|
||||
|
||||
initialize: function() {
|
||||
$("ul .person").draggable({
|
||||
revert: true,
|
||||
start: AspectEdit.startDrag,
|
||||
drag: AspectEdit.duringDrag,
|
||||
stop: AspectEdit.stopDrag
|
||||
});
|
||||
|
||||
$(".aspect ul.dropzone").droppable({
|
||||
hoverClass: 'active',
|
||||
drop: AspectEdit.onDropMove
|
||||
});
|
||||
|
||||
$(".delete").live("click", AspectEdit.deletePerson);
|
||||
$(".aspect h3").live('focus', AspectEdit.changeName);
|
||||
},
|
||||
|
||||
startDrag: function() {
|
||||
AspectEdit.animateImage($(this).children("img").first());
|
||||
$(".draggable_info").fadeIn(100);
|
||||
},
|
||||
|
||||
animateImage: function(image) {
|
||||
image.animate({'height':80, 'width':80, 'opacity':0.8}, 200);
|
||||
image.tipsy("hide");
|
||||
},
|
||||
|
||||
duringDrag: function(event, ui) {
|
||||
$(this).children("img").tipsy("hide"); //ensure this is hidden
|
||||
},
|
||||
|
||||
stopDrag: function(event, ui) {
|
||||
$(this).children("img").animate({'height':70, 'width':70, 'opacity':1}, 200);
|
||||
$(".draggable_info").fadeOut(100);
|
||||
},
|
||||
|
||||
onDropMove: function(event, ui) {
|
||||
var dropzone = $(this);
|
||||
var person = ui.draggable;
|
||||
|
||||
if (person.hasClass('request')) {
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/requests/" + person.attr('data-guid'),
|
||||
data: {"accept" : true, "aspect_id" : dropzone.attr('data-aspect_id') },
|
||||
success: function(data) {
|
||||
AspectEdit.decrementRequestsCounter();
|
||||
person.removeClass('request');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (dropzone.attr('data-aspect_id') != person.attr('data-aspect_id')) {
|
||||
$.ajax({
|
||||
url: "/aspects/move_contact/",
|
||||
data: {"person_id" : person.attr('data-guid'),
|
||||
"from" : person.attr('data-aspect_id'),
|
||||
"to" : { "to" : dropzone.attr('data-aspect_id') }},
|
||||
success: function(data) {
|
||||
person.attr('data-aspect_id', dropzone.attr('data-aspect_id'));
|
||||
}});
|
||||
}
|
||||
|
||||
dropzone.closest("ul").append(person);
|
||||
},
|
||||
|
||||
deletePersonFromAspect: function(person) {
|
||||
|
||||
var person_id = person.attr('data-guid');
|
||||
|
||||
if( $(".person[data-guid='"+ person_id +"']").length == 1) {
|
||||
alert("You can not remove the person from the last aspect");
|
||||
|
||||
} else {
|
||||
if (!person.hasClass('request')) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/aspects/remove_from_aspect",
|
||||
data:{
|
||||
'person_id' : person_id,
|
||||
'aspect_id' : person.attr('data-aspect_id') }
|
||||
});
|
||||
}
|
||||
person.fadeOut(400, function() {
|
||||
person.remove();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
changeName: function() {
|
||||
|
||||
var $this = $(this);
|
||||
var id = $this.closest("li.aspect").attr("data-guid");
|
||||
var link = "/aspects/" + id;
|
||||
|
||||
$this.keypress(function(e) {
|
||||
if (e.which == 13) {
|
||||
e.preventDefault();
|
||||
$this.blur();
|
||||
|
||||
//save changes
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
url: link,
|
||||
data: {"aspect" : {"name" : $this.text() }}
|
||||
});
|
||||
}
|
||||
//update all other aspect links
|
||||
$this.keyup(function(e) {
|
||||
$("#aspect_nav a[href='" + link + "']").text($this.text());
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
deletePerson: function() {
|
||||
var person = $(this).closest("li.person");
|
||||
|
||||
if (person.hasClass('request')) {
|
||||
if (confirm("Ignore request?")) {
|
||||
var request_id = person.attr("data-guid");
|
||||
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/requests/" + request_id,
|
||||
success: function () {
|
||||
AspectEdit.decrementRequestsCounter();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (confirm("Also remove this person from all aspects?")) {
|
||||
var person_id = $(this).closest("li.person").attr('data-guid');
|
||||
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/people/" + person_id,
|
||||
success: function() {
|
||||
$(".person[data-guid='"+ person_id +"']").fadeOut(200);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
AspectEdit.deletePersonFromAspect(person);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
decrementRequestsCounter: function() {
|
||||
var $new_requests = $(".new_requests");
|
||||
var request_html = $new_requests.html();
|
||||
var old_request_count = request_html.match(/\d+/);
|
||||
|
||||
if (old_request_count == 1) {
|
||||
$new_requests.html(
|
||||
request_html.replace(/ \(\d+\)/, '')
|
||||
);
|
||||
} else {
|
||||
$new_requests.html(
|
||||
request_html.replace(/\d+/, old_request_count - 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(Publisher.initialize);
|
||||
|
||||
|
|
@ -41,8 +41,14 @@ def process_message
|
|||
end
|
||||
end
|
||||
|
||||
def package_js
|
||||
require 'jammit'
|
||||
Jammit.package!
|
||||
end
|
||||
|
||||
begin
|
||||
EM.run {
|
||||
package_js
|
||||
Diaspora::WebSocket.initialize_channels
|
||||
|
||||
socket_params = { :host => APP_CONFIG[:socket_host],
|
||||
|
|
|
|||
1078
spec/fixtures/users.yaml
vendored
1078
spec/fixtures/users.yaml
vendored
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue