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

Add offline mode #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add offline mode #60

wants to merge 1 commit into from

Conversation

Hypnosphi
Copy link
Contributor

@Hypnosphi Hypnosphi commented Jul 23, 2019

This PR adds an ability to opt out of any communications with server.

Possible usecases are: strict content security policy, user data protection, offline support

@AlexanderPrendota AlexanderPrendota self-requested a review July 23, 2019 16:03
@AlexanderPrendota
Copy link
Collaborator

Hi! Thanks for your help =)
We already have "offline mode". Just use data-highlight-only attribute. So, if u want to prevent all request to server just forbid all requests in web-demo-api file when data-highlight-only is true.

@Hypnosphi
Copy link
Contributor Author

Just use data-highlight-only attribute

It sets codemirror to readonly mode

@AlexanderPrendota
Copy link
Collaborator

Do you want to edit code without runnable? What is your point? U can just use plain Codemirror library instead of kotlin-playground.

So, we can add offline attribute and prevent all request to server just forbid all requests in web-demo-api file

@Hypnosphi
Copy link
Contributor Author

just use plain Codemirror library instead of kotlin-playground.

I use the //sampleStart///sampleEnd feature

@AlexanderPrendota
Copy link
Collaborator

Okay! Let's patch file with requests instead of adding a lot of conditions in several files) What do u think?

@Hypnosphi
Copy link
Contributor Author

@AlexanderPrendota

patch file with requests

You mean, pass offline option to each of the functions in https://github.com/JetBrains/kotlin-playground/blob/master/src/webdemo-api.js ? That wouldn't remove Run button and autocompletion override

@AlexanderPrendota
Copy link
Collaborator

AlexanderPrendota commented Jul 25, 2019

remove Run button

Just add a condition to .monk file

autocompletion

why do you need to override completion method?

@Hypnosphi
Copy link
Contributor Author

Hypnosphi commented Jul 25, 2019

Just add a condition to .monk file

Done already

why do you need to override completion method?

I need the contrary: avoid overriding default CM autocomplete when it's known to be useless. Same for shortcuts

@AlexanderPrendota
Copy link
Collaborator

Hey! I put a9bb058. So, we dont add editor hints and other options in readonly mode.

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