Show More
@@ -17,7 +17,7 b'' | |||||
17 | "name": "python2" |
|
17 | "name": "python2" | |
18 | }, |
|
18 | }, | |
19 | "name": "", |
|
19 | "name": "", | |
20 | "signature": "sha256:aead3efdf2770e2764fcf617c9e9ba6d40343cf25b01642fbd2a3e66de2b0d7c" |
|
20 | "signature": "sha256:f6e8d46c3edeaf2371bf508730c093f8d1005cc9be13072aabf71dc3f49b2c3b" | |
21 | }, |
|
21 | }, | |
22 | "nbformat": 3, |
|
22 | "nbformat": 3, | |
23 | "nbformat_minor": 0, |
|
23 | "nbformat_minor": 0, | |
@@ -634,131 +634,6 b'' | |||||
634 | } |
|
634 | } | |
635 | }, |
|
635 | }, | |
636 | "source": [ |
|
636 | "source": [ | |
637 | "Style classes" |
|
|||
638 | ] |
|
|||
639 | }, |
|
|||
640 | { |
|
|||
641 | "cell_type": "markdown", |
|
|||
642 | "metadata": {}, |
|
|||
643 | "source": [ |
|
|||
644 | "In addition to alignment classes, the classes defined by Bootstrap can also be used. This tutorial will only cover a few of the most common classes. For a full list of Bootstrap classes, please refer to [Bootstrap's website](http://getbootstrap.com/2.3.2/)." |
|
|||
645 | ] |
|
|||
646 | }, |
|
|||
647 | { |
|
|||
648 | "cell_type": "heading", |
|
|||
649 | "level": 3, |
|
|||
650 | "metadata": {}, |
|
|||
651 | "source": [ |
|
|||
652 | "ButtonWidgets" |
|
|||
653 | ] |
|
|||
654 | }, |
|
|||
655 | { |
|
|||
656 | "cell_type": "code", |
|
|||
657 | "collapsed": false, |
|
|||
658 | "input": [ |
|
|||
659 | "# List of the bootstrap button styles\n", |
|
|||
660 | "classes = [\n", |
|
|||
661 | " 'btn', \n", |
|
|||
662 | " 'btn-primary', \n", |
|
|||
663 | " 'btn-info', \n", |
|
|||
664 | " 'btn-success', \n", |
|
|||
665 | " 'btn-warning', \n", |
|
|||
666 | " 'btn-danger', \n", |
|
|||
667 | " 'btn-inverse', \n", |
|
|||
668 | " 'btn-link'\n", |
|
|||
669 | "]\n", |
|
|||
670 | "\n", |
|
|||
671 | "# Display the buttons in a hbox\n", |
|
|||
672 | "container = widgets.HBox(children=[widgets.Button(description=c) for c in classes])\n", |
|
|||
673 | "display(container)\n", |
|
|||
674 | "\n", |
|
|||
675 | "# Apply classes after display\n", |
|
|||
676 | "ret = [container.children[i].add_class(c) for i, c in enumerate(classes)]" |
|
|||
677 | ], |
|
|||
678 | "language": "python", |
|
|||
679 | "metadata": {}, |
|
|||
680 | "outputs": [] |
|
|||
681 | }, |
|
|||
682 | { |
|
|||
683 | "cell_type": "heading", |
|
|||
684 | "level": 3, |
|
|||
685 | "metadata": { |
|
|||
686 | "slideshow": { |
|
|||
687 | "slide_type": "slide" |
|
|||
688 | } |
|
|||
689 | }, |
|
|||
690 | "source": [ |
|
|||
691 | "ContainerWidgets" |
|
|||
692 | ] |
|
|||
693 | }, |
|
|||
694 | { |
|
|||
695 | "cell_type": "code", |
|
|||
696 | "collapsed": false, |
|
|||
697 | "input": [ |
|
|||
698 | "def create_label(cls):\n", |
|
|||
699 | " class_name = widgets.HTML(value=cls)\n", |
|
|||
700 | " container = widgets.Box(children=[class_name])\n", |
|
|||
701 | " display(container)\n", |
|
|||
702 | " container.add_class(cls)\n", |
|
|||
703 | "\n", |
|
|||
704 | "ret = [create_label(c) for c in [\n", |
|
|||
705 | " 'alert', \n", |
|
|||
706 | " 'alert alert-error', \n", |
|
|||
707 | " 'alert alert-success', \n", |
|
|||
708 | " 'alert alert-info'\n", |
|
|||
709 | "]]" |
|
|||
710 | ], |
|
|||
711 | "language": "python", |
|
|||
712 | "metadata": {}, |
|
|||
713 | "outputs": [] |
|
|||
714 | }, |
|
|||
715 | { |
|
|||
716 | "cell_type": "heading", |
|
|||
717 | "level": 3, |
|
|||
718 | "metadata": { |
|
|||
719 | "slideshow": { |
|
|||
720 | "slide_type": "slide" |
|
|||
721 | } |
|
|||
722 | }, |
|
|||
723 | "source": [ |
|
|||
724 | "ProgressWidgets" |
|
|||
725 | ] |
|
|||
726 | }, |
|
|||
727 | { |
|
|||
728 | "cell_type": "code", |
|
|||
729 | "collapsed": false, |
|
|||
730 | "input": [ |
|
|||
731 | "classes = [\n", |
|
|||
732 | " 'progress-info', \n", |
|
|||
733 | " 'progress-success', \n", |
|
|||
734 | " 'progress-warning', \n", |
|
|||
735 | " 'progress-danger',\n", |
|
|||
736 | " 'progress-info progress-striped', \n", |
|
|||
737 | " 'progress-success progress-striped', \n", |
|
|||
738 | " 'progress-warning progress-striped', \n", |
|
|||
739 | " 'progress-danger progress-striped',\n", |
|
|||
740 | " 'active progress-info progress-striped', \n", |
|
|||
741 | " 'active progress-success progress-striped', \n", |
|
|||
742 | " 'active progress-warning progress-striped', \n", |
|
|||
743 | " 'active progress-danger progress-striped',\n", |
|
|||
744 | "]\n", |
|
|||
745 | "ws = [widgets.IntProgress(value=50, description=c) for c in classes]\n", |
|
|||
746 | "ret = [display(w) for w in ws]\n", |
|
|||
747 | "ret = [ws[i].add_class(c) for i, cs in enumerate(classes) for c in cs.split(' ')]" |
|
|||
748 | ], |
|
|||
749 | "language": "python", |
|
|||
750 | "metadata": {}, |
|
|||
751 | "outputs": [] |
|
|||
752 | }, |
|
|||
753 | { |
|
|||
754 | "cell_type": "heading", |
|
|||
755 | "level": 2, |
|
|||
756 | "metadata": { |
|
|||
757 | "slideshow": { |
|
|||
758 | "slide_type": "slide" |
|
|||
759 | } |
|
|||
760 | }, |
|
|||
761 | "source": [ |
|
|||
762 | "Visibility" |
|
637 | "Visibility" | |
763 | ] |
|
638 | ] | |
764 | }, |
|
639 | }, |
General Comments 0
You need to be logged in to leave comments.
Login now