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

Added Chromecast support for rotation and, Updated package-lock.json #15

Merged
merged 4 commits into from
Oct 16, 2017
Merged

Conversation

Brekmister
Copy link
Contributor

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.

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.
@Brekmister
Copy link
Contributor Author

Hold on, don't merge yet, I got this!

@Brekmister
Copy link
Contributor Author

NAILED IT! after an all-nighter...Time for bed.

Copy link
Owner

@superhawk610 superhawk610 left a 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.

@@ -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)
Copy link
Owner

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.

@@ -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)
Copy link
Owner

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)

include ../include/toast.pug
if channel.URLs != null && channel.URLs.length
iframe(src=channel.URLs[0], frameborder=0, framespacing=0)
body(class='fullscreen ' + rotation)
Copy link
Owner

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++) {

Copy link
Owner

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).

@Brekmister Brekmister changed the base branch from master to rotation October 16, 2017 17:59
@Brekmister
Copy link
Contributor Author

@superhawk610 Finished, also changed the branch to rotation so go ahead and merge.

@superhawk610 superhawk610 merged commit 8d99832 into superhawk610:rotation Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants