Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "less_include/components"
}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ docs/man/*.gz
docs/source/api/generated
docs/gh-pages
ipywidgets/static/components
ipywidgets/static/widgets/css/*.min.css*
ipywidgets/static/widgets/css
ipywidgets/tests/bin
less_include
node_modules
*.py[co]
__pycache__
Expand All @@ -20,4 +22,3 @@ __pycache__
.#*
.coverage
.xunit.xml
bin
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ before_install:
- git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels
install:
- pip install -f travis-wheels/wheelhouse -r requirements.txt
- pip install -f travis-wheels/wheelhouse -e file://$PWD#egg=ipywidgets[test] coveralls
- pip install -f travis-wheels/wheelhouse file://$PWD#egg=ipywidgets[test] coveralls
script:
- mkdir /tmp/ipywidgets && cd /tmp/ipywidgets
- 'if [[ $GROUP == js ]]; then python -m ipywidgets.jstest; fi'
- 'if [[ $GROUP == python ]]; then nosetests --with-coverage --cover-package=ipywidgets ipywidgets; fi'
matrix:
Expand Down
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
include COPYING.md
include CONTRIBUTING.md
include README.md
include package.json
include bower.json
include .bowerrc
include build_css.js

# Documentation
graft docs
exclude docs/\#*

# Examples
graft examples
graft ipywidgets/tests
graft ipywidgets/static

# docs subdirs we want to skip
prune docs/build
Expand Down
8 changes: 8 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "ipywidget-less-deps",
"version": "0.0.1",
"dependencies": {
"bootstrap": "components/bootstrap#~3.3",
"font-awesome": "components/font-awesome#~4.2.0"
}
}
32 changes: 25 additions & 7 deletions build_css.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
var path = require('path');

var spawn = require('spawn-sync');

var source = './ipywidgets/static/widgets/less/widgets.less';
var css_destination = './ipywidgets/static/widgets/css/widgets.css';
var min_destination = './ipywidgets/static/widgets/css/widgets.min.css';

var spawn = require('spawn-sync');
var p = spawn('python', ['-c',
"import os,notebook; print(os.path.join(notebook.DEFAULT_STATIC_FILES_PATH))"]);
spawn('lessc', [
'--include-path=' + p.stdout.toString().trim(),
function run(cmd) {
// run a command, with some help:
// - echo command
// - die on failure
// - show stdout/err
console.log('> ' + cmd.join(' '));
var p = spawn(cmd[0], cmd.slice(1));
process.stdout.write(p.stdout.toString());
process.stderr.write(p.stderr.toString());
if (p.status !== 0) {
console.error("`%s` failed with status=%s", cmd.join(' '), p.status);
process.exit(p.status);
}
return p.stdout.toString();
}

run(['lessc',
'--include-path=./less_include',
source,
css_destination
css_destination,
]);
spawn('cleancss', [

run(['cleancss',
'--source-map',
'--skip-restructuring ',
'-o',
Expand Down
2 changes: 1 addition & 1 deletion ipywidgets/jstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, section, *args, **kwargs):
extra_args = kwargs.pop('extra_args', None)
super(WidgetTestController, self).__init__(section, *args, **kwargs)

test_cases = os.path.join(here, '..', 'bin', 'tests', 'tests', self.section)
test_cases = os.path.join(here, 'tests', 'bin', 'tests', self.section)
self.cmd = ['casperjs', 'test', test_cases, '--engine=%s' % self.engine]

if extra_args is not None:
Expand Down
106 changes: 106 additions & 0 deletions ipywidgets/static/widgets/less/flexbox.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

/* Flexible box model classes */
/* Taken from Alex Russell http://infrequently.org/2009/08/css-3-progress/ */

/* This file is a compatability layer. It allows the usage of flexible box
model layouts accross multiple browsers, including older browsers. The newest,
universal implementation of the flexible box model is used when available (see
`Modern browsers` comments below). Browsers that are known to implement this
new spec completely include:

Firefox 28.0+
Chrome 29.0+
Internet Explorer 11+
Opera 17.0+

Browsers not listed, including Safari, are supported via the styling under the
`Old browsers` comments below.
*/


