diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico new file mode 100644 index 0000000..1fcd3c7 Binary files /dev/null and b/app/assets/images/favicon.ico differ diff --git a/app/assets/javascripts/signaling-server.js b/app/assets/javascripts/signaling-server.js index 25db06a..e8a88c0 100644 --- a/app/assets/javascripts/signaling-server.js +++ b/app/assets/javascripts/signaling-server.js @@ -16,10 +16,12 @@ let pcPeers = {}; // peer connection let localstream; window.onload = () => { - currentUser = document.getElementById("current-user").innerHTML; - console.log(currentUser) - localVideo = document.getElementById("local-video"); - remoteVideoContainer = document.getElementById("remote-video-container"); + // if (document.getElementById("current-user")) { + currentUser = document.getElementById("current-user").innerHTML; + console.log(currentUser) + localVideo = document.getElementById("local-video"); + remoteVideoContainer = document.getElementById("remote-video-container"); + // } }; // Ice Credentials @@ -35,8 +37,10 @@ document.onreadystatechange = async () => { }) localstream = stream; - localVideo.srcObject = stream - localVideo.muted = true + // if (localVideo) { + localVideo.srcObject = stream + localVideo.muted = true + // } } catch (e) { console.error(e); } } }; @@ -67,7 +71,11 @@ document.onreadystatechange = async () => { // } // }); // }; -const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"] + +// if (document.getElementById('chatroom-hook')) { + const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"] + +// } const handleJoinSession = async () => { App['chatroom' + chatroomId] = await App.cable.subscriptions.create({ diff --git a/app/assets/stylesheets/pages/_contacts.scss b/app/assets/stylesheets/pages/_contacts.scss index b4c303f..a897fcf 100644 --- a/app/assets/stylesheets/pages/_contacts.scss +++ b/app/assets/stylesheets/pages/_contacts.scss @@ -131,3 +131,31 @@ a:hover { justify-content: center; align-items: center; } + + + + + +.contact { + color: white; +} + +.contacts { + height: 570px; + overflow: scroll; +} + + + + + + + + + + + + + + + diff --git a/app/javascript/components/modal.js b/app/javascript/components/modal.js new file mode 100644 index 0000000..25eb307 --- /dev/null +++ b/app/javascript/components/modal.js @@ -0,0 +1,11 @@ + +const triggerModalEvent = () => { + const btn = document.getElementById("modalTrigger"); + const modal = document.getElementById("myModal"); + + btn.addEventListener('click', function(event) { + $('#myModal').modal('show'); + }); +} + +export { triggerModalEvent } diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index b4593fd..8a54864 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -1,4 +1,9 @@ import "bootstrap"; -import { profilePageAnimation } from '../users/lesson'; -profilePageAnimation(); +import { triggerModalEvent } from "../components/modal.js"; + +triggerModalEvent(); + +// import { profilePageAnimation } from '../users/lesson'; + +// profilePageAnimation(); diff --git a/app/javascript/packs/modal.js b/app/javascript/packs/modal.js deleted file mode 100644 index e9249f1..0000000 --- a/app/javascript/packs/modal.js +++ /dev/null @@ -1,8 +0,0 @@ -import "bootstrap"; - -const btn = document.getElementById("modalTrigger"); -const modal = document.getElementById("myModal"); - -btn.addEventListener('click', function(event) { - $('#myModal').modal('show'); -}); diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7118264..99d6833 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,6 +3,7 @@ + <%= favicon_link_tag 'favicon.ico' %> Polyglot <%= csrf_meta_tags %> <%= action_cable_meta_tag %> @@ -15,5 +16,6 @@ <%= yield %> <%= javascript_include_tag 'application' %> <%= javascript_pack_tag 'application' %> + diff --git a/app/views/pages/_contact.html.erb b/app/views/pages/_contact.html.erb index 4351fde..6878932 100644 --- a/app/views/pages/_contact.html.erb +++ b/app/views/pages/_contact.html.erb @@ -65,4 +65,3 @@ end -<%= javascript_pack_tag 'modal' %> diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index 715f64a..a9edc98 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -8,7 +8,6 @@ <% end %> - <% current_user.contacts.each do |contact| %> <%= render "pages/contact", contact: contact %> <% end %> diff --git a/app/views/pages/new.html.erb b/app/views/pages/new.html.erb new file mode 100644 index 0000000..55c5058 --- /dev/null +++ b/app/views/pages/new.html.erb @@ -0,0 +1,10 @@ +<%= simple_form_for(@page) do |p| %> + + <%= p.input :first_name, as: :text, input_html: { autocomplete: "off" } %> + <%= p.input :last_name, as: :text, input_html: { autocomplete: "off" } %> + <%= p.input :email, as: :text, input_html: { autocomplete: "off" } %> + <%= p.input :photo %> + <%= p.input :photo_cache, as: :hidden %> + + <%= p.button :submit, class: "btn btn-primary" %> +<% end %>