diff --git a/app/assets/javascripts/bootstrap-scrollspy-custom.js b/app/assets/javascripts/bootstrap-scrollspy-custom.js deleted file mode 100644 index 1e91f9e78ca118faf75d981a0248fc19a452dddb..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/bootstrap-scrollspy-custom.js +++ /dev/null @@ -1,145 +0,0 @@ -/* ============================================================= - * bootstrap-scrollspy.js v2.0.3 - * http://twitter.github.com/bootstrap/javascript.html#scrollspy - * ============================================================= - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* SCROLLSPY CLASS DEFINITION - * ========================== */ - - function ScrollSpy( element, options) { - var process = $.proxy(this.process, this) - , $element = $(element).is('body') ? $(window) : $(element) - , href - this.options = $.extend({}, $.fn.scrollspy.defaults, options) - this.$scrollElement = $element.on('scroll.scroll.data-api', process) - this.selector = (this.options.target - || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - || '') - this.$body = $('body') - this.refresh() - this.process() - } - - ScrollSpy.prototype = { - - constructor: ScrollSpy - - , refresh: function () { - var self = this - , $targets - - this.offsets = $([]) - this.targets = $([]) - - $targets = this.$body - .find(this.selector) - .map(function () { - var $el = $(this) - , href = $el.data('target') || $el.attr('href') - , $href = /^#\w/.test(href) && $(href) - return ( $href - && href.length - && [[ $href.position().top, href ]] ) || null - }) - .sort(function (a, b) { return a[0] - b[0] }) - .each(function () { - self.offsets.push(this[0]) - self.targets.push(this[1]) - }) - } - - , process: function () { - var scrollTop = this.$scrollElement.scrollTop() + this.options.offset - , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight - , maxScroll = scrollHeight - this.$scrollElement.height() - , offsets = this.offsets - , targets = this.targets - , activeTarget = this.activeTarget - , i - - if (scrollTop >= maxScroll) { - return activeTarget != (i = targets.last()[0]) - && this.activate ( i ) - } - - for (i = offsets.length; i--;) { - activeTarget != targets[i] - && scrollTop >= offsets[i] - && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) - && this.activate( targets[i] ) - } - } - - , activate: function (target) { - var active - , selector - - this.activeTarget = target - - $(this.selector) - .removeClass('active') - - selector = this.selector - + '[data-target="' + target + '"],' - + this.selector + '[href="' + target + '"]' - - active = $(selector) - .addClass('active') - - active.trigger('activate') - } - - } - - - /* SCROLLSPY PLUGIN DEFINITION - * =========================== */ - - $.fn.scrollspy = function ( option ) { - return this.each(function () { - var $this = $(this) - , data = $this.data('scrollspy') - , options = typeof option == 'object' && option - if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.scrollspy.Constructor = ScrollSpy - - $.fn.scrollspy.defaults = { - offset: 10 - } - - - /* SCROLLSPY DATA-API - * ================== */ - - $(function () { - $('[data-spy="scroll"]').each(function () { - var $spy = $(this) - $spy.scrollspy($spy.data()) - }) - }) - -}(window.jQuery); diff --git a/app/assets/javascripts/contact-edit.js b/app/assets/javascripts/contact-edit.js index 82d9f5dc614bcf62191b0d6755075b76f43bd0bf..99647bfb3393553a57e5c6264165590a209780b1 100644 --- a/app/assets/javascripts/contact-edit.js +++ b/app/assets/javascripts/contact-edit.js @@ -2,23 +2,6 @@ // licensed under the Affero General Public License version 3 or later. See // the COPYRIGHT file. -var ContactEdit = { - inviteFriend: function(li, evt) { - $.post('/services/inviter/facebook.json', { - "aspect_id" : li.data("aspect_id"), - "uid" : li.parent().data("service_uid") - }, function(data){ - ContactEdit.processSuccess(li, evt, data); - }); - } -}; - -/* - TODO remove me - ContactEdit.toggleCheckbox(li); - Diaspora.page.publish("aspectDropdown/updated", [li.parent().data("person_id"), li.parents(".dropdown").parent(".right").html()]); -*/ - /** * TEMPORARY SOLUTION * TODO remove me, when the contacts section is done with Backbone.js ... diff --git a/app/assets/javascripts/finder.js b/app/assets/javascripts/finder.js deleted file mode 100644 index 8fd8ee68d68a863e0f43d092def593162029fc5c..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/finder.js +++ /dev/null @@ -1,5 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is - * licensed under the Affero General Public License version 3 or later. See - * the COPYRIGHT file. - */ -//= require friend-finder \ No newline at end of file diff --git a/app/assets/javascripts/friend-finder.js b/app/assets/javascripts/friend-finder.js deleted file mode 100644 index b628e8faf50f99df2f32f634369646fbe3e7267e..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/friend-finder.js +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is - * licensed under the Affero General Public License version 3 or later. See - * the COPYRIGHT file. - */ - -var FriendFinder = { - - initialize: function() { - $('.contact_list .button').click(function(){ - $this = $(this); - var uid = $this.parents('li').attr("uid"); - $this.parents('ul').children("#options_"+uid).slideToggle(function(){ - if($this.text() == 'Done'){ - $this.text($this.attr('old-text')); - } else { - $this.attr('old-text', $this.text()); - $this.text('Done'); - } - $(this).toggleClass('hidden'); - }); - }); - } -}; - -$(document).ready(FriendFinder.initialize); diff --git a/app/assets/javascripts/jasmine-load-all.js b/app/assets/javascripts/jasmine-load-all.js index 6201048559a2bcf64eb4c6326d06ab44d6763073..7395aba770d7a3f689487f7f678d05ba2c187162 100644 --- a/app/assets/javascripts/jasmine-load-all.js +++ b/app/assets/javascripts/jasmine-load-all.js @@ -3,10 +3,8 @@ //= require templates //= require main //= require home -//= require finder //= require inbox //= require mobile //= require profile //= require people -//= require photos //= require sinon diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 05056e4d5f90a71fe35c9aaf2817099168919d39..d87cc97dc543e7e97410adf2db57f8766189ed69 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -25,7 +25,6 @@ //= require punycode //= require parse_url //= require clear-form -//= require validation //= require app/app //= require diaspora //= require_tree ./helpers @@ -39,7 +38,6 @@ //= require bootstrap-tooltip //= require bootstrap-popover //= require bootstrap-dropdown -//= require bootstrap-scrollspy-custom //= require bootstrap-modal //= require osmlocator //= require flexime diff --git a/app/assets/javascripts/pages/featured-users-index.js b/app/assets/javascripts/pages/featured-users-index.js deleted file mode 100644 index 34cf8a8c462794b3c20a8db76e50e7bfc956c439..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/pages/featured-users-index.js +++ /dev/null @@ -1,7 +0,0 @@ -Diaspora.Pages.FeaturedUsersIndex = function() { - var self = this; - - this.subscribe("page/ready", function(evt, document) { - self.infiniteScroll = self.instantiate("InfiniteScroll"); - }); -}; diff --git a/app/assets/javascripts/pages/services-finder.js b/app/assets/javascripts/pages/services-finder.js deleted file mode 100644 index b9a9b547b463800767b307ff3d15001754547778..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/pages/services-finder.js +++ /dev/null @@ -1,7 +0,0 @@ -Diaspora.Pages.ServicesFinder = function() { - var self = this; - - this.subscribe("page/ready", function(evt, document) { - self.infiniteScroll = self.instantiate("InfiniteScroll"); - }); -}; diff --git a/app/assets/javascripts/photo-show.js b/app/assets/javascripts/photo-show.js deleted file mode 100644 index d10e400940e7cefcbdc611c2b5785fe184ab0fae..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/photo-show.js +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is - * licensed under the Affero General Public License version 3 or later. See - * the COPYRIGHT file. - */ - -$(document).ready(function() { - - //edit photo - $("#edit_photo_toggle").bind('click', function(evt) { - evt.preventDefault(); - $("#photo_edit_options").toggle(); - $(".edit_photo input:text").first().focus(); - }); - - $('.edit_photo').bind('ajax:loading', function(data, json, xhr) { - $("#photo_edit_options").toggle(); - $("#photo_spinner").show(); - $("#show_photo").find("img").fadeTo(200,0.3); - }); - - $('.edit_photo').bind('ajax:failure', function(data, json, xhr) { - Diaspora.Alert.show("Failed to delete photo.", "Are you sure you own this?"); - $("#show_photo").find("img").fadeTo(200,1); - $("#photo_spinner").hide(); - }); - - $('.edit_photo').bind('ajax:success', function(data, json, xhr) { - json = $.parseJSON(json); - $(".edit_photo input:text").val(json.photo.text); - $("#caption").html(json.photo.text); - $("#show_photo").find("img").fadeTo(200,1); - $("#photo_spinner").hide(); - }); - - // make profile photo - $('.make_profile_photo').bind('ajax:loading', function(data, json, xhr) { - var person_id = $(this).closest(".photo_options").attr('data-actor_person'); - - $("img[data-person_id='" + person_id + "']").fadeTo(200, 0.3); - }); - - $('.make_profile_photo').bind('ajax:success', function(data, json, xhr) { - json = $.parseJSON(json); - - $("img[data-person_id='" + json.person_id + "']").fadeTo(200, 1).attr('src', json.image_url_small); - }); - - $('.make_profile_photo').bind('ajax:failure', function(data, json, xhr) { - var person_id = $(this).closest(".photo_options").attr('data-actor_person'); - Diaspora.Alert.show("Failed to update profile photo!"); - $("img[data-person_id='" + person_id + "']").fadeTo(200, 1); - }); - - // right/left hotkeys - $(document).keyup(function(e){ - if(!$(e.target).hasClass('comment_box')){ - //left - if(e.keyCode == 37) { - if( $("#photo_show_left").length > 0 ){ - document.location = $("#photo_show_left").attr('href'); - } - - //right - } else if(e.keyCode == 39) { - if( $("#photo_show_right").length > 0 ){ - document.location = $("#photo_show_right").attr('href'); - } - } - } - }); - -}); diff --git a/app/assets/javascripts/photos.js b/app/assets/javascripts/photos.js deleted file mode 100644 index db77f42ff4a2cc48836c1ac2d408f8b6f6df7866..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/photos.js +++ /dev/null @@ -1,5 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is - * licensed under the Affero General Public License version 3 or later. See - * the COPYRIGHT file. - */ -//= require photo-show \ No newline at end of file diff --git a/app/assets/javascripts/validation.js b/app/assets/javascripts/validation.js deleted file mode 100644 index 2f152b9168d6a67f240122aba0d9339dfa2d49ba..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/validation.js +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is - * licensed under the Affero General Public License version 3 or later. See - * the COPYRIGHT file. - */ -var Validation = { - rules: { - username: { - characters: /^(|[A-Za-z0-9_]{0,32})$/, - length: [6, 32] - }, - email: { - characters: /^(([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,}))(, *(([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})))*$/ - } - }, - whiteListed: function(keyCode) { - var keyCodes = [0, 37, 38, 39, 40, 8, 9]; - return $.grep(keyCodes, function(element) { return keyCode !== element; }).length === keyCodes.length - 1; - }, - - events: { - usernameKeypress: function(evt) { - if(Validation.whiteListed(evt.keyCode)) { - return; - } - - if(!Validation.rules.username.characters.test(this.value + String.fromCharCode(evt.keyCode))) { - evt.preventDefault(); - } - }, - - emailKeypress: function(evt) { - if(Validation.whiteListed(evt.keyCode)) { - return; - } - - if(!Validation.rules.email.characters.test(this.value + String.fromCharCode(evt.keyCode))) { - $('#user_email').css('border-color', '#8B0000'); - } else { - $('#user_email').css('border-color', '#666666'); - } - } - } -}; - -//$(function() { -// $("#user_username").keypress(Validation.events.usernameKeypress); -// $("#user_email").keypress(Validation.events.emailKeypress); -//}); diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass index 278de75009450940deddd85f9fa4cc447a6dfa53..51ed2c419692ee0b056f6e23d1f534813680e9f2 100644 --- a/app/assets/stylesheets/application.css.sass +++ b/app/assets/stylesheets/application.css.sass @@ -1145,22 +1145,6 @@ a.toggle_selector &:hover :color $link-grey -.cubbies_collage - :position absolute - :right 50px - :top -50px - :z-index -1 - -.cubbies_screenshot - :position absolute - :right -20px - :z-index 1 - -.cubbies_infographic - :height 450px - :margin - :top 30px - #community_spotlight .avatar :height 140px @@ -1221,44 +1205,6 @@ a.toggle_selector a :display inline-block -.cubbies_images - :margin-left 15px - -.cubbies_user_page_small - :position absolute - :left 270px - -#featured_users_pane - :padding 10px 0 - - .featured_user_card_small - :height 30px - - :vertical-align top - :position relative - - :border - :bottom 1px solid $border-grey - - :padding 5px - :margin - :bottom 5px - - a - :font - :weight bold - - .tags - a - :color $text-grey - - .avatar - :height 30px - :width 30px - :margin - :right 5px - :float left - .action_item :padding-right 5px diff --git a/config/application.rb b/config/application.rb index 284c3f6962e3eab6af44774e48e0df3cb53ed084..a33413f0d12a1a2ffabcab6683ba6949d8f67fae 100644 --- a/config/application.rb +++ b/config/application.rb @@ -61,7 +61,6 @@ module Diaspora config.assets.precompile += %w{ aspect-contacts.js contact-list.js - finder.js home.js ie.js inbox.js @@ -73,7 +72,6 @@ module Diaspora mobile.js profile.js people.js - photos.js profile.js publisher.js templates.js diff --git a/config/routes.rb b/config/routes.rb index 0469aed8578d6d3ef427857ba7bc04fac53b8297..9a0bf8fc57bdd51c0d5cf598417f69aebd3b081c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -193,10 +193,6 @@ Diaspora::Application.routes.draw do match ':provider/callback' => :create match :failure end - scope 'services' do - match 'inviter/:provider' => :inviter, :as => 'service_inviter' - match 'finder/:provider' => :finder, :as => 'friend_finder' - end end scope 'api/v0', :controller => :apis do diff --git a/features/desktop/manages_aspects.feature b/features/desktop/manages_aspects.feature index 768149470a40d8c3b92dec2652f88bb4cb023ec1..9c285844edea11bbcf11715a84c770fcd8209681 100644 --- a/features/desktop/manages_aspects.feature +++ b/features/desktop/manages_aspects.feature @@ -91,4 +91,4 @@ Feature: User manages contacts And I click on my name in the header When I follow "Contacts" - Then I should not see "Featured Users" within "#section_header" + Then I should not see "Community Spotlight" within ".span9" diff --git a/spec/javascripts/validation-spec.js b/spec/javascripts/validation-spec.js deleted file mode 100644 index 9b1ce638191c33117319d0acc11a4d104a9c1859..0000000000000000000000000000000000000000 --- a/spec/javascripts/validation-spec.js +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is -* licensed under the Affero General Public License version 3 or later. See -* the COPYRIGHT file. -*/ - -describe("Validation", function() { - describe("rules", function() { - describe("username", function() { - describe("characters", function() { - it("is the regex for checking if we allow what the user typed", function() { - expect((typeof Validation.rules.username.characters.test === "function")).toBeTruthy(); - }); - }); - }); - describe("email", function() { - describe("characters", function() { - it("is the regex for checking if the input is a valid list of e-mail addresses", function() { - expect((typeof Validation.rules.email.characters.test === "function")).toBeTruthy(); - }); - }); - }); - }); - describe("whiteListed", function() { - it("returns true if the keyCode is whitelisted", function() { - expect(Validation.whiteListed(0)).toBeTruthy(); - }); - - it("returns false if it's not", function() { - expect(Validation.whiteListed(9001)).toBeFalsy(); - }); - }); - describe("events", function() { - describe("usernameKeypress", function() { - it("doesn't allow the user to type anything but letters, numbers and underscores", function() { - expect(Validation.rules.username.characters.test("*")).toBeFalsy(); - expect(Validation.rules.username.characters.test("Aa_")).toBeTruthy(); - expect(Validation.rules.username.characters.test("ffffffffffffffffffffffffffffffffff")).toBeFalsy(); - }); - }); - describe("emailKeypress", function() { - it("colors the border red if the input seems to be a invalid list", function() { - expect(Validation.rules.email.characters.test("user@example.com")).toBeTruthy(); - expect(Validation.rules.email.characters.test("user@example.com, user@example.com")).toBeTruthy(); - expect(Validation.rules.email.characters.test("user@example.com, user@example.com, user@example.com")).toBeTruthy(); - expect(Validation.rules.email.characters.test("user@example.com user@example.com")).toBeFalsy(); - expect(Validation.rules.email.characters.test("user@examplecom")).toBeFalsy(); - expect(Validation.rules.email.characters.test("userexample.com")).toBeFalsy(); - expect(Validation.rules.email.characters.test("userexamplecom")).toBeFalsy(); - }); - }); - }); -}); diff --git a/spec/lib/statistics_spec.rb b/spec/lib/statistics_spec.rb index 9720d263121ef8b5c9e0211fd5f0c9971055226d..b0dc46c9b724318468599baf13f91107ba72dae1 100644 --- a/spec/lib/statistics_spec.rb +++ b/spec/lib/statistics_spec.rb @@ -168,9 +168,6 @@ describe Statistics do describe '#completed_getting_started_count_sql' do end - describe 'used_cubbies_sql' do - end - describe '.sign_up_method_sql' do end end