Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

[admin] added full screen mode to advanced json editor #43

Merged
merged 1 commit into from
Mar 24, 2017
Merged

[admin] added full screen mode to advanced json editor #43

merged 1 commit into from
Mar 24, 2017

Conversation

gastonche
Copy link
Contributor

@gastonche gastonche commented Mar 11, 2017

PR pertaining to issue #41 .

@coveralls
Copy link

coveralls commented Mar 11, 2017

Coverage Status

Coverage remained the same at 99.877% when pulling 3b41207 on gastonche:fullscreen_editor into 3a7287d on openwisp:master.

@gastonche
Copy link
Contributor Author

@nemesisdesign I submitted the PR already and would like you to review it so I can correct any issues you may find soon.

@nemesifier
Copy link
Member

Testing now.

@nemesifier
Copy link
Member

I would say we are halfway through it. In order for this to be really full screen, a few slightly more complex things should be implemented:

  • the height of the advanced editor should adapt to the height of the window, eg: div.height($(window).height())
  • the height of the advanced editor should change if the window is resized (bind to resize event of window object)
  • the main scrollbars of the body element must be disabled (set overflow: hidden)
  • when back to normal mode, the height of the advanced editor must be cleaned up, the overflow: hidden directive also must be cleaned up and the resize event must be unloaded

There are also a few graphical improvements I want to suggest:

  • in full screen mode, the help text "configuration in NetJSON DeviceConfiguration format" and its container (with white background) can be hidden so that the editor can become prevalent

@gastonche
Copy link
Contributor Author

Okay, I'll update and submit a PR by night. @nemesisdesign

@nemesifier
Copy link
Member

@gastonche you can update this PR by amending your commit (git --amend) and using git push -f to your own development branch

@gastonche
Copy link
Contributor Author

Okay, thanks for the tip @nemesisdesign

@gastonche
Copy link
Contributor Author

gastonche commented Mar 14, 2017

@nemesisdesign I have effected all of the changes you specified. But given that the editor in full screen mode has to hide all other elements, is it sufficient that i have enabled the use of the ESC key as a way to exit full screen mode or should I also add some more controls the the top of the screen hanging over the editor to enable the user exit full screen mode by clicking?

@nemesifier
Copy link
Member

@gastonche I don't know because I haven't seen the result. Don't be afraid to push your work even if unfinished. Push it, I'll test it and come back to you with some useful suggestions.

@coveralls
Copy link

coveralls commented Mar 14, 2017

Coverage Status

Coverage remained the same at 99.877% when pulling 6a0b583 on gastonche:fullscreen_editor into 3a7287d on openwisp:master.

@coveralls
Copy link

coveralls commented Mar 16, 2017

Coverage Status

Coverage remained the same at 99.877% when pulling 06ef70e on gastonche:fullscreen_editor into 3a7287d on openwisp:master.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

@gastonche great! Much better.

Now, I think the "powered by ace" link takes very important space that we need. Therefore, if you could find a way to hide/delete that element we could put there the button to go back to normal mode.

Do you think it would be possible to move the link to the netjsonconfig documentation in the blue bar on the editor? Or can you think of another way to show that link in a pleasant way?

toggleFullScreen();
}
});
}else{
Copy link
Member

Choose a reason for hiding this comment

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

for consistency with the rest of the code, better to have

}
else {

inFullScreenMode = false;
document.getElementById('advanced_editor').scrollIntoView(true);
}

Copy link
Member

Choose a reason for hiding this comment

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

delete blank line

@coveralls
Copy link

coveralls commented Mar 16, 2017

Coverage Status

Coverage remained the same at 99.877% when pulling 7ef3b28 on gastonche:fullscreen_editor into 3a7287d on openwisp:master.

@nemesifier
Copy link
Member

Try to squash the 4 commits into one by using git rebase -i HEAD~4

@gastonche
Copy link
Contributor Author

gastonche commented Mar 16, 2017 via email

@nemesifier
Copy link
Member

I will test now ;-)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.877% when pulling f64bef3 on gastonche:fullscreen_editor into 4278595 on openwisp:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.877% when pulling f64bef3 on gastonche:fullscreen_editor into 4278595 on openwisp:master.

@nemesifier
Copy link
Member

@gastonche always ping me when you do changes, we are getting a lot of work and sometimes I may miss some details. Don't be afraid to ping me once in a while.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

@gastonche I've tested the changes. We are almost there! I could do these change myself but I'm very busy and I'd like to have your help in finishing this.

  • change the style of the color of Want learn to use the advanced mode? Consult the netjsonconfig documentation. to white and set the link to netjsonconfig documentation to bold
  • I think we can safely provide only fullscreen, most users will use this mode and it will make things easier for maintainers, so exit full screen could become "exit advanced mode"

@gastonche
Copy link
Contributor Author

gastonche commented Mar 24, 2017 via email

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.877% when pulling 8d3ce6e on gastonche:fullscreen_editor into 4278595 on openwisp:master.

@gastonche
Copy link
Contributor Author

@nemesisdesign I think we are Good to Go, I have done the required fixes and updated the PR

@gastonche
Copy link
Contributor Author

@nemesisdesign I think we are good to go. I have done all the requested changes for this PR and updated the PR as requested.

@nemesifier
Copy link
Member

nemesifier commented Mar 24, 2017

@gastonche excellent. Very good job. I am merging but I will do a few CSS changes myself and I would like you to take a look at them so that in the future you will be able to do this kind of things without my intervention.

@nemesifier nemesifier merged commit 41eb9ee into openwisp:master Mar 24, 2017
@nemesifier
Copy link
Member

@gastonche I added some improvements 0dc39c4 and created issue #45 after testing the patch, there are few issues that will have to be resolved before it can be released

@gastonche
Copy link
Contributor Author

gastonche commented Mar 27, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants