diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js
index da819eb0..7311db5f 100644
--- a/app/assets/javascripts/landing.js
+++ b/app/assets/javascripts/landing.js
@@ -32,7 +32,10 @@
Meeting.clear();
var nameInput = $('.meeting-user-name');
if (!nameInput.val()) {
- nameInput.val(localStorage.getItem('lastJoinedName'));
+ var lastName = localStorage.getItem('lastJoinedName');
+ if (lastName !== 'undefined') {
+ nameInput.val(lastName);
+ }
}
// setup event handlers
@@ -40,18 +43,25 @@
var name = $('.meeting-user-name').val();
Meeting.getInstance().setName(name);
Meeting.getInstance().setId($(".page-wrapper").data('id'));
- var jqxhr = Meeting.getInstance().getJoinMeetingResponse();
- jqxhr.done(function(data) {
- if (data.messageKey === 'wait_for_moderator') {
- waitForModerator(Meeting.getInstance().getURL());
- } else {
- $(location).attr("href", data.response.join_url);
- }
- });
- jqxhr.fail(function(xhr, status, error) {
- console.info("meeting join failed");
- });
+ // a user name is set, join the user into the session
+ if (name !== undefined && name !== null) {
+ var jqxhr = Meeting.getInstance().getJoinMeetingResponse();
+ jqxhr.done(function(data) {
+ if (data.messageKey === 'wait_for_moderator') {
+ waitForModerator(Meeting.getInstance().getURL());
+ } else {
+ $(location).attr("href", data.response.join_url);
+ }
+ });
+ jqxhr.fail(function(xhr, status, error) {
+ console.info("meeting join failed");
+ });
+
+ // if not user name was set it means we must ask for a name
+ } else {
+ $(location).attr("href", Meeting.getInstance().getURL());
+ }
});
$('.center-panel-wrapper').on ('keypress', '.meeting-user-name', function (event) {
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 71a7f158..928bf1c9 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -43,6 +43,11 @@ module ApplicationHelper
end
end
+ # Whether the current page is the page of a room/meeting or not
+ def on_room_or_meeting_page?
+ params[:id].present?
+ end
+
def version
Greenlight::VERSION
rescue
diff --git a/app/views/shared/_join_form.html.erb b/app/views/shared/_join_form.html.erb
index 0c46b2d9..13384e5f 100644
--- a/app/views/shared/_join_form.html.erb
+++ b/app/views/shared/_join_form.html.erb
@@ -16,12 +16,13 @@ with BigBlueButton; if not, see