-
Notifications
You must be signed in to change notification settings - Fork 26
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
Added Chromecast support for rotation and, Updated package-lock.json #15
Conversation
This is done on the device side and not the channel side. Compatibile with all templates with a body tag. Also, Toast is rotated as well. TODO: Set up a selection on the device page. The rotation can be changed by sending 'rotate' passing 0, 90, 180, or, 270. Save rotation on the database somehow. FYI: These .pug files are making my eyes cry.
Hold on, don't merge yet, I got this! |
NAILED IT! after an all-nighter...Time for bed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! If you'll make the changes I requested, I'll open a new branch and commit this, then we can add JS function, get it working, and incorporate it into the main branch.
app/views/layouts/template.pug
Outdated
@@ -5,7 +5,7 @@ html(lang='en') | |||
include ../include/head.pug | |||
link(rel='stylesheet', href='/css/channel.css') | |||
|
|||
body.layout-name | |||
body(class='layout-name' + rotation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use this format for classname, you need a space after layout-name so the classnames aren't scrunched together into one word. Personally, I think it's more visually appealing/easier to understand at a glance to use the following format:
body.layout-name(class=rotation)
This will always apply the layout-name
class and conditionally apply the rotation class if it's set.
app/views/layouts/right-panel.pug
Outdated
@@ -5,7 +5,7 @@ html(lang='en') | |||
include ../include/head.pug | |||
link(rel='stylesheet', href='/css/channel.css') | |||
|
|||
body.right-panel | |||
body(class='right-panel' + rotation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the following syntax for clarity
body.right-panel(class=rotation)
app/views/layouts/fullscreen.pug
Outdated
include ../include/toast.pug | ||
if channel.URLs != null && channel.URLs.length | ||
iframe(src=channel.URLs[0], frameborder=0, framespacing=0) | ||
body(class='fullscreen ' + rotation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the following syntax for clarity
body.fullscreen(class=rotation)
app/main.js
Outdated
/* Neccessary Function to fetch rotation */ | ||
function getRotationFromDeviceID(id) { | ||
for (var i = 0; i <= devices.length; i++) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function appears to be an artifact from an alternative approach? Doesn't look like its ever called.
Additionally, I like the cleanup changes you've made, but I prefer to use ES6 arrow notation for functions, and save them to variables instead of declare them as functions (see stripIPv6
directly above).
@superhawk610 Finished, also changed the branch to rotation so go ahead and merge. |
I still haven't got to test the JavaScript side but, it should work. I have been testing the CSS side through multiple means. I guarantee that works.
In order for me to test the JavaScript, someone else will need to add a field for rotation and save it to the database.
I also updated the package-lock.json.