Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert ui-vrecord Package to JS #6473

Merged
merged 8 commits into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions packages/rocketchat-ui-vrecord/client/VRecDialog.coffee

This file was deleted.

63 changes: 63 additions & 0 deletions packages/rocketchat-ui-vrecord/client/VRecDialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
export const VRecDialog = class {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget the new?

static initClass() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use a normal constructor?

this.prototype.opened = false;
this.prototype.initiated = false;
this.prototype.width = 400;
this.prototype.height = 280;
}

init() {
if (this.initiated) {
return;
}

this.initiated = true;
return Blaze.render(Template.vrecDialog, document.body);
}

open(source) {
if (!this.initiated) {
this.init();
}

this.source = source;
const dialog = $('.vrec-dialog');
this.setPosition(dialog, source);
dialog.addClass('show');
this.opened = true;

return this.initializeCamera();
}

close() {
$('.vrec-dialog').removeClass('show');
this.opened = false;

if (this.video != null) {
return VideoRecorder.stop();
}
}

setPosition(dialog, source) {
const sourcePos = $(source).offset();
let left = (sourcePos.left - this.width) + 100;
let top = sourcePos.top - this.height - 40;

if (left < 0) {
left = 10;
}
if (top < 0) {
top = 10;
}

return dialog.css({ top: `${ top }px`, left: `${ left }px` });
}

