From fd044fc75d9d46ee38b977a9755f10d2aa7129c0 Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 17 Nov 2016 12:17:58 -0500 Subject: [PATCH 1/2] copy url tooltip --- app/assets/javascripts/landing.js | 46 +++++++++++++++++++++++--- app/assets/stylesheets/landing.scss | 14 ++++++-- app/views/shared/_meeting_url.html.erb | 12 ++++--- config/locales/en-us.yml | 2 ++ 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js index 01edbc9d..73be73e8 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/landing.js @@ -15,7 +15,7 @@ var init = function() { Meeting.clear(); - // setup click handlers + // setup event handlers $('.center-panel-wrapper').on ('click', '.meeting-join', function (event) { var name = $('.meeting-user-name').val(); Meeting.getInstance().setName(name); @@ -54,11 +54,49 @@ $('.center-panel-wrapper').on ('click', '.meeting-url-copy', function (event) { meetingURLInput = $('.meeting-url'); + + // copy URL meetingURLInput.select(); - document.execCommand("copy"); - meetingURLInput.blur(); + try { + var success = document.execCommand("copy"); + if (success) { + meetingURLInput.blur(); + $(this).trigger('hint', [$(this).data('copied-hint')]); + } else { + $(this).trigger('hint', [$(this).data('copy-error')]); + } + } catch (err) { + $(this).trigger('hint', [$(this).data('copy-error')]); + } }); + $('.center-panel-wrapper').on('hint', '.meeting-url-copy', function (event, msg) { + $(this).focus(); + $(this).attr('title', msg) + .tooltip('fixTitle') + .tooltip('show') + .attr('title', $(this).data('copy-hint')) + .tooltip('fixTitle'); + }); + + $('.center-panel-wrapper').on('mouseleave', '.meeting-url-copy', function (event, msg) { + $(this).blur(); + }); + + $('.center-panel-wrapper').on('focus', '.meeting-url', function (event, msg) { + $(this).select(); + }); + + // only allow ctrl-c to work + $('.center-panel-wrapper').on('keydown', '.meeting-url', function (event, msg) { + if(!event.ctrlKey) { + event.preventDefault(); + } + }); + + // enable tooltips + $('[data-toggle="tooltip"]').tooltip() + // enable popovers var options = { selector: '.has-popover', @@ -73,7 +111,7 @@ }; $('#recordings').popover(options); - // focus user + // focus name input or join button if ($('.meeting-user-name').is(':visible')) { $('.meeting-user-name').focus(); } else { diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index f53a86ef..4fbbd5b1 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -2,11 +2,20 @@ // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -.join-form { - width: 100%; +.center-panel-wrapper { + .join-form { + width: 100%; + } + + .meeting-url-wrapper { + .meeting-url { + cursor: default; + } + } } .rooms { + .table-wrapper { padding: 40px 50px 10px 50px; @@ -18,4 +27,5 @@ } } } + } diff --git a/app/views/shared/_meeting_url.html.erb b/app/views/shared/_meeting_url.html.erb index 2a2c44cf..ff15f091 100644 --- a/app/views/shared/_meeting_url.html.erb +++ b/app/views/shared/_meeting_url.html.erb @@ -1,13 +1,15 @@ diff --git a/config/locales/en-us.yml b/config/locales/en-us.yml index 22f0e044..ad54b33c 100644 --- a/config/locales/en-us.yml +++ b/config/locales/en-us.yml @@ -29,6 +29,8 @@ en-US: recording_deleted: Recording was deleted recording_published: Recording was published recording_unpublished: Recording was unpublished + copied: Copied + copy_error: Use Ctrl-c to copy date_recorded: Date Recorded duration: Duration end: End From 8b536c4934444b7e9c367cc8475df24907bdc174 Mon Sep 17 00:00:00 2001 From: Zachary Chai Date: Thu, 17 Nov 2016 16:30:04 -0500 Subject: [PATCH 2/2] recording actions tooltips --- app/assets/javascripts/landing.js | 12 ++++++++++-- app/assets/javascripts/recordings.coffee | 17 ++++++++++------- app/views/landing/rooms.html.erb | 9 +++++++++ config/locales/en-us.yml | 3 +++ 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js index 73be73e8..8c81fd21 100644 --- a/app/assets/javascripts/landing.js +++ b/app/assets/javascripts/landing.js @@ -87,7 +87,7 @@ $(this).select(); }); - // only allow ctrl-c to work + // only allow ctrl commands $('.center-panel-wrapper').on('keydown', '.meeting-url', function (event, msg) { if(!event.ctrlKey) { event.preventDefault(); @@ -95,7 +95,15 @@ }); // enable tooltips - $('[data-toggle="tooltip"]').tooltip() + var options = { + selector: '.has-tooltip' + }; + $(document).tooltip(options) + var options = { + selector: '.bottom-tooltip', + placement: 'bottom' + }; + $(document).tooltip(options); // enable popovers var options = { diff --git a/app/assets/javascripts/recordings.coffee b/app/assets/javascripts/recordings.coffee index 2dfc6e65..38426681 100644 --- a/app/assets/javascripts/recordings.coffee +++ b/app/assets/javascripts/recordings.coffee @@ -60,13 +60,16 @@ class @Recordings if type == 'display' roomName = Meeting.getInstance().getId() published = row.published - eye = getPublishClass(published) - return ' ' + - '' + - '' + - '' + icon = getPublishClass(published) + publishText = if published then 'publish' else 'unpublish' + recordingActions = $('.hidden-elements').find('.recording-actions') + recordingActions.find('.recording-update > i') + .removeClass() + .addClass('fa '+icon) + recordingActions.find('.recording-update') + .attr('data-published', published) + .attr('title', I18n[publishText+'_recording']) + return recordingActions.html() return data } ] diff --git a/app/views/landing/rooms.html.erb b/app/views/landing/rooms.html.erb index 52670083..4effe1a6 100644 --- a/app/views/landing/rooms.html.erb +++ b/app/views/landing/rooms.html.erb @@ -45,4 +45,13 @@ +
+ + + + +
diff --git a/config/locales/en-us.yml b/config/locales/en-us.yml index ad54b33c..cab1ce4d 100644 --- a/config/locales/en-us.yml +++ b/config/locales/en-us.yml @@ -26,9 +26,11 @@ en-US: are_you_sure: Are you sure? meeting_ended: Meeting was ended meeting_started: Meeting was started + publish_recording: Publish recording recording_deleted: Recording was deleted recording_published: Recording was published recording_unpublished: Recording was unpublished + unpublish_recording: Unpublish recording copied: Copied copy_error: Use Ctrl-c to copy date_recorded: Date Recorded @@ -50,6 +52,7 @@ en-US: powered_bigbluebutton: Powered by BigBlueButton presentation: Presentation refresh_html: Click refresh to generate a new meeting URL + delete_recording: Delete recording session_url_explanation: The session will be taking place using the following URL start: Start start_new_session: Start a new session