diff --git a/Changelog.md b/Changelog.md
index a63f5c470..b2c1d2b55 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -21,6 +21,7 @@ Note: Although this is a minor release, the configuration file changed because t
* Use translation for NodeInfo services [#7102](https://github.com/diaspora/diaspora/pull/7102)
* Adopt new Mapbox tile URIs [#7066](https://github.com/diaspora/diaspora/pull/7066)
* Refactored post interactions on the single post view [#7089](https://github.com/diaspora/diaspora/pull/7089)
+* Extract inline JavaScript [#7113](https://github.com/diaspora/diaspora/pull/7113)
## Bug fixes
* Post comments no longer get collapsed when interacting with a post [#7040](https://github.com/diaspora/diaspora/pull/7040)
diff --git a/app/assets/javascripts/app/pages/settings.js b/app/assets/javascripts/app/pages/settings.js
index 517d17663..725abbedc 100644
--- a/app/assets/javascripts/app/pages/settings.js
+++ b/app/assets/javascripts/app/pages/settings.js
@@ -4,6 +4,11 @@ app.pages.Settings = Backbone.View.extend({
$(".settings-visibility").tooltip({placement: "top"});
$(".profile-visibility-hint").tooltip({placement: "top"});
$("[name='profile[public_details]']").bootstrapSwitch();
+
+ new Diaspora.TagsAutocomplete("#profile_tag_string", {
+ preFill: gon.preloads.tagsArray
+ });
+ new Diaspora.ProfilePhotoUploader();
}
});
// @license-end
diff --git a/app/assets/javascripts/app/views/publisher/getting_started_view.js b/app/assets/javascripts/app/views/publisher/getting_started_view.js
index 5ba089efc..02a025e0a 100644
--- a/app/assets/javascripts/app/views/publisher/getting_started_view.js
+++ b/app/assets/javascripts/app/views/publisher/getting_started_view.js
@@ -18,7 +18,6 @@ app.views.PublisherGettingStarted = Backbone.View.extend({
// initiate all the popover message boxes
show: function() {
- app.publisher.open();
this._addPopover(this.firstMessage, {
trigger: "manual",
id: "first_message_explain",
diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js
index 1b9f2f56c..de9245027 100644
--- a/app/assets/javascripts/app/views/publisher_view.js
+++ b/app/assets/javascripts/app/views/publisher_view.js
@@ -91,6 +91,7 @@ app.views.Publisher = Backbone.View.extend({
this.initSubviews();
this.checkSubmitAvailability();
+ this.triggerGettingStarted();
return this;
},
@@ -184,7 +185,10 @@ app.views.Publisher = Backbone.View.extend({
// show the "getting started" popups around the publisher
triggerGettingStarted: function() {
- this.viewGettingStarted.show();
+ if (gon.preloads.getting_started) {
+ this.open();
+ this.viewGettingStarted.show();
+ }
},
createStatusMessage : function(evt) {
diff --git a/app/assets/javascripts/app/views/tag_following_list_view.js b/app/assets/javascripts/app/views/tag_following_list_view.js
index 0504ab270..d284f137c 100644
--- a/app/assets/javascripts/app/views/tag_following_list_view.js
+++ b/app/assets/javascripts/app/views/tag_following_list_view.js
@@ -1,6 +1,5 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
-//= require jquery.autoSuggest.custom
app.views.TagFollowingList = app.views.Base.extend({
templateName: "tag_following_list",
@@ -30,29 +29,9 @@ app.views.TagFollowingList = app.views.Base.extend({
},
setupAutoSuggest : function() {
- this.$("input").autoSuggest("/tags", {
- selectedItemProp: "name",
- selectedValuesProp: "name",
- searchObjProps: "name",
- asHtmlID: "tags",
- neverSubmit: true,
- retrieveLimit: 10,
- selectionLimit: false,
- minChars: 2,
- keyDelay: 200,
- startText: "",
- emptyText: "no_results",
+ new Diaspora.TagsAutocomplete(this.$("input"), {
selectionAdded: _.bind(this.suggestSelection, this)
});
-
- this.$("input").bind('keydown', function(evt){
- if(evt.which === Keycodes.ENTER || evt.which === Keycodes.TAB || evt.which === Keycodes.SPACE) {
- evt.preventDefault();
- if( $('li.as-result-item.active').length === 0 ){
- $('li.as-result-item').first().click();
- }
- }
- });
},
presenter : function() {
diff --git a/app/assets/javascripts/contact-list.js b/app/assets/javascripts/contact-list.js
index 3dfa85dc5..87740a64a 100644
--- a/app/assets/javascripts/contact-list.js
+++ b/app/assets/javascripts/contact-list.js
@@ -30,4 +30,10 @@ var List = {
setTimeout( "List.runDelayedSearch('" + theSearch + "')", 10000);
}
};
+
+$(document).ready(function() {
+ if (gon.preloads.background_query) {
+ List.startSearchDelay(gon.preloads.background_query);
+ }
+});
// @license-end
diff --git a/app/assets/javascripts/helpers/profile_photo_uploader.js b/app/assets/javascripts/helpers/profile_photo_uploader.js
new file mode 100644
index 000000000..c50bc5021
--- /dev/null
+++ b/app/assets/javascripts/helpers/profile_photo_uploader.js
@@ -0,0 +1,61 @@
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
+
+Diaspora.ProfilePhotoUploader = function() {
+ this.initialize();
+};
+
+Diaspora.ProfilePhotoUploader.prototype = {
+ constructor: Diaspora.ProfilePhotoUploader,
+
+ initialize: function() {
+ new qq.FileUploaderBasic({
+ element: document.getElementById("file-upload"),
+ params: {"photo": {"pending": true, "aspect_ids": "all", "set_profile_photo": true}},
+ allowedExtensions: ["jpg", "jpeg", "png"],
+ action: "/photos",
+ button: document.getElementById("file-upload"),
+ sizeLimit: 4194304,
+
+ onProgress: function(id, fileName, loaded, total) {
+ var progress = Math.round(loaded / total * 100);
+ $("#fileInfo").text(fileName + " " + progress + "%");
+ },
+
+ messages: {
+ typeError: Diaspora.I18n.t("photo_uploader.invalid_ext"),
+ sizeError: Diaspora.I18n.t("photo_uploader.size_error"),
+ emptyError: Diaspora.I18n.t("photo_uploader.empty")
+ },
+
+ onSubmit: function() {
+ $("#file-upload").addClass("loading");
+ $("#profile_photo_upload").find(".avatar").addClass("loading");
+ $("#file-upload-spinner").removeClass("hidden");
+ $("#fileInfo").show();
+ },
+
+ onComplete: function(_id, fileName, responseJSON) {
+ $("#file-upload-spinner").addClass("hidden");
+ $("#fileInfo").text(Diaspora.I18n.t("photo_uploader.completed", {"file": fileName}));
+ $("#file-upload").removeClass("loading");
+
+ /* flash message prompt */
+ var message = Diaspora.I18n.t("photo_uploader.looking_good");
+ if (app.flashMessages) { app.flashMessages.success(message); }
+
+ var id = responseJSON.data.photo.id;
+ var url = responseJSON.data.photo.unprocessed_image.url;
+ var oldPhoto = $("#photo_id");
+ if (oldPhoto.length === 0) {
+ $("#update_profile_form").prepend("");
+ } else {
+ oldPhoto.val(id);
+ }
+
+ $("#profile_photo_upload").find(".avatar").removeClass("loading");
+ $("#profile_photo_upload").find(".avatar").attr("src", url);
+ }
+ });
+ }
+};
+// @license-end
diff --git a/app/assets/javascripts/helpers/tags_autocomplete.js b/app/assets/javascripts/helpers/tags_autocomplete.js
new file mode 100644
index 000000000..0aefefae7
--- /dev/null
+++ b/app/assets/javascripts/helpers/tags_autocomplete.js
@@ -0,0 +1,41 @@
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
+
+Diaspora.TagsAutocomplete = function(element, opts) {
+ this.initialize(element, opts);
+};
+
+Diaspora.TagsAutocomplete.prototype = {
+ constructor: Diaspora.TagsAutocomplete,
+
+ initialize: function(element, opts) {
+ this.options = {
+ selectedItemProp: "name",
+ selectedValuesProp: "name",
+ searchObjProps: "name",
+ asHtmlID: "tags",
+ neverSubmit: true,
+ retrieveLimit: 10,
+ selectionLimit: false,
+ minChars: 2,
+ keyDelay: 200,
+ startText: "",
+ emptyText: Diaspora.I18n.t("no_results")
+ };
+
+ $.extend(this.options, opts);
+
+ this.autocompleteInput = $(element);
+ this.autocompleteInput.autoSuggest("/tags", this.options);
+ this.autocompleteInput.bind("keydown", this.keydown);
+ },
+
+ keydown: function(evt) {
+ if (evt.which === Keycodes.ENTER || evt.which === Keycodes.TAB || evt.which === Keycodes.SPACE) {
+ evt.preventDefault();
+ if ($("li.as-result-item.active").length === 0) {
+ $("li.as-result-item").first().click();
+ }
+ }
+ }
+};
+// @license-end
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index 36667eb55..1d1390820 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -17,6 +17,7 @@
//= require jquery-ui/mouse
//= require jquery-ui/sortable
//= require keycodes
+//= require jquery.autoSuggest.custom
//= require fileuploader-custom
//= require handlebars.runtime
//= require posix-bracket-expressions
diff --git a/app/assets/javascripts/mobile/bookmarklet.js b/app/assets/javascripts/mobile/bookmarklet.js
new file mode 100644
index 000000000..94822c2ef
--- /dev/null
+++ b/app/assets/javascripts/mobile/bookmarklet.js
@@ -0,0 +1,21 @@
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
+
+$(document).ready(function() {
+ function publisherContent(params) {
+ if (params.content) {
+ return params.content;
+ }
+
+ var content = params.title + " - " + params.url;
+ if (params.notes.length > 0) {
+ content += " - " + params.notes;
+ }
+ return content;
+ }
+
+ var content = publisherContent(gon.preloads.bookmarklet);
+ if (content.length > 0) {
+ $("#status_message_text").val(content);
+ }
+});
+// @license-end
diff --git a/app/assets/javascripts/mobile/mobile.js b/app/assets/javascripts/mobile/mobile.js
index fad57b3f0..f7f7a2a45 100644
--- a/app/assets/javascripts/mobile/mobile.js
+++ b/app/assets/javascripts/mobile/mobile.js
@@ -16,9 +16,12 @@
//= require bootstrap
//= require diaspora
//= require helpers/i18n
+//= require helpers/profile_photo_uploader
+//= require helpers/tags_autocomplete
//= require widgets/timeago
//= require mobile/mobile_application
//= require mobile/mobile_file_uploader
+//= require mobile/mobile_profile_edit
//= require mobile/profile_aspects
//= require mobile/tag_following
//= require mobile/publisher
diff --git a/app/assets/javascripts/mobile/mobile_profile_edit.js b/app/assets/javascripts/mobile/mobile_profile_edit.js
new file mode 100644
index 000000000..0dae9aae3
--- /dev/null
+++ b/app/assets/javascripts/mobile/mobile_profile_edit.js
@@ -0,0 +1,12 @@
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
+
+$(document).ready(function() {
+ if (Diaspora.Page === "ProfilesEdit") {
+ new Diaspora.TagsAutocomplete("#profile_tag_string", {preFill: gon.preloads.tagsArray});
+ new Diaspora.ProfilePhotoUploader();
+ } else if (Diaspora.Page === "UsersGettingStarted") {
+ new Diaspora.TagsAutocomplete("#follow_tags", {preFill: gon.preloads.tagsArray});
+ new Diaspora.ProfilePhotoUploader();
+ }
+});
+// @license-end
diff --git a/app/assets/javascripts/pages/users-getting-started.js b/app/assets/javascripts/pages/users-getting-started.js
index cb82e03a0..b70951422 100644
--- a/app/assets/javascripts/pages/users-getting-started.js
+++ b/app/assets/javascripts/pages/users-getting-started.js
@@ -49,37 +49,16 @@ Diaspora.Pages.UsersGettingStarted = function() {
return confirmation;
});
- /* ------ */
- var autocompleteInput = $("#follow_tags");
var tagFollowings = new app.collections.TagFollowings();
-
- autocompleteInput.autoSuggest("/tags", {
- selectedItemProp: "name",
- selectedValuesProp: "name",
- searchObjProps: "name",
- asHtmlID: "tags",
- neverSubmit: true,
- retrieveLimit: 10,
- selectionLimit: false,
- minChars: 2,
- keyDelay: 200,
- startText: "",
- emptyText: "no_results",
+ new Diaspora.TagsAutocomplete("#follow_tags", {
+ preFill: gon.preloads.tagsArray,
selectionAdded: function(elem){tagFollowings.create({"name":$(elem[0]).text().substring(2)})},
selectionRemoved: function(elem){
tagFollowings.where({"name":$(elem[0]).text().substring(2)})[0].destroy();
elem.remove();
}
- });
-
- autocompleteInput.bind('keydown', function(evt){
- if(evt.which === Keycodes.ENTER || evt.which === Keycodes.TAB || evt.which === Keycodes.SPACE) {
- evt.preventDefault();
- if( $('li.as-result-item.active').length === 0 ){
- $('li.as-result-item').first().click();
- }
- }
});
+ new Diaspora.ProfilePhotoUploader();
});
};
// @license-end
diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb
index 303423aa8..930ed0b7c 100644
--- a/app/controllers/people_controller.rb
+++ b/app/controllers/people_controller.rb
@@ -39,13 +39,10 @@ class PeopleController < ApplicationController
end
format.any(:html, :mobile) do
- #only do it if it is an email address
+ # only do it if it is a diaspora*-ID
if diaspora_id?(search_query)
@people = Person.where(diaspora_handle: search_query.downcase, closed_account: false)
- if @people.empty?
- Workers::FetchWebfinger.perform_async(search_query)
- @background_query = search_query.downcase
- end
+ background_search(search_query) if @people.empty?
end
@people = @people.paginate(:page => params[:page], :per_page => 15)
@hashes = hashes_for_people(@people, @aspects)
@@ -167,6 +164,12 @@ class PeopleController < ApplicationController
raise Diaspora::AccountClosed if @person.closed_account?
end
+ def background_search(search_query)
+ Workers::FetchWebfinger.perform_async(search_query)
+ @background_query = search_query.downcase
+ gon.preloads[:background_query] = @background_query
+ end
+
def hashes_for_people(people, aspects)
people.map {|person|
{
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index 409dcaee0..bb4d9b070 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -23,12 +23,7 @@ class ProfilesController < ApplicationController
@aspect = :person_edit
@profile = @person.profile
- @tags = @profile.tags
- @tags_array = []
- @tags.each do |obj|
- @tags_array << { :name => ("#"+obj.name),
- :value => ("#"+obj.name)}
- end
+ gon.preloads[:tagsArray] = @profile.tags.map {|tag| {name: "##{tag.name}", value: "##{tag.name}"} }
end
def update
diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb
index f8e8b422f..18ec1837f 100644
--- a/app/controllers/streams_controller.rb
+++ b/app/controllers/streams_controller.rb
@@ -28,7 +28,8 @@ class StreamsController < ApplicationController
end
def multi
- stream_responder(Stream::Multi)
+ gon.preloads[:getting_started] = current_user.getting_started
+ stream_responder(Stream::Multi)
end
def commented
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 63d8074e1..b13dd822c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -87,6 +87,7 @@ class UsersController < ApplicationController
@person = @user.person
@profile = @user.profile
gon.preloads[:inviter] = PersonPresenter.new(current_user.invited_by.try(:person), current_user).as_json
+ gon.preloads[:tagsArray] = current_user.followed_tags.map {|tag| {name: "##{tag.name}", value: "##{tag.name}"} }
render "users/getting_started"
end
diff --git a/app/helpers/interim_stream_hackiness_helper.rb b/app/helpers/interim_stream_hackiness_helper.rb
index 4219d29fe..c5d6992ab 100644
--- a/app/helpers/interim_stream_hackiness_helper.rb
+++ b/app/helpers/interim_stream_hackiness_helper.rb
@@ -25,7 +25,7 @@ module InterimStreamHackinessHelper
if params[:prefill].present?
params[:prefill]
elsif defined?(@stream)
- @stream.publisher.prefill
+ @stream.publisher.prefill
else
nil
end
@@ -50,8 +50,4 @@ module InterimStreamHackinessHelper
def publisher_public
publisher_method(:public)
end
-
- def publisher_explain
- publisher_method(:explain)
- end
end
diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml
index 5dd55ddbf..a3c19c069 100644
--- a/app/views/people/index.html.haml
+++ b/app/views/people/index.html.haml
@@ -16,20 +16,12 @@
.col-md-8
#people_stream.stream
- if @hashes.empty?
- - if @background_query.present?
-
- / TODO this is gross, and should be extracted!
- :javascript
- $(document).ready( function() {
- List.startSearchDelay('#{@background_query}')
- } );
-
- %p
+ %p
+ - if @background_query.present?
= t(".searching")
.loader
.spinner
- - else
- %p
+ - else
= t('.no_one_found')
- else
- for hash in @hashes
diff --git a/app/views/photos/_new_profile_photo.haml b/app/views/photos/_new_profile_photo.haml
index 585028add..f5cb61659 100644
--- a/app/views/photos/_new_profile_photo.haml
+++ b/app/views/photos/_new_profile_photo.haml
@@ -2,62 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
-
-- content_for :head do
- :javascript
- function createUploader(){
- var uploader = new qq.FileUploaderBasic({
- element: document.getElementById('file-upload'),
- params: {'photo' : {'pending' : true, 'aspect_ids' : "all", 'set_profile_photo': true}},
- allowedExtensions: ['jpg', 'jpeg', 'png'],
- action: "#{photos_path}",
- button: document.getElementById('file-upload'),
- sizeLimit: 4194304,
-
- onProgress: function(id, fileName, loaded, total){
- var progress = Math.round(loaded / total * 100 );
- $('#fileInfo').text(fileName + ' ' + progress + '%');
- },
-
- messages: {
- typeError: "#{t('photos.new_photo.invalid_ext')}",
- sizeError: "#{t('photos.new_photo.size_error')}",
- emptyError: "#{t('photos.new_photo.empty')}"
- },
-
- onSubmit: function(id, fileName){
- $('#file-upload').addClass("loading");
- $("#profile_photo_upload").find(".avatar").addClass('loading');
- $("#file-upload-spinner").removeClass("hidden");
- $("#fileInfo").show();
- },
-
- onComplete: function(id, fileName, responseJSON){
- $("#file-upload-spinner").addClass("hidden");
- $("#fileInfo").text(Diaspora.I18n.t("photo_uploader.completed", {"file": fileName}));
- $('#file-upload').removeClass("loading");
-
- /* flash message prompt */
- var message = Diaspora.I18n.t("photo_uploader.looking_good");
- if(app.flashMessages) { app.flashMessages.success(message); }
-
- var id = responseJSON.data.photo.id;
- var url = responseJSON.data.photo.unprocessed_image.url;
- var oldPhoto = $('#photo_id');
- if(oldPhoto.length == 0) {
- $('#update_profile_form').prepend("");
- } else {
- oldPhoto.val(id);
- }
-
- $("#profile_photo_upload").find(".avatar").removeClass('loading');
- $("#profile_photo_upload").find(".avatar").attr("src",url);
- $(".avatar[data-person_id=#{current_user.person.id}]").attr("src",url);
- }
- });
- }
- window.onload = createUploader;
-
.profile-photo-upload#profile_photo_upload
= owner_image_tag(:thumb_large)
.small-horizontal-spacer
diff --git a/app/views/profiles/_edit_public.haml b/app/views/profiles/_edit_public.haml
index 74411cae7..c03c1b23f 100644
--- a/app/views/profiles/_edit_public.haml
+++ b/app/views/profiles/_edit_public.haml
@@ -1,33 +1,3 @@
-- content_for :head do
- :javascript
- $(document).ready(function () {
- var data = $.parseJSON( '#{@tags_array.to_json.gsub("'", "\\\\'")}' ),
- autocompleteInput = $("#profile_tag_string");
-
- autocompleteInput.autoSuggest("#{tags_path}", {
- selectedItemProp: "name",
- selectedValuesProp: "name",
- searchObjProps: "name",
- asHtmlID: "tags",
- neverSubmit: true,
- retrieveLimit: 10,
- minChars: 2,
- keyDelay: 200,
- startText: "",
- emptyText: "#{t('no_results')}",
- preFill: data
- });
-
- autocompleteInput.bind('keydown', function(evt){
- if(evt.which === Keycodes.ENTER || evt.which === Keycodes.TAB || evt.which === Keycodes.SPACE) {
- evt.preventDefault();
- if( $('li.as-result-item.active').length == 0 ){
- $('li.as-result-item').first().click();
- }
- }
- });
- });
-
%h3.inline
= t("profiles.edit.basic")
%span{ :title => t("profiles.edit.basic_hint") }
diff --git a/app/views/publisher/_publisher.html.haml b/app/views/publisher/_publisher.html.haml
index 4d85b0290..5e1ca38f1 100644
--- a/app/views/publisher/_publisher.html.haml
+++ b/app/views/publisher/_publisher.html.haml
@@ -1,9 +1,3 @@
--if publisher_explain
- :javascript
- $(document).ready(function() {
- if( app.publisher ) app.publisher.triggerGettingStarted();
- });
-
.row.publisher#publisher{class: ((aspect == :profile || publisher_open) ? "mention_popup" : "closed")}
.content_creation
= form_for(StatusMessage.new) do |status|
diff --git a/app/views/status_messages/bookmarklet.mobile.haml b/app/views/status_messages/bookmarklet.mobile.haml
index e6c6227c2..0dafbc991 100644
--- a/app/views/status_messages/bookmarklet.mobile.haml
+++ b/app/views/status_messages/bookmarklet.mobile.haml
@@ -4,18 +4,4 @@
= render :partial => 'publisher/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids }
-:javascript
- var contents = "#{escape_javascript params[:content]}";
- if(!contents){
- contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}";
- var notes = "#{escape_javascript params[:notes]}";
- if (notes.length > 0){
- contents += " - " + notes;
- }
- }
-
- $(document).ready(function() {
- if (contents.length > 0) {
- $("#status_message_text").val(contents);
- }
- });
+= javascript_include_tag "mobile/bookmarklet"
diff --git a/app/views/users/getting_started.mobile.haml b/app/views/users/getting_started.mobile.haml
index ff158e90a..91dfcc161 100644
--- a/app/views/users/getting_started.mobile.haml
+++ b/app/views/users/getting_started.mobile.haml
@@ -2,36 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
-- content_for :head do
- :javascript
- $(document).ready(function () {
- var data = $.parseJSON( '#{@tags_array.to_json.gsub("'", "\\\\'")}' ),
- autocompleteInput = $("#follow_tags");
-
- autocompleteInput.autoSuggest("#{tags_path}", {
- selectedItemProp: "name",
- selectedValuesProp: "name",
- searchObjProps: "name",
- asHtmlID: "tags",
- neverSubmit: true,
- retrieveLimit: 10,
- minChars: 2,
- keyDelay: 200,
- startText: "",
- emptyText: "#{t('no_results')}",
- preFill: data
- });
-
- autocompleteInput.bind('keydown', function(evt){
- if(evt.which === Keycodes.ENTER || evt.which === Keycodes.TAB || evt.which === Keycodes.SPACE) {
- evt.preventDefault();
- if( $('li.as-result-item.active').length == 0 ){
- $('li.as-result-item').first().click();
- }
- }
- });
- });
-
:css
.media, .bd{ overflow: visible;}
diff --git a/config/application.rb b/config/application.rb
index ca30da275..4f8668eeb 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -65,28 +65,24 @@ module Diaspora
config.assets.initialize_on_precompile = false
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
- config.assets.precompile += %w{
- aspect-contacts.js
+ config.assets.precompile += %w(
contact-list.js
ie.js
inbox.js
jquery2.js
jquery_ujs.js
- jquery-textchange.js
main.js
jsxc.js
+ mobile/bookmarklet.js
mobile/mobile.js
- people.js
- publisher.js
templates.js
- validation.js
error_pages.css
admin.css
rtl.css
color_themes/*/desktop.css
color_themes/*/mobile.css
- }
+ )
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml
index 0f94fa9fc..f98d9e467 100644
--- a/config/locales/diaspora/en.yml
+++ b/config/locales/diaspora/en.yml
@@ -901,10 +901,6 @@ en:
type_error: "Photo upload failed. Are you sure an image was added?"
destroy:
notice: "Photo deleted."
- new_photo:
- invalid_ext: "{file} has invalid extension. Only {extensions} are allowed."
- size_error: "{file} is too large, maximum file size is {sizeLimit}."
- empty: "{file} is empty, please select files again without it."
new_profile_photo:
upload: "Upload a new profile photo!"
diff --git a/lib/publisher.rb b/lib/publisher.rb
index 71894b652..677afb89f 100644
--- a/lib/publisher.rb
+++ b/lib/publisher.rb
@@ -1,12 +1,11 @@
class Publisher
- attr_accessor :user, :open, :prefill, :public, :explain
+ attr_accessor :user, :open, :prefill, :public
def initialize(user, opts={})
self.user = user
self.open = opts[:open]
self.prefill = opts[:prefill]
self.public = opts[:public]
- self.explain = opts[:explain]
end
def text
diff --git a/lib/stream/multi.rb b/lib/stream/multi.rb
index 995804372..868a82228 100644
--- a/lib/stream/multi.rb
+++ b/lib/stream/multi.rb
@@ -23,9 +23,10 @@ class Stream::Multi < Stream::Base
end
private
+
def publisher_opts
if welcome?
- {open: true, prefill: publisher_prefill, public: true, explain: true}
+ {open: true, prefill: publisher_prefill, public: true}
else
super
end
diff --git a/spec/lib/publisher_spec.rb b/spec/lib/publisher_spec.rb
index 0094f8f49..abbd5ab5b 100644
--- a/spec/lib/publisher_spec.rb
+++ b/spec/lib/publisher_spec.rb
@@ -23,7 +23,7 @@ describe Publisher do
end
end
- ["open", "public", "explain"].each do |property|
+ %w(open public).each do |property|
describe "##{property}" do
it 'defaults to closed' do
expect(@publisher.send("#{property}".to_sym)).to be_falsey
diff --git a/spec/lib/stream/multi_spec.rb b/spec/lib/stream/multi_spec.rb
index 5c1df2468..8f84caf54 100644
--- a/spec/lib/stream/multi_spec.rb
+++ b/spec/lib/stream/multi_spec.rb
@@ -26,7 +26,7 @@ describe Stream::Multi do
prefill_text = "sup?"
allow(@stream).to receive(:welcome?).and_return(true)
allow(@stream).to receive(:publisher_prefill).and_return(prefill_text)
- expect(@stream.send(:publisher_opts)).to eq(open: true, prefill: prefill_text, public: true, explain: true)
+ expect(@stream.send(:publisher_opts)).to eq(open: true, prefill: prefill_text, public: true)
end
it 'provides no opts if welcome? is not set' do