.hbox() {
/* Old browsers */
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: stretch;

display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-align: stretch;

display: box;
box-orient: horizontal;
box-align: stretch;

/* Modern browsers */
display: flex;
flex-direction: row;
align-items: stretch;
}

.vbox() {
/* Old browsers */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-align: stretch;

display: -moz-box;
-moz-box-orient: vertical;
-moz-box-align: stretch;

display: box;
box-orient: vertical;
box-align: stretch;

/* Modern browsers */
display: flex;
flex-direction: column;
align-items: stretch;
}

.box-flex0() {
/* Old browsers */
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;

/* Modern browsers */
flex: none;
width: auto;
}

.box-flex1() {
/* Old browsers */
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;

/* Modern browsers */
flex: 1;
}

.box-flex() {
/* Old browsers */
.box-flex1();
}

.box-flex2() {
/* Old browsers */
-webkit-box-flex: 2;
-moz-box-flex: 2;
box-flex: 2;

/* Modern browsers */
flex: 2;
}

.align-start() {
/* Old browsers */
-webkit-box-align: start;
-moz-box-align: start;
box-align: start;

/* Modern browsers */
align-items: flex-start;
}

12 changes: 12 additions & 0 deletions ipywidgets/static/widgets/less/mixins.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Mixin CSS classes

.border-box-sizing() {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}

.corner-all() {
border-radius: @border-radius-base;
}

11 changes: 3 additions & 8 deletions ipywidgets/static/widgets/less/widgets.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
@import "/components/font-awesome/less/variables.less";

// import variables, mixins from Notebook
@import "/base/less/variables.less";
@import "/base/less/mixins.less";
@import "/base/less/flexbox.less";

@import "/notebook/less/variables.less";
// layout mixins
@import "./flexbox.less";
@import "./mixins.less";

@widget-width: 350px;
@widget-width-short: 150px;
Expand Down Expand Up @@ -58,7 +56,6 @@
content: @fa-var-chain-broken;
font-family: 'FontAwesome';
color: @brand-danger;
font-size: @notebook_font_size;
top: 3px;
padding: 3px;
}
Expand Down Expand Up @@ -133,7 +130,6 @@
.ui-slider-range {
height : 12px;
margin-top : -4px;
background : @page-backdrop-color;
}
}
}
Expand Down Expand Up @@ -178,7 +174,6 @@
.ui-slider-range {
width : 12px;
margin-left : -1px;
background : @page-backdrop-color;
}
}
}
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{
"name": "ipython-widget-deps",
"version": "4.0.0",
"description": "IPython widget nodejs dependencies",
"description": "IPython widget nodejs build dependencies",
"author": "IPython Developers",
"license": "BSD",
"repository": {
"type": "git",
"url": "https://github.com/ipython/ipython_widget.git"
"url": "https://github.com/ipython/ipywidgets.git"
},
"scripts": {
"build": "npm run css && npm run buildtests",
"bower": "bower install",
"precss": "rimraf ./ipywidgets/static/widgets/css/",
"css": "node build_css.js",
"prebuildtests": "rimraf ./bin/tests",
"buildtests": "tsc ./ipywidgets/tests/**/*.ts --outDir ./bin/tests -d -m commonjs -t ES5",
"postinstall": "npm run build"
"prebuildtests": "rimraf ./ipywidgets/tests/bin/tests",
"buildtests": "tsc ./ipywidgets/tests/**/*.ts --outDir ./ipywidgets/tests/bin -d -m commonjs -t ES5",
"postinstall": "npm run bower"
},
"devDependencies": {
"bower": "*",
"clean-css": "*",
"less": "~2",
"typescript": "~1.5.0-beta",
"rimraf": "^2.4.1",
"spawn-sync": "*",
"clean-css": "*"
"typescript": "~1.5.0-beta"
}
}
Loading