diff --git a/Changelog.md b/Changelog.md index 8f49e58ba..280fe21cd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,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/mobile/mobile.js b/app/assets/javascripts/mobile/mobile.js index 46c013538..f7f7a2a45 100644 --- a/app/assets/javascripts/mobile/mobile.js +++ b/app/assets/javascripts/mobile/mobile.js @@ -21,6 +21,7 @@ //= 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/views/profiles/edit.mobile.haml b/app/views/profiles/edit.mobile.haml index eecb0889a..608b9a8c0 100644 --- a/app/views/profiles/edit.mobile.haml +++ b/app/views/profiles/edit.mobile.haml @@ -2,13 +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 () { - new Diaspora.TagsAutocomplete("#profile_tag_string", {preFill: gon.preloads.tagsArray}); - new Diaspora.ProfilePhotoUploader(); - }); - .settings_container.container-fluid .row .col-md-12 diff --git a/app/views/users/getting_started.mobile.haml b/app/views/users/getting_started.mobile.haml index e9e372cab..91dfcc161 100644 --- a/app/views/users/getting_started.mobile.haml +++ b/app/views/users/getting_started.mobile.haml @@ -2,13 +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 () { - new Diaspora.TagsAutocomplete("#follow_tags"); - new Diaspora.ProfilePhotoUploader(); - }); - :css .media, .bd{ overflow: visible;}