Merge pull request #4796 from minrk/update-components

update components

closes #4765
This commit is contained in:
Matthias Bussonnier 2014-01-16 09:53:07 -08:00
commit 0ec0534ce9
5 changed files with 5 additions and 34 deletions

View File

@ -119,11 +119,6 @@ class IPythonHandler(AuthenticatedHandler):
else:
return app_log
@property
def use_less(self):
"""Use less instead of css in templates"""
return self.settings.get('use_less', False)
#---------------------------------------------------------------
# URLs
#---------------------------------------------------------------
@ -193,7 +188,6 @@ class IPythonHandler(AuthenticatedHandler):
base_kernel_url=self.base_kernel_url,
logged_in=self.logged_in,
login_available=self.login_available,
use_less=self.use_less,
static_url=self.static_url,
)

View File

@ -27,7 +27,6 @@ def _compile_less(source, target, minify=True, verbose=False):
verbose = _to_bool(verbose)
min_flag = '-x' if minify is True else ''
ver_flag = '--verbose' if verbose is True else ''
lessc = os.path.join('components', 'less.js', 'bin', 'lessc')
with lcd(static_dir):
local('{lessc} {min_flag} {ver_flag} {source} {target}'.format(**locals()))
local('lessc {min_flag} {ver_flag} {source} {target}'.format(**locals()))

View File

@ -180,7 +180,6 @@ class NotebookWebApplication(web.Application):
nbextensions_path = ipython_app.nbextensions_path,
mathjax_url=ipython_app.mathjax_url,
config=ipython_app.config,
use_less=ipython_app.use_less,
jinja2_env=Environment(loader=FileSystemLoader(template_path)),
)
@ -395,18 +394,6 @@ class NotebookApp(BaseIPythonApplication):
BROWSER environment variable to override it.
""")
use_less = Bool(False, config=True,
help="""Wether to use Browser Side less-css parsing
instead of compiled css version in templates that allows
it. This is mainly convenient when working on the less
file to avoid a build step, or if user want to overwrite
some of the less variables without having to recompile
everything.
You will need to install the less.js component in the static directory
either in the source tree or in your profile folder.
""")
webapp_settings = Dict(config=True,
help="Supply overrides for the tornado.web.Application that the "
"IPython notebook uses.")

View File

@ -13,13 +13,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% block stylesheet %}
{% block lesscss %}
{% if use_less %}
<link rel="stylesheet/less" href="{{ static_url("style/style.less") }}" type="text/css" />
{% else %}
<link rel="stylesheet" href="{{ static_url("style/style.min.css") }}" type="text/css"/>
{% endif %}
{% endblock %}
<link rel="stylesheet" href="{{ static_url("style/style.min.css") }}" type="text/css"/>
{% endblock %}
<link rel="stylesheet" href="{{ static_url("custom/custom.css") }}" type="text/css" />
<script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
@ -82,9 +76,6 @@
<script src="{{static_url("auth/js/loginwidget.js") }}" type="text/javascript" charset="utf-8"></script>
{% block script %}
{% if use_less %}
<script src="{{ static_url("components/less.js/dist/less-1.3.3.min.js") }}" charset="utf-8"></script>
{% endif %}
{% endblock %}
<script src="{{static_url("custom/custom.js") }}" type="text/javascript" charset="utf-8"></script>

View File

@ -10,7 +10,7 @@ casper.notebook_test(function () {
cell.render();
return cell.get_rendered();
});
this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown JS API works.');
this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.');
// Test menubar entries.
output = this.evaluate(function () {
@ -21,7 +21,7 @@ casper.notebook_test(function () {
$('#run_cell').mouseenter().click();
return cell.get_rendered();
});
this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown menubar items work.');
this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.');
// Test toolbar buttons.
output = this.evaluate(function () {
@ -32,5 +32,5 @@ casper.notebook_test(function () {
$('#run_b').click();
return cell.get_rendered();
});
this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown toolbar items work.');
this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.');
});