applied prettier --write

This commit is contained in:
Chaphasilor 2020-04-12 14:43:04 +02:00 committed by Ian Ramzy
parent 3edf6c1cb0
commit 93b7f9b40b
5 changed files with 62 additions and 67 deletions

3
public/chat.html vendored
View File

@ -1,9 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ZipChat</title>
<link rel="shortcut icon" href="/images/logo.svg" />

24
public/css/chat.css vendored
View File

@ -361,23 +361,24 @@ button:hover {
/* Begin mobile layout */
@media (max-width: 640px) {
/* @media (min-width: 320px) and (max-width: 480px) { */
/* @media (min-width: 320px) and (max-width: 480px) { */
html, body {
html,
body {
width: 100%;
height: 100%;
font-size: 1em;
}
#header {
z-index: 5;
}
#header img {
width: auto;
height: 2rem;
}
#header p {
margin: 0;
line-height: 2rem;
@ -485,12 +486,12 @@ button:hover {
display: none !important;
}
.buttonContainer:nth-child(3) ,
.buttonContainer:nth-child(3),
.buttonContainer:nth-child(5) {
display: none;
}
#entire-chat {
#entire-chat {
position: absolute;
top: 3rem;
right: 0;
@ -529,21 +530,20 @@ button:hover {
bottom: 0;
width: 80%;
height: 2rem;
margin: .5rem 0;
margin: 0.5rem 0;
padding: 0;
box-shadow: none;
}
.compose input {
width: 90%;
height: 2rem;
line-height: 2rem;
}
.compose input::placeholder {
color: white;
}
}
/* End mobile layout */
/* End mobile layout */

View File

@ -95,7 +95,6 @@
/* Mobile Styles Start */
@media (max-width: 640px) {
.snackbar-container {
position: fixed;
top: 5rem;
@ -110,7 +109,7 @@
height: auto;
margin: 0;
margin-top: 1rem;
padding: .5rem;
padding: 0.5rem;
word-wrap: break-word;
line-height: 1.2rem;
font-size: 1rem;
@ -122,7 +121,7 @@
.snackbar-container .action {
width: 15%;
padding: .2rem;
padding: 0.2rem;
border-radius: 10px;
display: inline-block;
border: none;
@ -136,10 +135,9 @@
.snackbar-pos.bottom-center,
.snackbar-pos.top-center {
left: calc(10vw - 0.5rem);;
left: calc(10vw - 0.5rem);
transform: none;
}
}
/* Mobile Styles End */

View File

@ -358,8 +358,12 @@ function rePositionLocalVideo() {
// Get position of remote video
var bounds = remoteVideo.position();
let localVideo = $("#local-video");
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
bounds.top = $(window).height()*0.75;
if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent
)
) {
bounds.top = $(window).height() * 0.75;
bounds.left += 10;
} else {
bounds.top += 10;

View File

@ -9,9 +9,8 @@
* jquery.ui.mouse.js
*/
(function ($) {
// Detect touch support
$.support.touch = 'ontouchend' in document;
$.support.touch = "ontouchend" in document;
// Ignore browsers without touch support
if (!$.support.touch) {
@ -19,17 +18,16 @@
}
var mouseProto = $.ui.mouse.prototype,
_mouseInit = mouseProto._mouseInit,
_mouseDestroy = mouseProto._mouseDestroy,
touchHandled;
_mouseInit = mouseProto._mouseInit,
_mouseDestroy = mouseProto._mouseDestroy,
touchHandled;
/**
* Simulate a mouse event based on a corresponding touch event
* @param {Object} event A touch event
* @param {String} simulatedType The corresponding mouse event
*/
function simulateMouseEvent (event, simulatedType) {
function simulateMouseEvent(event, simulatedType) {
// Ignore multi-touch events
if (event.originalEvent.touches.length > 1) {
return;
@ -38,25 +36,25 @@
event.preventDefault();
var touch = event.originalEvent.changedTouches[0],
simulatedEvent = document.createEvent('MouseEvents');
simulatedEvent = document.createEvent("MouseEvents");
// Initialize the simulated mouse event using the touch event's coordinates
simulatedEvent.initMouseEvent(
simulatedType, // type
true, // bubbles
true, // cancelable
window, // view
1, // detail
touch.screenX, // screenX
touch.screenY, // screenY
touch.clientX, // clientX
touch.clientY, // clientY
false, // ctrlKey
false, // altKey
false, // shiftKey
false, // metaKey
0, // button
null // relatedTarget
simulatedType, // type
true, // bubbles
true, // cancelable
window, // view
1, // detail
touch.screenX, // screenX
touch.screenY, // screenY
touch.clientX, // clientX
touch.clientY, // clientY
false, // ctrlKey
false, // altKey
false, // shiftKey
false, // metaKey
0, // button
null // relatedTarget
);
// Dispatch the simulated event to the target element
@ -68,11 +66,13 @@
* @param {Object} event The widget element's touchstart event
*/
mouseProto._touchStart = function (event) {
var self = this;
// Ignore the event if another widget is already being handled
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
if (
touchHandled ||
!self._mouseCapture(event.originalEvent.changedTouches[0])
) {
return;
}
@ -83,13 +83,13 @@
self._touchMoved = false;
// Simulate the mouseover event
simulateMouseEvent(event, 'mouseover');
simulateMouseEvent(event, "mouseover");
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
simulateMouseEvent(event, "mousemove");
// Simulate the mousedown event
simulateMouseEvent(event, 'mousedown');
simulateMouseEvent(event, "mousedown");
};
/**
@ -97,7 +97,6 @@
* @param {Object} event The document's touchmove event
*/
mouseProto._touchMove = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
@ -107,7 +106,7 @@
this._touchMoved = true;
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
simulateMouseEvent(event, "mousemove");
};
/**
@ -115,23 +114,21 @@
* @param {Object} event The document's touchend event
*/
mouseProto._touchEnd = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Simulate the mouseup event
simulateMouseEvent(event, 'mouseup');
simulateMouseEvent(event, "mouseup");
// Simulate the mouseout event
simulateMouseEvent(event, 'mouseout');
simulateMouseEvent(event, "mouseout");
// If the touch interaction did not move, it should trigger a click
if (!this._touchMoved) {
// Simulate the click event
simulateMouseEvent(event, 'click');
simulateMouseEvent(event, "click");
}
// Unset the flag to allow other widgets to inherit the touch event
@ -145,14 +142,13 @@
* original mouse event handling methods.
*/
mouseProto._mouseInit = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.bind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
touchstart: $.proxy(self, "_touchStart"),
touchmove: $.proxy(self, "_touchMove"),
touchend: $.proxy(self, "_touchEnd"),
});
// Call the original $.ui.mouse init method
@ -163,18 +159,16 @@
* Remove the touch event handlers
*/
mouseProto._mouseDestroy = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.unbind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
touchstart: $.proxy(self, "_touchStart"),
touchmove: $.proxy(self, "_touchMove"),
touchend: $.proxy(self, "_touchEnd"),
});
// Call the original $.ui.mouse destroy method
_mouseDestroy.call(self);
};
})(jQuery);
})(jQuery);