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

Js modal window evaluation code #59

Merged
merged 26 commits into from
Oct 14, 2016

Conversation

juanpedromoreno
Copy link
Member

@juanpedromoreno juanpedromoreno commented Oct 11, 2016

This PR includes code to the Kazari plugin that allows users to launch a modal window to edit every code snippet included in the documentation, and to request the remote evaluator to run those. This is still WIP, with no design and missing functionalities (i.e.: save modified code as a GitHub gist). Also included is the use of the evaluator client to perform requests to the remote evaluator, instead of using other libraries or jQuery ajax calls.

Also included is a first draft of the Kazari documentation, to keep track of the functionalities and little details to take into account when using it on an existing documentation.

Could you please review @juanpedromoreno @raulraja @dialelo? Thanks!

@jdesiloniz
Copy link

Sorry about the previous PRs not coming through, I had some problems with wrong merges that @juanpedromoreno was kind enough to help me fix. Thanks man!!


In order to use Kazari, you first need to include two scripts:

* `sbt-microsites-js-opt.js`, containing the main code of the decorator plugin.
Copy link

Choose a reason for hiding this comment

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

Can't we create only one built JS file so users have to only include one script? Not important, but would be nicer.

Choose a reason for hiding this comment

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

I'll try to play with this idea a little bit to see if it works by creating a custom SBT command, it'd certaintly be nicer.

<link rel="stylesheet" href="monokai.css">

<script type="text/javascript">
var config = kazari.model.PluginConfig("http://localhost:8080/eval", "auth_token_string", "monokai")
Copy link

Choose a reason for hiding this comment

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

Can we have only one call to a function for decorating the code? It would be more idiomatic JS.

$(document).ready(function() {
    kazari.decorateCode("http://localhost:8080/eval", "auth_token_string", "monokai")
})  

If Scala.js doesn't allow this its fine as it is.

Choose a reason for hiding this comment

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

Yes, it's possible of course. We thought that we may be needing more parameters and that's the reason we put the configuration in a separate file. But yes, makes sense to do it as parameters in the function call being just 3.

@ghost
Copy link

ghost commented Oct 13, 2016

Minor comments, other than that LGTM. Great job folks!

Tests appear to be failing due to an error in the build.sbt file.

@jdesiloniz
Copy link

@juanpedromoreno @dialelo I've made several changes in the project to include two sbt commands that generate a single file script instead of relying on the two generated by Scala.JS (one command to use the fast process fastOptJS, and the other to use the optimized fullOptJS). Could you check it out please?

@@ -30,16 +30,14 @@ lazy val pluginSettings = Seq(

lazy val micrositeSettings = Seq(
micrositeName := "sbt-microsites",
micrositeDescription := "An sbt plugin to create awesome microsites for your project",
micrositeDescription := "A sbt plugin to create awesome microsites for your project",
Copy link
Member Author

Choose a reason for hiding this comment

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

It should be An ;)

@juanpedromoreno
Copy link
Member Author

juanpedromoreno commented Oct 13, 2016

@jdesiloniz I think you didn't pushed your changes :/, at least, I can't see them

@jdesiloniz
Copy link

@juanpedromoreno fixed!

@juanpedromoreno
Copy link
Member Author

LGTM!

@jdesiloniz jdesiloniz merged commit 690555b into 0.3.0-version Oct 14, 2016
@jdesiloniz jdesiloniz deleted the js-modal-window-evaluation-code branch October 14, 2016 08:37
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.

None yet

2 participants