diff --git a/app/views/photos/_new_profile_photo.haml b/app/views/photos/_new_profile_photo.haml index fa3638ea7..f76d48a3e 100644 --- a/app/views/photos/_new_profile_photo.haml +++ b/app/views/photos/_new_profile_photo.haml @@ -35,6 +35,11 @@ $("#file-upload-spinner").addClass("hidden"); $('#fileInfo').text(fileName + ' completed').fadeOut(2000); $('#file-upload').removeClass("loading"); + + /* flash message prompt */ + var message = Diaspora.I18n.t("photo_uploader.looking_good"); + Diaspora.page.flashMessages.render({success: true, notice: message}); + var id = responseJSON.data.photo.id; var url = responseJSON.data.photo.unprocessed_image.url; var oldPhoto = $('#photo_id'); diff --git a/config/locales/javascript/javascript.en.yml b/config/locales/javascript/javascript.en.yml index 6c5eedd22..49a0a1b25 100644 --- a/config/locales/javascript/javascript.en.yml +++ b/config/locales/javascript/javascript.en.yml @@ -5,7 +5,6 @@ en: javascripts: - confirm_dialog: "Are you sure?" timeago: prefixAgo: "" @@ -60,3 +59,10 @@ en: select_all: "Select all" deselect_all: "Deselect all" no_aspects: "No aspects selected" + getting_started: + hey: "Hey, {{name}}!" + no_tags: "Hey, you haven't followed any tags! Continue anyway?" + alright_ill_wait: "Alright, I'll wait." + preparing_your_stream: "Preparing your personialized stream..." + photo_uploader: + looking_good: "OMG, you look awesome!" diff --git a/public/javascripts/pages/users-getting-started.js b/public/javascripts/pages/users-getting-started.js index b3d08b3d0..04adcbdaf 100644 --- a/public/javascripts/pages/users-getting-started.js +++ b/public/javascripts/pages/users-getting-started.js @@ -15,13 +15,16 @@ Diaspora.Pages.UsersGettingStarted = function() { $('#edit_profile').bind('ajax:complete', function(evt, xhr, status){ var firstNameField = $("#profile_first_name"); firstNameField.val(firstNameField.data("cachedValue")); + + /* flash message prompt */ + var message = Diaspora.I18n.t("getting_started.hey", {'name': $("#profile_first_name").val()}); + Diaspora.page.flashMessages.render({success: true, notice: message}); }); $("#profile_first_name").bind("change", function(){ $(this).data("cachedValue", $(this).val()); $('#edit_profile').submit(); $('#form_spinner').removeClass("hidden"); - }); $("#profile_first_name").bind("blur", function(){ @@ -34,8 +37,21 @@ Diaspora.Pages.UsersGettingStarted = function() { $("#awesome_button").bind("click", function(evt){ evt.preventDefault(); - $('#awesome_spinner').removeClass("hidden"); - $('.tag_input').submit(); + + var confirmMessage = Diaspora.I18n.t("getting_started.no_tags"); + + if(($("#as-selections-tags").find(".as-selection-item").length > 0) || confirm(confirmMessage)) { + $('#awesome_spinner').removeClass("hidden"); + $('.tag_input').submit(); + + /* flash message prompt */ + var message = Diaspora.I18n.t("getting_started.preparing_your_stream"); + Diaspora.page.flashMessages.render({success: true, notice: message}); + } else { + /* flash message prompt */ + var message = Diaspora.I18n.t("getting_started.alright_ill_wait"); + Diaspora.page.flashMessages.render({success: true, notice: message}); + } }); /* ------ */