initializeCamera() {
this.video = $('.vrec-dialog video').get('0');
if (!this.video) {
return;
}
return VideoRecorder.start(this.video);
}
};
3 changes: 1 addition & 2 deletions packages/rocketchat-ui-vrecord/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Package.onUse(function(api) {
'mongo',
'ecmascript',
'templating',
'coffeescript',
'underscore',
'tracker',
'rocketchat:lib',
Expand All @@ -22,7 +21,7 @@ Package.onUse(function(api) {

api.addFiles('client/vrecord.html', 'client');
api.addFiles('client/vrecord.js', 'client');
api.addFiles('client/VRecDialog.coffee', 'client');
api.addFiles('client/VRecDialog.js', 'client');

api.addFiles('server/settings.js', 'server');
});
264 changes: 264 additions & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
./packages/rocketchat-lib/client/MessageAction.coffee
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you add this by mistake?

./packages/rocketchat-lib/client/models/_Base.coffee
./packages/rocketchat-lib/client/models/Uploads.coffee
./packages/rocketchat-lib/client/lib/roomTypes.coffee
./packages/rocketchat-lib/client/lib/openRoom.coffee
./packages/rocketchat-lib/client/lib/settings.coffee
./packages/rocketchat-lib/client/lib/roomExit.coffee
./packages/rocketchat-lib/client/AdminBox.coffee
./packages/rocketchat-lib/client/methods/sendMessage.coffee
./packages/rocketchat-lib/client/Notifications.coffee
./packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.coffee
./packages/rocketchat-lib/server/startup/settings.coffee
./packages/rocketchat-lib/server/startup/settingsOnLoadSMTP.coffee
./packages/rocketchat-lib/server/startup/oAuthServicesUpdate.coffee
./packages/rocketchat-lib/server/publications/settings.coffee
./packages/rocketchat-lib/server/models/Settings.coffee
./packages/rocketchat-lib/server/models/Messages.coffee
./packages/rocketchat-lib/server/models/Users.coffee
./packages/rocketchat-lib/server/models/Reports.coffee
./packages/rocketchat-lib/server/models/Rooms.coffee
./packages/rocketchat-lib/server/models/Subscriptions.coffee
./packages/rocketchat-lib/server/models/Uploads.coffee
./packages/rocketchat-lib/server/functions/sendMessage.coffee
./packages/rocketchat-lib/server/functions/checkUsernameAvailability.coffee
./packages/rocketchat-lib/server/functions/settings.coffee
./packages/rocketchat-lib/server/functions/setUsername.coffee
./packages/rocketchat-lib/server/functions/Notifications.coffee
./packages/rocketchat-lib/server/lib/roomTypes.coffee
./packages/rocketchat-lib/server/lib/RateLimiter.coffee
./packages/rocketchat-lib/server/methods/deleteMessage.coffee
./packages/rocketchat-lib/server/methods/sendSMTPTestEmail.coffee
./packages/rocketchat-lib/server/methods/sendMessage.coffee
./packages/rocketchat-lib/server/methods/robotMethods.coffee
./packages/rocketchat-lib/server/methods/sendInvitationEmail.coffee
./packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.coffee
./packages/rocketchat-lib/lib/core.coffee
./packages/rocketchat-lib/lib/MessageTypes.coffee
./packages/rocketchat-lib/lib/configLogger.coffee
./packages/rocketchat-lib/lib/roomTypesCommon.coffee
./packages/rocketchat-lib/lib/promises.coffee
./packages/rocketchat-lib/lib/callbacks.coffee
./packages/rocketchat-lib/lib/settings.coffee
./packages/rocketchat-lib/lib/slashCommand.coffee
./packages/rocketchat-lib/lib/Message.coffee
./packages/rocketchat-lib/tests/jasmine/server/unit/models/_Base.spec.coffee
./packages/rocketchat-file/file.server.coffee
./packages/rocketchat-slashcommands-join/client.coffee
./packages/rocketchat-slashcommands-join/server.coffee
./packages/rocketchat-ui-vrecord/client/VRecDialog.coffee
./packages/rocketchat-internal-hubot/hubot.coffee
./packages/rocketchat-internal-hubot/scripts/pugme.coffee
./packages/rocketchat-internal-hubot/scripts/maps.coffee
./packages/rocketchat-internal-hubot/settings.coffee
./packages/rocketchat-ui-login/client/login/social.coffee
./packages/rocketchat-ui-login/client/login/header.coffee
./packages/rocketchat-ui-login/client/login/services.coffee
./packages/rocketchat-ui-login/client/login/form.coffee
./packages/rocketchat-ui-login/client/login/footer.coffee
./packages/rocketchat-oauth2-server-config/server/models/OAuthApps.coffee
./packages/rocketchat-oauth2-server-config/oauth/client/oauth2-client.coffee
./packages/rocketchat-oauth2-server-config/oauth/server/oauth2-server.coffee
./packages/rocketchat-oauth2-server-config/oauth/server/default-services.coffee
./packages/rocketchat-oauth2-server-config/admin/client/startup.coffee
./packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.coffee
./packages/rocketchat-oauth2-server-config/admin/client/views/oauthApp.coffee
./packages/rocketchat-oauth2-server-config/admin/client/collection.coffee
./packages/rocketchat-oauth2-server-config/admin/client/route.coffee
./packages/rocketchat-oauth2-server-config/admin/server/publications/oauthApps.coffee
./packages/rocketchat-oauth2-server-config/admin/server/methods/deleteOAuthApp.coffee
./packages/rocketchat-oauth2-server-config/admin/server/methods/addOAuthApp.coffee
./packages/rocketchat-oauth2-server-config/admin/server/methods/updateOAuthApp.coffee
./packages/rocketchat-channel-settings/client/startup/messageTypes.coffee
./packages/rocketchat-channel-settings/client/startup/tabBar.coffee
./packages/rocketchat-channel-settings/client/views/channelSettings.coffee
./packages/rocketchat-channel-settings/client/lib/ChannelSettings.coffee
./packages/rocketchat-channel-settings/server/models/Messages.coffee
./packages/rocketchat-channel-settings/server/models/Rooms.coffee
./packages/rocketchat-channel-settings/server/functions/saveRoomDescription.coffee
./packages/rocketchat-channel-settings/server/functions/saveRoomName.coffee
./packages/rocketchat-channel-settings/server/functions/saveRoomType.coffee
./packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.coffee
./packages/rocketchat-channel-settings/server/functions/saveRoomTopic.coffee
./packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.coffee
./packages/rocketchat-channel-settings/server/methods/saveRoomSettings.coffee
./packages/rocketchat-importer/client/admin/adminImportPrepare.coffee
./packages/rocketchat-importer/client/admin/adminImport.coffee
./packages/rocketchat-importer/client/admin/adminImportProgress.coffee
./packages/rocketchat-importer/server/startup/setImportsToInvalid.coffee
./packages/rocketchat-importer/server/models/Imports.coffee
./packages/rocketchat-importer/server/models/RawImports.coffee
./packages/rocketchat-importer/server/classes/ImporterSelection.coffee
./packages/rocketchat-importer/server/classes/ImporterProgressStep.coffee
./packages/rocketchat-importer/server/classes/ImporterProgress.coffee
./packages/rocketchat-importer/server/classes/ImporterSelectionChannel.coffee
./packages/rocketchat-importer/server/classes/ImporterBase.coffee
./packages/rocketchat-importer/server/classes/ImporterSelectionUser.coffee
./packages/rocketchat-importer/server/methods/getImportProgress.coffee
./packages/rocketchat-importer/server/methods/startImport.coffee
./packages/rocketchat-importer/server/methods/restartImport.coffee
./packages/rocketchat-importer/server/methods/getSelectionData.coffee
./packages/rocketchat-importer/server/methods/setupImporter.coffee
./packages/rocketchat-importer/lib/importTool.coffee
./packages/rocketchat-importer/lib/_importer.coffee
./packages/rocketchat-integrations/server/api/api.coffee
./packages/rocketchat-ui-message/client/message.coffee
./packages/rocketchat-ui-message/client/popup/messagePopupConfig.coffee
./packages/rocketchat-ui-message/client/popup/messagePopup.coffee
./packages/rocketchat-ui-message/client/popup/messagePopupEmoji.coffee
./packages/rocketchat-ui-message/client/messageBox.coffee
./packages/rocketchat-ui/client/views/404/roomNotFound.coffee
./packages/rocketchat-ui/client/views/modal.coffee
./packages/rocketchat-ui/client/views/cmsPage.coffee
./packages/rocketchat-ui/client/views/app/roomSearch.coffee
./packages/rocketchat-ui/client/views/app/room.coffee
./packages/rocketchat-ui/client/views/app/home.coffee
./packages/rocketchat-ui/client/views/app/burger.coffee
./packages/rocketchat-ui/client/views/app/videoCall/videoButtons.coffee
./packages/rocketchat-ui/client/views/app/videoCall/videoCall.coffee
./packages/rocketchat-ui/client/views/app/secretURL.coffee
./packages/rocketchat-ui/client/views/app/privateHistory.coffee
./packages/rocketchat-ui/client/views/fxos.coffee
./packages/rocketchat-ui/client/lib/fileUpload.coffee
./packages/rocketchat-ui/client/lib/notification.coffee
./packages/rocketchat-ui/client/lib/modal.coffee
./packages/rocketchat-ui/client/lib/msgTyping.coffee
./packages/rocketchat-ui/client/lib/rocket.coffee
./packages/rocketchat-ui/client/lib/readMessages.coffee
./packages/rocketchat-ui/client/lib/cordova/push.coffee
./packages/rocketchat-ui/client/lib/cordova/facebook-login.coffee
./packages/rocketchat-ui/client/lib/cordova/keyboard-fix.coffee
./packages/rocketchat-ui/client/lib/cordova/urls.coffee
./packages/rocketchat-ui/client/lib/accounts.coffee
./packages/rocketchat-ui/client/lib/tapi18n.coffee
./packages/rocketchat-ui/client/lib/chatMessages.coffee
./packages/rocketchat-ui/client/lib/accountBox.coffee
./packages/rocketchat-ui/client/lib/RoomManager.coffee
./packages/rocketchat-ui/client/lib/RoomHistoryManager.coffee
./packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.coffee
./packages/rocketchat-ui/client/lib/recorderjs/videoRecorder.coffee
./packages/rocketchat-ui/client/lib/menu.coffee
./packages/rocketchat-ui/client/lib/sideNav.coffee
./packages/rocketchat-ui/client/lib/avatar.coffee
./packages/rocketchat-ui/getAvatarUrlFromUsername.coffee
./packages/rocketchat-logger/client/views/viewLogs.coffee
./packages/rocketchat-logger/client/viewLogs.coffee
./packages/rocketchat-logger/server.coffee
./packages/rocketchat-logger/logger.coffee
./packages/rocketchat-mailer/client/startup.coffee
./packages/rocketchat-mailer/client/views/mailerUnsubscribe.coffee
./packages/rocketchat-mailer/client/views/mailer.coffee
./packages/rocketchat-mailer/client/router.coffee
./packages/rocketchat-mailer/server/models/Users.coffee
./packages/rocketchat-mailer/server/startup.coffee
./packages/rocketchat-mailer/server/functions/sendMail.coffee
./packages/rocketchat-mailer/server/functions/unsubscribe.coffee
./packages/rocketchat-mailer/server/methods/sendMail.coffee
./packages/rocketchat-mailer/server/methods/unsubscribe.coffee
./packages/rocketchat-mailer/lib/Mailer.coffee
./packages/rocketchat-oembed/client/baseWidget.coffee
./packages/rocketchat-oembed/client/oembedUrlWidget.coffee
./packages/rocketchat-oembed/client/oembedAudioWidget.coffee
./packages/rocketchat-oembed/client/oembedFrameWidget.coffee
./packages/rocketchat-oembed/client/oembedYoutubeWidget.coffee
./packages/rocketchat-oembed/client/oembedSandstormGrain.coffee
./packages/rocketchat-oembed/client/oembedImageWidget.coffee
./packages/rocketchat-oembed/client/oembedVideoWidget.coffee
./packages/rocketchat-oembed/server/models/OEmbedCache.coffee
./packages/rocketchat-oembed/server/server.coffee
./packages/rocketchat-oembed/server/providers.coffee
./packages/rocketchat-katex/katex.coffee
./packages/rocketchat-katex/settings.coffee
./packages/rocketchat-katex/tests/jasmine/client/unit/katex.spec.coffee
./packages/rocketchat-theme/server/variables.coffee
./packages/rocketchat-theme/server/server.coffee
./packages/rocketchat-livechat/app/client/startup/visitor.coffee
./packages/rocketchat-livechat/app/client/routes/router.coffee
./packages/rocketchat-livechat/app/client/views/message.coffee
./packages/rocketchat-livechat/app/client/views/avatar.coffee
./packages/rocketchat-livechat/app/client/lib/fromApp/RoomHistoryManager.coffee
./packages/rocketchat-livechat/app/client/lib/fromApp/Notifications.coffee
./packages/rocketchat-livechat/app/client/lib/fromApp/avatar.coffee
./packages/rocketchat-livechat/app/client/lib/msgTyping.coffee
./packages/rocketchat-livechat/app/client/lib/collections.coffee
./packages/rocketchat-livechat/app/client/lib/tapi18n.coffee
./packages/rocketchat-livechat/app/client/lib/chatMessages.coffee
./packages/rocketchat-livechat/app/client/lib/parentCall.coffee
./packages/rocketchat-livechat/app/client/lib/error.coffee
./packages/rocketchat-livechat/app/client/lib/_visitor.coffee
./packages/rocketchat-livechat/app/client/methods/sendMessageExternal.coffee
./packages/rocketchat-sharedsecret/sharedsecret.coffee
./packages/rocketchat-channel-settings-mail-messages/client/views/channelSettingsMailMessages.coffee
./packages/rocketchat-channel-settings-mail-messages/client/views/mailMessagesInstructions.coffee
./packages/rocketchat-channel-settings-mail-messages/client/lib/startup.coffee
./packages/rocketchat-channel-settings-mail-messages/server/lib/startup.coffee
./packages/rocketchat-channel-settings-mail-messages/server/methods/mailMessages.coffee
./packages/rocketchat-webrtc/WebRTCClass.coffee
./packages/rocketchat-webrtc/server/settings.coffee
./packages/rocketchat-webrtc/screenShare.coffee
./packages/rocketchat-markdown/markdown.coffee
./packages/rocketchat-markdown/settings.coffee
./packages/rocketchat-markdown/tests/jasmine/client/unit/markdown.spec.coffee
./packages/rocketchat-markdown/markdowncode.coffee
./packages/rocketchat-slashcommands-msg/client.coffee
./packages/rocketchat-slashcommands-msg/server.coffee
./packages/rocketchat-irc/server/server.coffee
./packages/rocketchat-ui-account/client/accountProfile.coffee
./packages/rocketchat-ui-account/client/avatar/prompt.coffee
./packages/rocketchat-ui-account/client/avatar/avatar.coffee
./packages/rocketchat-ui-account/client/accountFlex.coffee
./packages/rocketchat-ui-account/client/account.coffee
./packages/rocketchat-ui-account/client/accountPreferences.coffee
./packages/rocketchat-mentions/client.coffee
./packages/rocketchat-mentions/server.coffee
./packages/rocketchat-wordpress/common.coffee
./packages/rocketchat-wordpress/startup.coffee
./packages/rocketchat-slashcommands-leave/leave.coffee
./packages/meteor-autocomplete/autocomplete-server.coffee
./packages/meteor-autocomplete/autocomplete-client.coffee
./packages/meteor-autocomplete/templates.coffee
./packages/rocketchat-importer-slack/server.coffee
./packages/rocketchat-importer-slack/main.coffee
./packages/rocketchat-slashcommands-me/me.coffee
./packages/rocketchat-importer-hipchat/server.coffee
./packages/rocketchat-importer-hipchat/main.coffee
./packages/rocketchat-mentions-flextab/client/views/mentionsFlexTab.coffee
./packages/rocketchat-mentions-flextab/client/tabBar.coffee
./packages/rocketchat-mentions-flextab/client/lib/MentionedMessage.coffee
./packages/rocketchat-mentions-flextab/client/actionButton.coffee
./packages/rocketchat-mentions-flextab/server/publications/mentionedMessages.coffee
./packages/rocketchat-slashcommands-invite/client.coffee
./packages/rocketchat-slashcommands-invite/server.coffee
./packages/rocketchat-message-star/client/starMessage.coffee
./packages/rocketchat-message-star/client/views/starredMessages.coffee
./packages/rocketchat-message-star/client/tabBar.coffee
./packages/rocketchat-message-star/client/lib/StarredMessage.coffee
./packages/rocketchat-message-star/client/actionButton.coffee
./packages/rocketchat-message-star/server/startup/indexes.coffee
./packages/rocketchat-message-star/server/publications/starredMessages.coffee
./packages/rocketchat-message-star/server/starMessage.coffee
./packages/rocketchat-message-star/server/settings.coffee
./packages/rocketchat-message-attachments/client/messageAttachment.coffee
./packages/rocketchat-ui-admin/client/adminInfo.coffee
./packages/rocketchat-ui-admin/client/adminFlex.coffee
./packages/rocketchat-ui-admin/client/users/adminUsers.coffee
./packages/rocketchat-ui-admin/client/users/adminInviteUser.coffee
./packages/rocketchat-ui-admin/client/users/adminUserChannels.coffee
./packages/rocketchat-ui-admin/client/admin.coffee
./packages/rocketchat-ui-admin/client/rooms/adminRooms.coffee
./packages/rocketchat-ui-admin/client/rooms/adminRoomInfo.coffee
./packages/rocketchat-version/plugin/compile-version.coffee
./packages/rocketchat-message-pin/client/pinMessage.coffee
./packages/rocketchat-message-pin/client/views/pinnedMessages.coffee
./packages/rocketchat-message-pin/client/tabBar.coffee
./packages/rocketchat-message-pin/client/lib/PinnedMessage.coffee
./packages/rocketchat-message-pin/client/actionButton.coffee
./packages/rocketchat-message-pin/server/startup/indexes.coffee
./packages/rocketchat-message-pin/server/publications/pinnedMessages.coffee
./packages/rocketchat-message-pin/server/pinMessage.coffee
./packages/rocketchat-message-pin/server/settings.coffee
./packages/rocketchat-slashcommands-mute/client/mute.coffee
./packages/rocketchat-slashcommands-mute/client/unmute.coffee
./packages/rocketchat-slashcommands-mute/server/mute.coffee
./packages/rocketchat-slashcommands-mute/server/unmute.coffee
./packages/rocketchat-ui-master/client/main.coffee