├── .editorconfig ├── .gitignore ├── .jshintrc ├── .travis.yml ├── Gruntfile.js ├── README.md ├── banner.txt ├── bower.json ├── build └── knockout-bootstrap.min.js ├── examples ├── css │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ ├── docs.css │ └── prettify.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── img │ ├── bs-docs-masthead-pattern.png │ ├── glyphicons-halflings-white.png │ └── glyphicons-halflings.png ├── index.html └── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── knockout.js │ ├── prettify.js │ └── typeahead.jquery.js ├── gulpfile.js ├── karma.conf.js ├── package.json ├── spec └── test-spec.js └── src └── knockout-bootstrap.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 4 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /jshint.xml 3 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "noempty": "true", 3 | "bitwise": "true", 4 | "immed": "true", 5 | "curly": "true", 6 | "eqeqeq": "true", 7 | "forin": "true", 8 | "latedef": "true", 9 | "newcap": "true", 10 | "nonew": "true", 11 | "noarg": "true", 12 | "strict": "true", 13 | "trailing": "true", 14 | "undef": "true", 15 | "browser": "true", 16 | "jquery": "true", 17 | "devel": "true", 18 | "camelcase": "true", 19 | "globals": { 20 | "define": true 21 | } 22 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.11" 4 | before_script: 5 | - "grunt" -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | module.exports = function(grunt) { 4 | 5 | // Project configuration. 6 | grunt.initConfig({ 7 | pkg: grunt.file.readJSON('package.json'), 8 | uglify: { 9 | options: { 10 | banner: '/*! <%= pkg.name %> version: <%= pkg.version %>\n* <%= grunt.template.today("yyyy-mm-dd") %>\n* Author: Bill Pullen\n* Website: http://billpull.github.com/knockout-bootstrap\n* MIT License http://www.opensource.org/licenses/mit-license.php\n*/\n' 11 | }, 12 | build: { 13 | src: 'src/<%= pkg.name %>.js', 14 | dest: 'build/<%= pkg.name %>.min.js' 15 | } 16 | }, 17 | jshint: { 18 | options: { 19 | reporter: "checkstyle", 20 | reporterOutput: "jshint.xml" 21 | }, 22 | all: ['src/knockout-bootstrap.js'], 23 | } 24 | }); 25 | 26 | // Load the plugin that provides the "uglify" task. 27 | grunt.loadNpmTasks('grunt-contrib-uglify'); 28 | grunt.loadNpmTasks('grunt-contrib-jshint'); 29 | 30 | // Default task(s). 31 | grunt.registerTask('default', ['uglify', 'jshint']); 32 | grunt.registerTask('tests', ['default', 'jshint']); 33 | 34 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | knockout-bootstrap 2 | ================== 3 | 4 | [](https://travis-ci.org/billpull/knockout-bootstrap) 5 | 6 | #### Requires 7 | - knockout >= 3.1.0 8 | - jQuery ( no minimum version identified yet ) 9 | - bootstrap >= 2.1.1 10 | 11 | A plugin that adds custom bindings for Bootstrap plugins such as tooltips and popovers. 12 | 13 | [Docs](http://billpull.github.com/knockout-bootstrap) 14 | 15 | [Download](https://raw.github.com/billpull/knockout-bootstrap/master/build/knockout-bootstrap.min.js) 16 | 17 | #### Packages 18 | npm-install knockout-bootstrap 19 | 20 | [NuGet](https://nuget.org/packages/knockout-bootstrap/0.2.1) 21 | 22 | [CDNJS](//cdnjs.cloudflare.com/ajax/libs/knockout-bootstrap/0.2.1/knockout-bootstrap.min.js) 23 | 24 | **License**: MIT [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) 25 | 26 | -------------------------------------------------------------------------------- /banner.txt: -------------------------------------------------------------------------------- 1 | /*! <%= pkg.name %> version: <%= pkg.version %> 2 | * <%= buildDate %> 3 | * Author: Bill Pullen 4 | * Website: http://billpull.github.com/knockout-bootstrap 5 | * MIT License http://www.opensource.org/licenses/mit-license.php 6 | */ 7 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "knockout-bootstrap", 3 | "version": "0.3.1", 4 | "main": [ 5 | "./build/knockout-bootstrap.min.js" 6 | ], 7 | "ignore": [ 8 | "**/.*", 9 | ".jshintrc", 10 | ".travis.yml" 11 | ], 12 | "dependencies": { 13 | "jquery": ">= 1.9.1", 14 | "bootstrap": ">= 3.3.1", 15 | "knockout": ">= 3.1.0", 16 | "typeahead.js": ">= v0.10.5" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /build/knockout-bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! knockout-bootstrap version: 0.3.1 2 | * 2015-04-18 3 | * Author: Bill Pullen 4 | * Website: http://billpull.github.com/knockout-bootstrap 5 | * MIT License http://www.opensource.org/licenses/mit-license.php 6 | */ 7 | function setupKoBootstrap(a,b){"use strict";var c=function(a){return function(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}}(function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)});b.fn.outerHtml||(b.fn.outerHtml=function(){if(0===this.length)return!1;var a=this[0],c=a.tagName.toLowerCase();if(a.outerHTML)return a.outerHTML;var d=b.map(a.attributes,function(a){return a.name+'="'+a.value+'"'});return"<"+c+(d.length>0?" "+d.join(" "):"")+">"+a.innerHTML+""+c+">"}),a.bindingHandlers.typeahead={init:function(c,d,e){var f=b(c),g=e(),h=function(a){return function(c,d){var e,f;e=[],f=new RegExp(c,"i"),b.each(a,function(a,b){f.test(b)&&e.push({value:b})}),d(e)}},i={source:h(a.utils.unwrapObservable(d()))};g.typeaheadOptions&&b.each(g.typeaheadOptions,function(b,c){i[b]=a.utils.unwrapObservable(c)}),f.attr("autocomplete","off").typeahead({hint:!0,highlight:!0,minLength:1},i)}},a.bindingHandlers.progress={init:function(d,e,f,g){var h=b(d),i=b("
",{"class":"progress-bar","data-bind":"style: { width:"+e()+" }"});h.attr("id",c()).addClass("progress progress-info").append(i),a.applyBindingsToDescendants(g,h[0])}},a.bindingHandlers.alert={init:function(c,d){var e=b(c),f=a.utils.unwrapObservable(d()),g=b("",{type:"button","class":"close","data-dismiss":"alert"}).html("×"),h=b("").html(f.message);e.addClass("alert alert-"+f.priority).append(g).append(h)}},a.bindingHandlers.tooltip={update:function(c,d){var e,f,g;if(f=a.utils.unwrapObservable(d()),e=b(c),a.isObservable(f.title)){var h=!1;e.on("show.bs.tooltip",function(){h=!0}),e.on("hide.bs.tooltip",function(){h=!1});var i=f.animation||!0;f.title.subscribe(function(){h&&(e.data("bs.tooltip").options.animation=!1,e.tooltip("fixTitle").tooltip("show"),e.data("bs.tooltip").options.animation=i)})}g=e.data("bs.tooltip"),g?b.extend(g.options,f):e.tooltip(f)}},a.bindingHandlers.popover={init:function(c,d,e,f){var g=b(c),h=a.utils.unwrapObservable(d()),i=h.template||!1,j=h.options||{title:"popover"},k=h.data||!1;return i!==!1&&(j.content=k?"":b("#"+i).html(),j.html=!0),g.on("shown.bs.popover",function(c){var d=b(c.target).data(),e=d["bs.popover"].$tip,g=d["bs.popover"].options||{},h=b(c.target),j=h.position(),l={x:h.outerWidth(),y:h.outerHeight()};a.cleanNode(e[0]),k?a.applyBindings({template:i,data:k},e[0]):a.applyBindings(f,e[0]);var m={x:e.outerWidth(),y:e.outerHeight()};switch(e.find('button[data-dismiss="popover"]').click(function(){h.popover("hide")}),g.placement){case"right":e.css({left:l.x+j.left,top:l.y/2+j.top-m.y/2});break;case"left":e.css({left:j.left-m.x,top:l.y/2+j.top-m.y/2});break;case"top":e.css({left:j.left+(l.x/2-m.x/2),top:j.top-m.y});break;case"bottom":e.css({left:j.left+(l.x/2-m.x/2),top:j.top+l.y})}}),g.popover(j),{controlsDescendantBindings:!0}}},a.bindingHandlers.modal={init:function(c,d,e,f){var g=b(c),h=a.utils.unwrapObservable(d()),i=h.template||!1,j=h.options||{},k=h.data||!1,l=h.fade||!1,m=h.openModal||!1;j.show=!1;var n={"class":"modal"+(l?" fade":""),"tab-index":"-1",role:"dialog","aria-hidden":"true"};k&&(n["data-bind"]="template: { name: template, if: data, data: data }");var o=b("",n);k||o.html(b("#"+i).html());var p=o.html();return o.modal(j),g.on("click",function(){o.html(p),a.cleanNode(o[0]),k?a.applyBindings({template:i,data:k},o[0]):a.applyBindings(f,o[0]),o.modal("show"),m&&m(),b(".modal-backdrop").css({height:b(window).height(),position:"fixed"})}),{controlsDescendantBindings:!0}}}}!function(a){"use strict";"function"==typeof define&&define.amd?define(["require","exports","knockout","jquery"],function(b,c,d,e){a(d,e)}):a(window.ko,jQuery)}(setupKoBootstrap); -------------------------------------------------------------------------------- /examples/css/docs.css: -------------------------------------------------------------------------------- 1 | /* Add additional stylesheets below 2 | -------------------------------------------------- */ 3 | /* 4 | Bootstrap's documentation styles 5 | Special styles for presenting Bootstrap's documentation and examples 6 | */ 7 | 8 | 9 | 10 | /* Body and structure 11 | -------------------------------------------------- */ 12 | 13 | body { 14 | position: relative; 15 | padding-top: 40px; 16 | } 17 | 18 | /* Code in headings */ 19 | h3 code { 20 | font-size: 14px; 21 | font-weight: normal; 22 | } 23 | 24 | form { 25 | padding-bottom: 20px; 26 | } 27 | 28 | 29 | .typeahead, 30 | .tt-query, 31 | .tt-hint { 32 | width: 396px; 33 | height: 30px; 34 | padding: 8px 12px; 35 | border: 2px solid #ccc; 36 | outline: none; 37 | } 38 | 39 | .typeahead { 40 | background-color: #fff; 41 | } 42 | 43 | .typeahead:focus { 44 | border: 2px solid #0097cf; 45 | } 46 | 47 | .tt-hint { 48 | color: white; 49 | } 50 | 51 | .tt-dropdown-menu { 52 | width: 200px; 53 | margin-top: 0; 54 | padding: 2px 0; 55 | background-color: #fff; 56 | border: 1px solid #ccc; 57 | border: 1px solid rgba(0, 0, 0, 0.2); 58 | -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); 59 | -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); 60 | box-shadow: 0 5px 10px rgba(0,0,0,.2); 61 | } 62 | 63 | label { 64 | display: block; 65 | } 66 | 67 | input, textarea, .uneditable-input { 68 | width: 206px; 69 | } 70 | 71 | .tt-suggestion { 72 | padding: 3px 20px; 73 | } 74 | 75 | .tt-suggestion.tt-cursor { 76 | color: #fff; 77 | background-color: #0097cf; 78 | 79 | } 80 | 81 | .tt-suggestion p { 82 | margin: 0; 83 | } 84 | 85 | .form-actions { 86 | margin: 20px 0; 87 | } 88 | 89 | /* Tweak navbar brand link to be super sleek 90 | -------------------------------------------------- */ 91 | 92 | body > .navbar { 93 | font-size: 13px; 94 | } 95 | 96 | /* Change the docs' brand */ 97 | body > .navbar .navbar-brand { 98 | padding-right: 0; 99 | padding-left: 0; 100 | margin-left: 20px; 101 | float: right; 102 | font-weight: bold; 103 | color: #000; 104 | text-shadow: 0 1px 0 rgba(255,255,255,.1), 0 0 30px rgba(255,255,255,.125); 105 | -webkit-transition: all .2s linear; 106 | -moz-transition: all .2s linear; 107 | transition: all .2s linear; 108 | } 109 | body > .navbar .navbar-brand:hover { 110 | text-decoration: none; 111 | text-shadow: 0 1px 0 rgba(255,255,255,.1), 0 0 30px rgba(255,255,255,.4); 112 | } 113 | 114 | .nav-list>.active>a:before, .nav-list>.active>a:hover { 115 | color: white; 116 | } 117 | 118 | 119 | /* Sections 120 | -------------------------------------------------- */ 121 | 122 | /* padding for in-page bookmarks and fixed navbar */ 123 | section { 124 | padding-top: 30px; 125 | } 126 | section > .page-header, 127 | section > .lead { 128 | color: #5a5a5a; 129 | } 130 | section > ul li { 131 | margin-bottom: 5px; 132 | } 133 | 134 | /* Separators (hr) */ 135 | .bs-docs-separator { 136 | margin: 40px 0 39px; 137 | } 138 | 139 | /* Faded out hr */ 140 | hr.soften { 141 | height: 1px; 142 | margin: 70px 0; 143 | background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 144 | background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 145 | background-image: -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 146 | background-image: -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,.1), rgba(0,0,0,0)); 147 | border: 0; 148 | } 149 | 150 | 151 | 152 | /* Jumbotrons 153 | -------------------------------------------------- */ 154 | 155 | /* Base class 156 | ------------------------- */ 157 | .jumbotron { 158 | position: relative; 159 | padding: 40px 0; 160 | margin: 0; 161 | color: #fff; 162 | text-align: center; 163 | text-shadow: 0 1px 3px rgba(0,0,0,.4), 0 0 30px rgba(0,0,0,.075); 164 | background: #020031; /* Old browsers */ 165 | background: -moz-linear-gradient(45deg, #020031 0%, #6d3353 100%); /* FF3.6+ */ 166 | background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#020031), color-stop(100%,#6d3353)); /* Chrome,Safari4+ */ 167 | background: -webkit-linear-gradient(45deg, #020031 0%,#6d3353 100%); /* Chrome10+,Safari5.1+ */ 168 | background: -o-linear-gradient(45deg, #020031 0%,#6d3353 100%); /* Opera 11.10+ */ 169 | background: -ms-linear-gradient(45deg, #020031 0%,#6d3353 100%); /* IE10+ */ 170 | background: linear-gradient(45deg, #020031 0%,#6d3353 100%); /* W3C */ 171 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#020031', endColorstr='#6d3353',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ 172 | -webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); 173 | -moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); 174 | box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2); 175 | } 176 | .jumbotron h1 { 177 | font-size: 80px; 178 | font-weight: bold; 179 | letter-spacing: -1px; 180 | line-height: 1; 181 | } 182 | .jumbotron p { 183 | font-size: 24px; 184 | font-weight: 300; 185 | line-height: 1.25; 186 | margin-bottom: 30px; 187 | } 188 | 189 | /* Link styles (used on .masthead-links as well) */ 190 | .jumbotron a { 191 | color: #fff; 192 | color: rgba(255,255,255,.5); 193 | -webkit-transition: all .2s ease-in-out; 194 | -moz-transition: all .2s ease-in-out; 195 | transition: all .2s ease-in-out; 196 | } 197 | .jumbotron a:hover { 198 | color: #fff; 199 | text-shadow: 0 0 10px rgba(255,255,255,.25); 200 | } 201 | 202 | /* Download button */ 203 | .masthead .btn { 204 | padding: 19px 24px; 205 | font-size: 24px; 206 | font-weight: 200; 207 | color: #fff; /* redeclare to override the `.jumbotron a` */ 208 | border: 0; 209 | -webkit-border-radius: 6px; 210 | -moz-border-radius: 6px; 211 | border-radius: 6px; 212 | -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 213 | -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 214 | box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 215 | -webkit-transition: none; 216 | -moz-transition: none; 217 | transition: none; 218 | } 219 | .masthead .btn:hover { 220 | -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 221 | -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 222 | box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25); 223 | } 224 | .masthead .btn:active { 225 | -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.1); 226 | -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.1); 227 | box-shadow: inset 0 2px 4px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.1); 228 | } 229 | 230 | .page-header { 231 | margin: 20px 0 30px; 232 | } 233 | 234 | 235 | /* Pattern overlay 236 | ------------------------- */ 237 | .jumbotron .container { 238 | position: relative; 239 | z-index: 2; 240 | } 241 | .jumbotron:after { 242 | content: ''; 243 | display: block; 244 | position: absolute; 245 | top: 0; 246 | right: 0; 247 | bottom: 0; 248 | left: 0; 249 | background: url(../img/bs-docs-masthead-pattern.png) repeat center center; 250 | opacity: .4; 251 | } 252 | @media 253 | only screen and (-webkit-min-device-pixel-ratio: 2), 254 | only screen and ( min--moz-device-pixel-ratio: 2), 255 | only screen and ( -o-min-device-pixel-ratio: 2/1) { 256 | 257 | .jumbotron:after { 258 | background-size: 150px 150px; 259 | } 260 | 261 | } 262 | 263 | /* Masthead (docs home) 264 | ------------------------- */ 265 | .masthead { 266 | padding: 70px 0 80px; 267 | margin-bottom: 0; 268 | color: #fff; 269 | } 270 | .masthead h1 { 271 | font-size: 120px; 272 | line-height: 1; 273 | letter-spacing: -2px; 274 | } 275 | .masthead p { 276 | font-size: 40px; 277 | font-weight: 200; 278 | line-height: 1.25; 279 | } 280 | 281 | /* Textual links in masthead */ 282 | .masthead-links { 283 | margin: 0; 284 | list-style: none; 285 | } 286 | .masthead-links li { 287 | display: inline; 288 | padding: 0 10px; 289 | color: rgba(255,255,255,.25); 290 | } 291 | 292 | /* Social proof buttons from GitHub & Twitter */ 293 | .bs-docs-social { 294 | padding: 15px 0; 295 | text-align: center; 296 | background-color: #f5f5f5; 297 | border-top: 1px solid #fff; 298 | border-bottom: 1px solid #ddd; 299 | } 300 | 301 | /* Quick links on Home */ 302 | .bs-docs-social-buttons { 303 | margin-left: 0; 304 | margin-bottom: 0; 305 | padding-left: 0; 306 | list-style: none; 307 | } 308 | .bs-docs-social-buttons li { 309 | display: inline-block; 310 | padding: 5px 8px; 311 | line-height: 1; 312 | *display: inline; 313 | *zoom: 1; 314 | } 315 | 316 | /* Subhead (other pages) 317 | ------------------------- */ 318 | .subhead { 319 | text-align: left; 320 | border-bottom: 1px solid #ddd; 321 | } 322 | .subhead h1 { 323 | font-size: 60px; 324 | } 325 | .subhead p { 326 | margin-bottom: 20px; 327 | } 328 | .subhead .navbar { 329 | display: none; 330 | } 331 | 332 | 333 | 334 | /* Marketing section of Overview 335 | -------------------------------------------------- */ 336 | 337 | .marketing { 338 | text-align: center; 339 | color: #5a5a5a; 340 | } 341 | .marketing h1 { 342 | margin: 60px 0 10px; 343 | font-size: 60px; 344 | font-weight: 200; 345 | line-height: 1; 346 | letter-spacing: -1px; 347 | } 348 | .marketing h2 { 349 | font-weight: 200; 350 | margin-bottom: 5px; 351 | } 352 | .marketing p { 353 | font-size: 16px; 354 | line-height: 1.5; 355 | } 356 | .marketing .marketing-byline { 357 | margin-bottom: 40px; 358 | font-size: 20px; 359 | font-weight: 300; 360 | line-height: 1.25; 361 | color: #999; 362 | } 363 | .marketing-img { 364 | display: block; 365 | margin: 0 auto 30px; 366 | max-height: 145px; 367 | } 368 | 369 | 370 | 371 | /* Footer 372 | -------------------------------------------------- */ 373 | 374 | .footer { 375 | text-align: center; 376 | padding: 30px 0; 377 | margin-top: 70px; 378 | border-top: 1px solid #e5e5e5; 379 | background-color: #f5f5f5; 380 | } 381 | .footer p { 382 | margin-bottom: 0; 383 | color: #777; 384 | } 385 | .footer-links { 386 | margin: 10px 0; 387 | } 388 | .footer-links li { 389 | display: inline; 390 | padding: 0 2px; 391 | } 392 | .footer-links li:first-child { 393 | padding-left: 0; 394 | } 395 | 396 | 397 | 398 | /* Special grid styles 399 | -------------------------------------------------- */ 400 | 401 | .show-grid { 402 | margin-top: 10px; 403 | margin-bottom: 20px; 404 | } 405 | .show-grid [class*="span"] { 406 | background-color: #eee; 407 | text-align: center; 408 | -webkit-border-radius: 3px; 409 | -moz-border-radius: 3px; 410 | border-radius: 3px; 411 | min-height: 40px; 412 | line-height: 40px; 413 | } 414 | .show-grid [class*="span"]:hover { 415 | background-color: #ddd; 416 | } 417 | .show-grid .show-grid { 418 | margin-top: 0; 419 | margin-bottom: 0; 420 | } 421 | .show-grid .show-grid [class*="span"] { 422 | margin-top: 5px; 423 | } 424 | .show-grid [class*="span"] [class*="span"] { 425 | background-color: #ccc; 426 | } 427 | .show-grid [class*="span"] [class*="span"] [class*="span"] { 428 | background-color: #999; 429 | } 430 | 431 | 432 | 433 | /* Mini layout previews 434 | -------------------------------------------------- */ 435 | .mini-layout { 436 | border: 1px solid #ddd; 437 | -webkit-border-radius: 6px; 438 | -moz-border-radius: 6px; 439 | border-radius: 6px; 440 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.075); 441 | -moz-box-shadow: 0 1px 2px rgba(0,0,0,.075); 442 | box-shadow: 0 1px 2px rgba(0,0,0,.075); 443 | } 444 | .mini-layout, 445 | .mini-layout .mini-layout-body, 446 | .mini-layout.fluid .mini-layout-sidebar { 447 | height: 300px; 448 | } 449 | .mini-layout { 450 | margin-bottom: 20px; 451 | padding: 9px; 452 | } 453 | .mini-layout div { 454 | -webkit-border-radius: 3px; 455 | -moz-border-radius: 3px; 456 | border-radius: 3px; 457 | } 458 | .mini-layout .mini-layout-body { 459 | background-color: #dceaf4; 460 | margin: 0 auto; 461 | width: 70%; 462 | } 463 | .mini-layout.fluid .mini-layout-sidebar, 464 | .mini-layout.fluid .mini-layout-header, 465 | .mini-layout.fluid .mini-layout-body { 466 | float: left; 467 | } 468 | .mini-layout.fluid .mini-layout-sidebar { 469 | background-color: #bbd8e9; 470 | width: 20%; 471 | } 472 | .mini-layout.fluid .mini-layout-body { 473 | width: 77.5%; 474 | margin-left: 2.5%; 475 | } 476 | 477 | 478 | 479 | /* Download page 480 | -------------------------------------------------- */ 481 | 482 | .download .page-header { 483 | margin-top: 36px; 484 | } 485 | .page-header .toggle-all { 486 | margin-top: 5px; 487 | } 488 | 489 | /* Space out h3s when following a section */ 490 | .download h3 { 491 | margin-bottom: 5px; 492 | } 493 | .download-builder input + h3, 494 | .download-builder .checkbox + h3 { 495 | margin-top: 9px; 496 | } 497 | 498 | /* Fields for variables */ 499 | .download-builder input[type=text] { 500 | margin-bottom: 9px; 501 | font-family: Menlo, Monaco, "Courier New", monospace; 502 | font-size: 12px; 503 | color: #d14; 504 | } 505 | .download-builder input[type=text]:focus { 506 | background-color: #fff; 507 | } 508 | 509 | /* Custom, larger checkbox labels */ 510 | .download .checkbox { 511 | padding: 6px 10px 6px 25px; 512 | font-size: 13px; 513 | line-height: 18px; 514 | color: #555; 515 | background-color: #f9f9f9; 516 | -webkit-border-radius: 3px; 517 | -moz-border-radius: 3px; 518 | border-radius: 3px; 519 | cursor: pointer; 520 | } 521 | .download .checkbox:hover { 522 | color: #333; 523 | background-color: #f5f5f5; 524 | } 525 | .download .checkbox small { 526 | font-size: 12px; 527 | color: #777; 528 | } 529 | 530 | /* Variables section */ 531 | #variables label { 532 | margin-bottom: 0; 533 | } 534 | 535 | /* Giant download button */ 536 | .download-btn { 537 | margin: 36px 0 108px; 538 | } 539 | #download p, 540 | #download h4 { 541 | max-width: 50%; 542 | margin: 0 auto; 543 | color: #999; 544 | text-align: center; 545 | } 546 | #download h4 { 547 | margin-bottom: 0; 548 | } 549 | #download p { 550 | margin-bottom: 18px; 551 | } 552 | .download-btn .btn { 553 | display: block; 554 | width: auto; 555 | padding: 19px 24px; 556 | margin-bottom: 27px; 557 | font-size: 30px; 558 | line-height: 1; 559 | text-align: center; 560 | -webkit-border-radius: 6px; 561 | -moz-border-radius: 6px; 562 | border-radius: 6px; 563 | } 564 | 565 | 566 | 567 | /* Misc 568 | -------------------------------------------------- */ 569 | 570 | /* Make tables spaced out a bit more */ 571 | h2 + table, 572 | h3 + table, 573 | h4 + table, 574 | h2 + .row { 575 | margin-top: 5px; 576 | } 577 | 578 | /* Example sites showcase */ 579 | .example-sites { 580 | xmargin-left: 20px; 581 | } 582 | .example-sites img { 583 | max-width: 100%; 584 | margin: 0 auto; 585 | } 586 | 587 | .scrollspy-example { 588 | height: 200px; 589 | overflow: auto; 590 | position: relative; 591 | } 592 | 593 | 594 | /* Fake the :focus state to demo it */ 595 | .focused { 596 | border-color: rgba(82,168,236,.8); 597 | -webkit-box-shadow: inset 0 1px 3px rgba(0,0,0,.1), 0 0 8px rgba(82,168,236,.6); 598 | -moz-box-shadow: inset 0 1px 3px rgba(0,0,0,.1), 0 0 8px rgba(82,168,236,.6); 599 | box-shadow: inset 0 1px 3px rgba(0,0,0,.1), 0 0 8px rgba(82,168,236,.6); 600 | outline: 0; 601 | } 602 | 603 | /* For input sizes, make them display block */ 604 | .docs-input-sizes select, 605 | .docs-input-sizes input[type=text] { 606 | display: block; 607 | margin-bottom: 9px; 608 | } 609 | 610 | /* Icons 611 | ------------------------- */ 612 | .the-icons { 613 | margin-left: 0; 614 | list-style: none; 615 | } 616 | .the-icons li { 617 | float: left; 618 | width: 25%; 619 | line-height: 25px; 620 | } 621 | .the-icons i:hover { 622 | background-color: rgba(255,0,0,.25); 623 | } 624 | 625 | /* Example page 626 | ------------------------- */ 627 | .bootstrap-examples h4 { 628 | margin: 10px 0 5px; 629 | } 630 | .bootstrap-examples p { 631 | font-size: 13px; 632 | line-height: 18px; 633 | } 634 | .bootstrap-examples .thumbnail { 635 | margin-bottom: 9px; 636 | background-color: #fff; 637 | } 638 | 639 | 640 | 641 | /* Bootstrap code examples 642 | -------------------------------------------------- */ 643 | 644 | /* Base class */ 645 | .bs-docs-example { 646 | position: relative; 647 | margin: 15px 0; 648 | padding: 39px 19px 14px; 649 | *padding-top: 19px; 650 | background-color: #fff; 651 | border: 1px solid #ddd; 652 | -webkit-border-radius: 4px; 653 | -moz-border-radius: 4px; 654 | border-radius: 4px; 655 | } 656 | 657 | /* Echo out a label for the example */ 658 | .bs-docs-example:after { 659 | content: "Example"; 660 | position: absolute; 661 | top: -1px; 662 | left: -1px; 663 | padding: 3px 7px; 664 | font-size: 12px; 665 | font-weight: bold; 666 | background-color: #f5f5f5; 667 | border: 1px solid #ddd; 668 | color: #9da0a4; 669 | -webkit-border-radius: 4px 0 4px 0; 670 | -moz-border-radius: 4px 0 4px 0; 671 | border-radius: 4px 0 4px 0; 672 | } 673 | 674 | /* Remove spacing between an example and it's code */ 675 | .bs-docs-example + .prettyprint { 676 | margin-top: -20px; 677 | padding-top: 15px; 678 | } 679 | 680 | /* Tweak examples 681 | ------------------------- */ 682 | .bs-docs-example > p:last-child { 683 | margin-bottom: 0; 684 | } 685 | .bs-docs-example .table, 686 | .bs-docs-example .progress, 687 | .bs-docs-example .well, 688 | .bs-docs-example .alert, 689 | .bs-docs-example .hero-unit, 690 | .bs-docs-example .pagination, 691 | .bs-docs-example .navbar, 692 | .bs-docs-example > .nav, 693 | .bs-docs-example blockquote { 694 | margin-bottom: 5px; 695 | } 696 | .bs-docs-example .pagination { 697 | margin-top: 0; 698 | } 699 | .bs-navbar-top-example, 700 | .bs-navbar-bottom-example { 701 | z-index: 1; 702 | padding: 0; 703 | height: 90px; 704 | overflow: hidden; /* cut the drop shadows off */ 705 | } 706 | .bs-navbar-top-example .navbar-fixed-top, 707 | .bs-navbar-bottom-example .navbar-fixed-bottom { 708 | margin-left: 0; 709 | margin-right: 0; 710 | } 711 | .bs-navbar-top-example { 712 | -webkit-border-radius: 0 0 4px 4px; 713 | -moz-border-radius: 0 0 4px 4px; 714 | border-radius: 0 0 4px 4px; 715 | } 716 | .bs-navbar-top-example:after { 717 | top: auto; 718 | bottom: -1px; 719 | -webkit-border-radius: 0 4px 0 4px; 720 | -moz-border-radius: 0 4px 0 4px; 721 | border-radius: 0 4px 0 4px; 722 | } 723 | .bs-navbar-bottom-example { 724 | -webkit-border-radius: 4px 4px 0 0; 725 | -moz-border-radius: 4px 4px 0 0; 726 | border-radius: 4px 4px 0 0; 727 | } 728 | .bs-navbar-bottom-example .navbar { 729 | margin-bottom: 0; 730 | } 731 | form.bs-docs-example { 732 | padding-bottom: 19px; 733 | } 734 | 735 | /* Images */ 736 | .bs-docs-example-images img { 737 | margin: 10px; 738 | display: inline-block; 739 | } 740 | 741 | /* Tooltips */ 742 | .bs-docs-tooltip-examples { 743 | text-align: center; 744 | margin: 0 0 10px; 745 | list-style: none; 746 | } 747 | .bs-docs-tooltip-examples li { 748 | display: inline; 749 | padding: 0 10px; 750 | } 751 | 752 | /* Popovers */ 753 | .bs-docs-example-popover { 754 | padding-bottom: 24px; 755 | background-color: #f9f9f9; 756 | } 757 | .bs-docs-example-popover .popover { 758 | position: relative; 759 | display: block; 760 | float: left; 761 | width: 260px; 762 | margin: 20px; 763 | } 764 | 765 | /* Dropdowns */ 766 | .bs-docs-example-submenus { 767 | min-height: 180px; 768 | } 769 | .bs-docs-example-submenus > .pull-left + .pull-left { 770 | margin-left: 20px; 771 | } 772 | .bs-docs-example-submenus .dropup > .dropdown-menu, 773 | .bs-docs-example-submenus .dropdown > .dropdown-menu { 774 | display: block; 775 | position: static; 776 | margin-bottom: 5px; 777 | *width: 180px; 778 | } 779 | 780 | 781 | 782 | /* Responsive docs 783 | -------------------------------------------------- */ 784 | 785 | /* Utility classes table 786 | ------------------------- */ 787 | .responsive-utilities th small { 788 | display: block; 789 | font-weight: normal; 790 | color: #999; 791 | } 792 | .responsive-utilities tbody th { 793 | font-weight: normal; 794 | } 795 | .responsive-utilities td { 796 | text-align: center; 797 | } 798 | .responsive-utilities td.is-visible { 799 | color: #468847; 800 | background-color: #dff0d8 !important; 801 | } 802 | .responsive-utilities td.is-hidden { 803 | color: #ccc; 804 | background-color: #f9f9f9 !important; 805 | } 806 | 807 | /* Responsive tests 808 | ------------------------- */ 809 | .responsive-utilities-test { 810 | margin-top: 5px; 811 | margin-left: 0; 812 | list-style: none; 813 | overflow: hidden; /* clear floats */ 814 | } 815 | .responsive-utilities-test li { 816 | position: relative; 817 | float: left; 818 | width: 25%; 819 | height: 43px; 820 | font-size: 14px; 821 | font-weight: bold; 822 | line-height: 43px; 823 | color: #999; 824 | text-align: center; 825 | border: 1px solid #ddd; 826 | -webkit-border-radius: 4px; 827 | -moz-border-radius: 4px; 828 | border-radius: 4px; 829 | } 830 | .responsive-utilities-test li + li { 831 | margin-left: 10px; 832 | } 833 | .responsive-utilities-test span { 834 | position: absolute; 835 | top: -1px; 836 | left: -1px; 837 | right: -1px; 838 | bottom: -1px; 839 | -webkit-border-radius: 4px; 840 | -moz-border-radius: 4px; 841 | border-radius: 4px; 842 | } 843 | .responsive-utilities-test span { 844 | color: #468847; 845 | background-color: #dff0d8; 846 | border: 1px solid #d6e9c6; 847 | } 848 | 849 | 850 | 851 | /* Sidenav for Docs 852 | -------------------------------------------------- */ 853 | 854 | .bs-docs-sidenav { 855 | width: 228px; 856 | margin: 30px 0 0; 857 | padding: 0; 858 | background-color: #fff; 859 | -webkit-border-radius: 6px; 860 | -moz-border-radius: 6px; 861 | border-radius: 6px; 862 | -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065); 863 | -moz-box-shadow: 0 1px 4px rgba(0,0,0,.065); 864 | box-shadow: 0 1px 4px rgba(0,0,0,.065); 865 | } 866 | .bs-docs-sidenav > li > a { 867 | display: block; 868 | width: 190px \9; 869 | margin: 0 0 -1px; 870 | padding: 8px 14px; 871 | border: 1px solid #e5e5e5; 872 | } 873 | .bs-docs-sidenav > li:first-child > a { 874 | -webkit-border-radius: 6px 6px 0 0; 875 | -moz-border-radius: 6px 6px 0 0; 876 | border-radius: 6px 6px 0 0; 877 | } 878 | .bs-docs-sidenav > li:last-child > a { 879 | -webkit-border-radius: 0 0 6px 6px; 880 | -moz-border-radius: 0 0 6px 6px; 881 | border-radius: 0 0 6px 6px; 882 | } 883 | .bs-docs-sidenav > .active > a { 884 | position: relative; 885 | z-index: 2; 886 | padding: 9px 15px; 887 | border: 0; 888 | text-shadow: 0 1px 0 rgba(0,0,0,.15); 889 | -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 890 | -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 891 | box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1); 892 | } 893 | /* Chevrons */ 894 | .bs-docs-sidenav .glyphicon-chevron-right { 895 | float: right; 896 | margin-top: 2px; 897 | margin-right: -6px; 898 | opacity: .25; 899 | } 900 | .bs-docs-sidenav > li > a:hover { 901 | background-color: #f5f5f5; 902 | } 903 | .bs-docs-sidenav a:hover .glyphicon-chevron-right { 904 | opacity: .5; 905 | } 906 | .bs-docs-sidenav .active .glyphicon-chevron-right, 907 | .bs-docs-sidenav .active a:hover .glyphicon-chevron-right { 908 | background-image: url(../img/glyphicons-halflings-white.png); 909 | opacity: 1; 910 | } 911 | .bs-docs-sidenav.affix { 912 | top: 40px; 913 | } 914 | .bs-docs-sidenav.affix-bottom { 915 | position: absolute; 916 | top: auto; 917 | bottom: 270px; 918 | } 919 | 920 | 921 | 922 | 923 | /* Responsive 924 | -------------------------------------------------- */ 925 | 926 | /* Desktop large 927 | ------------------------- */ 928 | @media (min-width: 1200px) { 929 | .bs-docs-container { 930 | max-width: 970px; 931 | } 932 | .bs-docs-sidenav { 933 | width: 258px; 934 | } 935 | .bs-docs-sidenav > li > a { 936 | width: 230px \9; /* Override the previous IE8-9 hack */ 937 | } 938 | } 939 | 940 | /* Desktop 941 | ------------------------- */ 942 | @media (max-width: 980px) { 943 | /* Unfloat brand */ 944 | body > .navbar-fixed-top .brand { 945 | float: left; 946 | margin-left: 0; 947 | padding-left: 10px; 948 | padding-right: 10px; 949 | } 950 | 951 | /* Inline-block quick links for more spacing */ 952 | .quick-links li { 953 | display: inline-block; 954 | margin: 5px; 955 | } 956 | 957 | /* When affixed, space properly */ 958 | .bs-docs-sidenav { 959 | top: 0; 960 | width: 218px; 961 | margin-top: 30px; 962 | margin-right: 0; 963 | } 964 | } 965 | 966 | /* Tablet to desktop 967 | ------------------------- */ 968 | @media (min-width: 768px) and (max-width: 979px) { 969 | /* Remove any padding from the body */ 970 | body { 971 | padding-top: 0; 972 | } 973 | /* Widen masthead and social buttons to fill body padding */ 974 | .jumbotron { 975 | margin-top: -20px; /* Offset bottom margin on .navbar */ 976 | } 977 | /* Adjust sidenav width */ 978 | .bs-docs-sidenav { 979 | width: 166px; 980 | margin-top: 20px; 981 | } 982 | .bs-docs-sidenav.affix { 983 | top: 0; 984 | } 985 | } 986 | 987 | /* Tablet 988 | ------------------------- */ 989 | @media (max-width: 767px) { 990 | /* Remove any padding from the body */ 991 | body { 992 | padding-top: 0; 993 | } 994 | 995 | /* Widen masthead and social buttons to fill body padding */ 996 | .jumbotron { 997 | padding: 40px 20px; 998 | margin-top: -20px; /* Offset bottom margin on .navbar */ 999 | margin-right: -20px; 1000 | margin-left: -20px; 1001 | } 1002 | .masthead h1 { 1003 | font-size: 90px; 1004 | } 1005 | .masthead p, 1006 | .masthead .btn { 1007 | font-size: 24px; 1008 | } 1009 | .marketing .span4 { 1010 | margin-bottom: 40px; 1011 | } 1012 | .bs-docs-social { 1013 | margin: 0 -20px; 1014 | } 1015 | 1016 | /* Space out the show-grid examples */ 1017 | .show-grid [class*="span"] { 1018 | margin-bottom: 5px; 1019 | } 1020 | 1021 | /* Sidenav */ 1022 | .bs-docs-sidenav { 1023 | width: auto; 1024 | margin-bottom: 20px; 1025 | } 1026 | .bs-docs-sidenav.affix { 1027 | position: static; 1028 | width: auto; 1029 | top: 0; 1030 | } 1031 | 1032 | /* Unfloat the back to top link in footer */ 1033 | .footer { 1034 | margin-left: -20px; 1035 | margin-right: -20px; 1036 | padding-left: 20px; 1037 | padding-right: 20px; 1038 | } 1039 | .footer p { 1040 | margin-bottom: 9px; 1041 | } 1042 | } 1043 | 1044 | /* Landscape phones 1045 | ------------------------- */ 1046 | @media (max-width: 480px) { 1047 | /* Remove padding above jumbotron */ 1048 | body { 1049 | padding-top: 0; 1050 | } 1051 | 1052 | /* Change up some type stuff */ 1053 | h2 small { 1054 | display: block; 1055 | } 1056 | 1057 | /* Downsize the jumbotrons */ 1058 | .jumbotron h1 { 1059 | font-size: 45px; 1060 | } 1061 | .jumbotron p, 1062 | .jumbotron .btn { 1063 | font-size: 18px; 1064 | } 1065 | .jumbotron .btn { 1066 | display: block; 1067 | margin: 0 auto; 1068 | } 1069 | 1070 | /* center align subhead text like the masthead */ 1071 | .subhead h1, 1072 | .subhead p { 1073 | text-align: center; 1074 | } 1075 | 1076 | /* Marketing on home */ 1077 | .marketing h1 { 1078 | font-size: 30px; 1079 | } 1080 | .marketing-byline { 1081 | font-size: 18px; 1082 | } 1083 | 1084 | /* center example sites */ 1085 | .example-sites { 1086 | margin-left: 0; 1087 | } 1088 | .example-sites > li { 1089 | float: none; 1090 | display: block; 1091 | max-width: 280px; 1092 | margin: 0 auto 18px; 1093 | text-align: center; 1094 | } 1095 | .example-sites .thumbnail > img { 1096 | max-width: 270px; 1097 | } 1098 | 1099 | /* Do our best to make tables work in narrow viewports */ 1100 | table code { 1101 | white-space: normal; 1102 | word-wrap: break-word; 1103 | word-break: break-all; 1104 | } 1105 | 1106 | /* Examples: dropdowns */ 1107 | .bs-docs-example-submenus > .pull-left { 1108 | float: none; 1109 | clear: both; 1110 | } 1111 | .bs-docs-example-submenus > .pull-left, 1112 | .bs-docs-example-submenus > .pull-left + .pull-left { 1113 | margin-left: 0; 1114 | } 1115 | .bs-docs-example-submenus p { 1116 | margin-bottom: 0; 1117 | } 1118 | .bs-docs-example-submenus .dropup > .dropdown-menu, 1119 | .bs-docs-example-submenus .dropdown > .dropdown-menu { 1120 | margin-bottom: 10px; 1121 | float: none; 1122 | max-width: 180px; 1123 | } 1124 | 1125 | /* Examples: modal */ 1126 | .modal-example .modal { 1127 | position: relative; 1128 | top: auto; 1129 | right: auto; 1130 | bottom: auto; 1131 | left: auto; 1132 | } 1133 | 1134 | /* Tighten up footer */ 1135 | .footer { 1136 | padding-top: 20px; 1137 | padding-bottom: 20px; 1138 | } 1139 | } 1140 | -------------------------------------------------------------------------------- /examples/css/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .prettyprint .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 20px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /examples/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/billpull/knockout-bootstrap/85f16c81107fbaa13f612b1f1968e435bff563b3/examples/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /examples/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/billpull/knockout-bootstrap/85f16c81107fbaa13f612b1f1968e435bff563b3/examples/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /examples/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/billpull/knockout-bootstrap/85f16c81107fbaa13f612b1f1968e435bff563b3/examples/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /examples/img/bs-docs-masthead-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/billpull/knockout-bootstrap/85f16c81107fbaa13f612b1f1968e435bff563b3/examples/img/bs-docs-masthead-pattern.png -------------------------------------------------------------------------------- /examples/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/billpull/knockout-bootstrap/85f16c81107fbaa13f612b1f1968e435bff563b3/examples/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /examples/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/billpull/knockout-bootstrap/85f16c81107fbaa13f612b1f1968e435bff563b3/examples/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |Create rich two way interactions with Bootstrap and Knockout bindings 49 |
72 | Knockout-bootstrap is a set of custom knockout binding handlers that provide access 73 | to Bootstrap javascript widgets. 74 |
75 |76 |
data-bind
attributeTight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. 95 |
96 |98 | <a href="#" data-bind="tooltip: {title: 'Default tooltip'}">you probably</a> 99 | <a href="#" data-bind="tooltip: {title: 'Another tooltip', placement: 'right'}">have a</a> 100 |101 |
Name | 106 |type | 107 |default | 108 |description | 109 |
---|---|---|---|
placement | 114 |string | function | 115 |'top' | 116 |how to position the tooltip - top | bottom | left | right | 117 |
title | 120 |string | function | 121 |'' | 122 |default title value if `title` tag isn't present | 123 |
trigger | 126 |string | 127 |'hover focus' | 128 |how tooltip is triggered - click | hover | focus | manual. Note you case pass trigger mutliple, space seperated, trigger types. | 129 |
140 | Takes text content from a template and puts it in a popover 141 |
142 |150 | <button class="btn" data-bind="popover: {template: 'popoverTemplate', options: {title: 'Oh Yea'}}"> 151 | Launch Simple Popover 152 | </button> 153 | 154 | <script type="text/html" id="popoverTemplate"> 155 | <button class="close pull-right" type="button" data-dismiss="popover">×</button> 156 | Hey I am some content in A popover 157 | </script> 158 |159 |
161 | Manipulate data from within a popover 162 |
163 |168 | <h1 data-bind="text: popoverBindingHeader"></h1> 169 | <button class="btn" data-bind="popover: {template: 'popoverBindingTemplate', options: {title: 'Oh Yea Binding'}}"> 170 | Launch Binding Popover 171 | </button> 172 | 173 | <script type="text/html" id="popoverBindingTemplate"> 174 | <button class="close pull-right" type="button" data-dismiss="popover">×</button> 175 | <form> 176 | <label>Popover Binding Header</label> 177 | <input type="text" data-bind="value: popoverBindingHeader, valueUpdate:'afterkeydown'" /> 178 | <strong>Foreach binding:</strong> 179 | <table class="table table-striped"> 180 | <tbody data-bind="foreach: colors"> 181 | <tr><td><span data-bind="text: $data"></span></td></tr> 182 | </tbody> 183 | </table> 184 | </form> 185 | </script> 186 |187 |
Name | 192 |type | 193 |default | 194 |description | 195 |
---|---|---|---|
options | 200 |object | 201 |{title: 'Popover'} | 202 |refer to official documentation for options. | 203 |
template | 206 |string | 207 |'' | 208 |the id to the template for the content | 209 |
data | 212 |string | function | 213 |'' | 214 |the data for the template | 215 |
230 | <!-- View Code --> 231 | <div data-bind="foreach: alerts"> 232 | <div data-bind="alert: $data"></div> 233 | </div> 234 | 235 | <!-- View Model --> 236 | var ViewModel = function() { 237 | //.... 238 | //... 239 | self.alerts = ko.observableArray([ 240 | {'message': 'Here is an Error', 'priority': 'error'}, 241 | {'message': 'Here is a Warning', 'priority': 'warning'}, 242 | {'message': 'Here is a Success', 'priority': 'success'}, 243 | {'message': 'Here is some Info', 'priority': 'info'} 244 | ]); 245 | //.... 246 | //... 247 | }; 248 |249 | 250 |
Name | 255 |type | 256 |default | 257 |description | 258 |
---|---|---|---|
message | 263 |string | 264 |'' | 265 |The message to be displayed in the alert | 266 |
priority | 269 |string | 270 |'' | 271 |The priority of the alert - error | warning | success | info | 272 |
289 | <!-- View Code --> 290 | <form> 291 | <label>Update Progress Value Observable</label> 292 | <input type="text" data-bind="value: progressVal, valueUpdate:'afterkeydown'" /> 293 | </form> 294 | <div data-bind="progress: 'progressWidth'"></div> 295 | 296 | <!-- View Model --> 297 | var ViewModel = function() { 298 | //.... 299 | //... 300 | self.progressVal = ko.observable(10); 301 | self.progressWidth = ko.computed(function(){ 302 | return self.progressVal() + '%'; 303 | }, self); 304 | //.... 305 | //... 306 | }; 307 |308 |
Name | 313 |type | 314 |default | 315 |description | 316 |
---|---|---|---|
width computed | 321 |string | 322 |'' | 323 |the name of the computed observable that returns the width percentage | 324 |
334 | Typeahead input with a data source as an observable array. Pass a reference
335 | to the data-bind="typeahead:"
binding and the items from that observable
336 | array will be shown as suggestions in the input box. To show the binding nature of this
337 | feature the example allows you to add and remove items from the array.
338 |
364 | <!-- View Code --> 365 | <div class="row"> 366 | <div class="col-md-4"> 367 | <form> 368 | <label>Javascript Frameworks</label> 369 | <input type="text" data-bind="typeahead: jsFrameworks" /> 370 | </form> 371 | <form data-bind="submit: addFramework"> 372 | <label>Add a framework</label> 373 | <input type="text" data-bind="value: frameworkToAdd, valueUpdate:'afterkeydown'" /> 374 | <div class="form-actions"> 375 | <button class="btn btn-default" type="submit" data-bind="enable: frameworkToAdd().length > 0">Add</button> 376 | </div> 377 | </form> 378 | </div> 379 | <div class="well col-md-4"> 380 | <ul class="nav nav-list" data-bind="foreach: jsFrameworks"> 381 | <li> 382 | <span data-bind="text: $data"></span> 383 | <span class="glyphicon glyphicon-remove" data-bind="click: $root.removeFramework"></span> 384 | </li> 385 | </ul> 386 | </div> 387 | </div> 388 | 389 | <!-- View Model --> 390 | var ViewModel = function() { 391 | //.... 392 | //... 393 | self.jsFrameworks = ko.observableArray([ 394 | 'Angular', 395 | 'Canjs', 396 | 'Batman', 397 | //... 398 | ]); 399 | 400 | self.frameworkToAdd = ko.observable(""); 401 | self.addFramework = function() { 402 | self.jsFrameworks.push(self.frameworkToAdd()); 403 | }; 404 | 405 | self.removeFramework = function(framework) { 406 | self.jsFrameworks.remove(framework); 407 | }; 408 | //.... 409 | //... 410 | }; 411 |412 |
Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.
417 |420 | 421 |
422 |443 | <!-- View Code --> 444 | <p data-bind="text: modalBindingBody"></p> 445 | <div class="row"> 446 | <div class="col-md-4"> 447 | <button class="btn btn-lg btn-primary" data-bind="modal: {template: 'modalBindingTemplateLive'}">Change Text Live</button> 448 | </div> 449 | <div class="col-md-4"> 450 | <button class="btn btn-lg btn-primary" data-bind="modal: {template: 'modalBindingTemplateSave', openModal: openModal}">Change Text on Save</button> 451 | </div> 452 | </div> 453 | <br /> 454 | <div class="row"> 455 | <div class="col-md-4"> 456 | <button class="btn btn-lg btn-primary" data-bind="modal: {template: 'modalSmallBindingTemplate', data: {modalBindingHeader: modalBindingHeader, body: 'Small Modal'} }">Small Modal</button> 457 | </div> 458 | <div class="col-md-4"> 459 | <button class="btn btn-lg btn-primary" data-bind="modal: {template: 'modalLargeBindingTemplate', data: {modalBindingHeader: modalBindingHeader, body: 'Large Modal'} }">Large Modal</button> 460 | </div> 461 | </div> 462 | 463 | <!-- Model Code --> 464 | var ViewModel = function() { 465 | //.... 466 | //... 467 | self.modalBindingHeader = ko.observable('Binding in A Modal'); 468 | self.modalBindingBody = ko.observable('Gotta love data binding!!.'); 469 | self.modalBindingTemp = ko.observable(); 470 | self.openModal = function() { 471 | self.modalBindingTemp(self.modalBindingBody()); 472 | }; 473 | self.saveChange = function() { 474 | self.modalBindingBody(self.modalBindingTemp()); 475 | }; 476 | //.... 477 | //... 478 | } 479 |480 |
Name | 485 |type | 486 |default | 487 |description | 488 |
---|---|---|---|
options | 493 |object | 494 |{show: false} | 495 |refer to official documentation for options. | 496 |
template | 499 |string | 500 |'' | 501 |the id to the template for the content | 502 |
data | 505 |string | function | 506 |'' | 507 |the data for the template | 508 |
openModal | 511 |function | 512 |'' | 513 |function to execute when modal is opened. | 514 |