mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-02 16:04:07 +03:00
Merge branch '3.0.0-wip' into bs3_homepage
This commit is contained in:
+130
-94
@@ -55,6 +55,10 @@ body {
|
||||
|
||||
.bs-docs-nav {
|
||||
background-color: #563d7c;
|
||||
border-color: #463265;
|
||||
}
|
||||
.bs-docs-nav .navbar-collapse {
|
||||
border-color: #463265;
|
||||
}
|
||||
.bs-docs-nav .navbar-brand {
|
||||
color: #fff;
|
||||
@@ -127,8 +131,8 @@ body {
|
||||
|
||||
/* Download button */
|
||||
.bs-masthead .btn-outline {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
padding: 18px 24px;
|
||||
font-size: 21px;
|
||||
}
|
||||
@@ -178,6 +182,7 @@ body {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.bs-customizer input[type="text"] {
|
||||
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
.bs-customizer .help-block {
|
||||
@@ -188,6 +193,10 @@ body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#less-section label {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Docs pages and sections
|
||||
@@ -213,7 +222,7 @@ body {
|
||||
}
|
||||
|
||||
.bs-docs-section + .bs-docs-section {
|
||||
margin-top: 80px;
|
||||
padding-top: 80px;
|
||||
}
|
||||
|
||||
/* Ads in page headers */
|
||||
@@ -343,6 +352,17 @@ body {
|
||||
}
|
||||
|
||||
|
||||
/* Examples grid
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-examples h4 {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-examples p {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Special grid styles
|
||||
-------------------------------------------------- */
|
||||
@@ -368,7 +388,7 @@ body {
|
||||
.bs-example {
|
||||
position: relative;
|
||||
padding: 45px 15px 15px;
|
||||
margin: 0 -15px -1px;
|
||||
margin: 0 -15px 15px;
|
||||
background-color: #fafafa;
|
||||
box-shadow: inset 0 3px 6px rgba(0,0,0,.05);
|
||||
border-color: #e5e5e5 #eee #eee;
|
||||
@@ -389,11 +409,10 @@ body {
|
||||
}
|
||||
|
||||
/* Tweak display of the examples */
|
||||
.bs-example + .prettyprint,
|
||||
.bs-example + .highlight {
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
margin: -15px -15px 15px;
|
||||
border-radius: 0;
|
||||
border-width: 0 0 1px;
|
||||
}
|
||||
|
||||
/* Tweak content of examples for optimum awesome */
|
||||
@@ -401,16 +420,15 @@ body {
|
||||
.bs-example > ul:last-child,
|
||||
.bs-example > ol:last-child,
|
||||
.bs-example > blockquote:last-child,
|
||||
.bs-example > input:last-child,
|
||||
.bs-example > select:last-child,
|
||||
.bs-example > textarea:last-child,
|
||||
.bs-example > .form-control:last-child,
|
||||
.bs-example > .table:last-child,
|
||||
.bs-example > .navbar:last-child
|
||||
.bs-example > .jumbotron:last-child,
|
||||
.bs-example > .alert:last-child,
|
||||
.bs-example > .panel:last-child,
|
||||
.bs-example > .list-group:last-child,
|
||||
.bs-example > .well:last-child {
|
||||
.bs-example > .well:last-child,
|
||||
.bs-example > .progress:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bs-example > p > .close {
|
||||
@@ -418,17 +436,15 @@ body {
|
||||
}
|
||||
|
||||
/* Typography */
|
||||
.bs-example-type .table td {
|
||||
.bs-example-type .table td:last-child {
|
||||
color: #999;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.bs-example-type .table td,
|
||||
.bs-example-type .table th {
|
||||
.bs-example-type .table td {
|
||||
padding: 15px 0;
|
||||
border-color: #eee;
|
||||
}
|
||||
.bs-example-type .table tr:first-child td,
|
||||
.bs-example-type .table tr:first-child th {
|
||||
.bs-example-type .table tr:first-child td {
|
||||
border-top: 0;
|
||||
}
|
||||
.bs-example-type h1,
|
||||
@@ -440,12 +456,24 @@ body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.bs-example.form-inline select,
|
||||
.bs-example.form-inline input[type="text"],
|
||||
.bs-example.form-inline input[type="password"] {
|
||||
width: 180px;
|
||||
/* Images */
|
||||
.bs-example > .img-circle,
|
||||
.bs-example > .img-rounded,
|
||||
.bs-example > .img-thumbnail {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.bs-example > .btn,
|
||||
.bs-example > .btn-group {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-example > .btn-toolbar + .btn-toolbar {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.bs-example-control-sizing select,
|
||||
.bs-example-control-sizing input[type="text"] + input[type="text"] {
|
||||
margin-top: 10px;
|
||||
@@ -453,6 +481,9 @@ body {
|
||||
.bs-example-form .input-group {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.bs-example > textarea.form-control {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/* List groups */
|
||||
.bs-example > .list-group {
|
||||
@@ -467,7 +498,6 @@ body {
|
||||
.bs-navbar-bottom-example {
|
||||
z-index: 1;
|
||||
padding: 0;
|
||||
min-height: 110px;
|
||||
overflow: hidden; /* cut the drop shadows off */
|
||||
}
|
||||
.bs-navbar-top-example .navbar-fixed-top,
|
||||
@@ -476,33 +506,35 @@ body {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
.bs-navbar-top-example .navbar-fixed-top {
|
||||
top: -1px;
|
||||
}
|
||||
.bs-navbar-bottom-example .navbar-fixed-bottom {
|
||||
bottom: -1px;
|
||||
}
|
||||
.bs-navbar-top-example {
|
||||
-webkit-border-radius: 0 0 4px 4px;
|
||||
-moz-border-radius: 0 0 4px 4px;
|
||||
border-radius: 0 0 4px 4px;
|
||||
padding-bottom: 45px;
|
||||
}
|
||||
.bs-navbar-top-example:after {
|
||||
top: auto;
|
||||
bottom: 15px;
|
||||
-webkit-border-radius: 0 4px 0 4px;
|
||||
-moz-border-radius: 0 4px 0 4px;
|
||||
border-radius: 0 4px 0 4px;
|
||||
}
|
||||
.bs-navbar-top-example .navbar-fixed-top {
|
||||
top: -1px;
|
||||
}
|
||||
.bs-navbar-bottom-example {
|
||||
-webkit-border-radius: 4px 4px 0 0;
|
||||
-moz-border-radius: 4px 4px 0 0;
|
||||
border-radius: 4px 4px 0 0;
|
||||
padding-top: 45px;
|
||||
}
|
||||
.bs-navbar-bottom-example .navbar-fixed-bottom {
|
||||
bottom: -1px;
|
||||
}
|
||||
.bs-navbar-bottom-example .navbar {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bs-navbar-top-example {
|
||||
border-radius: 0 0 4px 4px;
|
||||
}
|
||||
.bs-navbar-bottom-example {
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Example modals */
|
||||
.bs-example-modal {
|
||||
background-color: #f5f5f5;
|
||||
@@ -523,19 +555,11 @@ body {
|
||||
}
|
||||
|
||||
/* Example dropdowns */
|
||||
.bs-example > .dropdown > .dropdown-menu,
|
||||
.bs-example-submenu > .pull-left > .dropup > .dropdown-menu,
|
||||
.bs-example-submenu > .pull-left > .dropdown > .dropdown-menu {
|
||||
.bs-example > .dropdown > .dropdown-menu {
|
||||
position: static;
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-example-submenu {
|
||||
min-height: 230px;
|
||||
}
|
||||
.bs-example-submenu > .pull-left + .pull-left {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* Example tabbable tabs */
|
||||
.bs-example-tabs .nav-tabs {
|
||||
@@ -546,6 +570,10 @@ body {
|
||||
.bs-example-tooltips {
|
||||
text-align: center;
|
||||
}
|
||||
.bs-example-tooltips > .btn {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* Popovers */
|
||||
.bs-example-popover {
|
||||
@@ -561,19 +589,6 @@ body {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Example templates
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-examples h4 {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-examples p {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Responsive docs
|
||||
-------------------------------------------------- */
|
||||
|
||||
@@ -607,6 +622,10 @@ body {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
.bs-table-scrollable .highlight pre {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
|
||||
/* Related: responsive utilities tables */
|
||||
.table code {
|
||||
@@ -641,17 +660,9 @@ body {
|
||||
------------------------- */
|
||||
.responsive-utilities-test {
|
||||
margin-top: 5px;
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
overflow: hidden; /* clear floats */
|
||||
}
|
||||
.responsive-utilities-test li {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 25%;
|
||||
}
|
||||
.responsive-utilities-test li + li {
|
||||
margin-left: 10px;
|
||||
.responsive-utilities-test .col-xs-6 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.responsive-utilities-test span {
|
||||
padding: 15px 10px;
|
||||
@@ -661,13 +672,25 @@ body {
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.responsive-utilities-test.visible-on [class*="hidden"],
|
||||
.responsive-utilities-test.hidden-on [class*="visible"] {
|
||||
.visible-on .col-xs-6 .hidden-xs,
|
||||
.visible-on .col-xs-6 .hidden-sm,
|
||||
.visible-on .col-xs-6 .hidden-md,
|
||||
.visible-on .col-xs-6 .hidden-lg,
|
||||
.hidden-on .col-xs-6 .visible-xs,
|
||||
.hidden-on .col-xs-6 .visible-sm,
|
||||
.hidden-on .col-xs-6 .visible-md,
|
||||
.hidden-on .col-xs-6 .visible-lg {
|
||||
color: #999;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.responsive-utilities-test.visible-on [class*="visible"],
|
||||
.responsive-utilities-test.hidden-on [class*="hidden"] {
|
||||
.visible-on .col-xs-6 .visible-xs,
|
||||
.visible-on .col-xs-6 .visible-sm,
|
||||
.visible-on .col-xs-6 .visible-md,
|
||||
.visible-on .col-xs-6 .visible-lg,
|
||||
.hidden-on .col-xs-6 .hidden-xs,
|
||||
.hidden-on .col-xs-6 .hidden-sm,
|
||||
.hidden-on .col-xs-6 .hidden-md,
|
||||
.hidden-on .col-xs-6 .hidden-lg {
|
||||
color: #468847;
|
||||
background-color: #dff0d8;
|
||||
border: 1px solid #d6e9c6;
|
||||
@@ -724,6 +747,11 @@ body {
|
||||
.bs-social-buttons .twitter-share-button {
|
||||
width: 98px !important;
|
||||
}
|
||||
/* Style the GitHub buttons via CSS instead of inline attributes */
|
||||
.github-btn {
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -731,7 +759,7 @@ body {
|
||||
-------------------------------------------------- */
|
||||
|
||||
/* Pseudo :focus state for showing how it looks in the docs */
|
||||
input.focused {
|
||||
#focusedInput {
|
||||
border-color: rgba(82,168,236,.8);
|
||||
outline: 0;
|
||||
outline: thin dotted \9; /* IE6-9 */
|
||||
@@ -813,6 +841,15 @@ input.focused {
|
||||
border-radius: 4px 4px 0 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
.bs-example + .prettyprint,
|
||||
.bs-example + .highlight {
|
||||
margin-top: -16px;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
border-width: 1px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.carbonad {
|
||||
margin: 0 !important;
|
||||
@@ -824,10 +861,6 @@ input.focused {
|
||||
.bs-sidebar {
|
||||
display: block;
|
||||
}
|
||||
/* Show the hidden subnavs when space allows it */
|
||||
.bs-sidebar .nav > .active > ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Tweak display of docs jumbotrons */
|
||||
.bs-masthead {
|
||||
@@ -837,7 +870,7 @@ input.focused {
|
||||
.bs-masthead h1 {
|
||||
font-size: 100px;
|
||||
}
|
||||
.bs-masthead p {
|
||||
.bs-masthead .lead {
|
||||
margin-left: 15%;
|
||||
margin-right: 15%;
|
||||
font-size: 30px;
|
||||
@@ -852,7 +885,23 @@ input.focused {
|
||||
|
||||
/* Tablets/desktops and up */
|
||||
@media screen and (min-width: 992px) {
|
||||
.bs-header h1,
|
||||
.bs-header p {
|
||||
margin-right: 380px;
|
||||
}
|
||||
.carbonad {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 0;
|
||||
padding: 15px !important;
|
||||
width: 330px !important;
|
||||
min-height: 132px;
|
||||
}
|
||||
|
||||
/* Show the hidden subnavs when space allows it */
|
||||
.bs-sidebar .nav > .active > ul {
|
||||
display: block;
|
||||
}
|
||||
/* Widen the fixed sidebar */
|
||||
.bs-sidebar.affix,
|
||||
.bs-sidebar.affix-bottom {
|
||||
@@ -870,19 +919,6 @@ input.focused {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bs-header h1,
|
||||
.bs-header p {
|
||||
margin-right: 380px;
|
||||
}
|
||||
.carbonad {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 0;
|
||||
padding: 15px !important;
|
||||
width: 330px !important;
|
||||
min-height: 132px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Large desktops and up */
|
||||
@@ -891,7 +927,7 @@ input.focused {
|
||||
/* Widen the fixed sidebar again */
|
||||
.bs-sidebar.affix-bottom,
|
||||
.bs-sidebar.affix {
|
||||
width: 270px;
|
||||
width: 263px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,16 +16,12 @@
|
||||
offset: navHeight
|
||||
})
|
||||
|
||||
$('.bs-docs-container [href=#]').click(function (e) {
|
||||
e.preventDefault()
|
||||
$window.on('load', function () {
|
||||
$body.scrollspy('refresh')
|
||||
})
|
||||
|
||||
$body.on('click', '.bs-sidenav [href^=#]', function (e) {
|
||||
var $target = $(this.getAttribute('href'))
|
||||
|
||||
e.preventDefault() // prevent browser scroll
|
||||
|
||||
$window.scrollTop($target.offset().top - navHeight + 5)
|
||||
$('.bs-docs-container [href=#]').click(function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
// back to top
|
||||
@@ -54,7 +50,8 @@
|
||||
|
||||
// tooltip demo
|
||||
$('.tooltip-demo').tooltip({
|
||||
selector: "[data-toggle=tooltip]"
|
||||
selector: "[data-toggle=tooltip]",
|
||||
container: "body"
|
||||
})
|
||||
|
||||
$('.tooltip-test').tooltip()
|
||||
@@ -81,88 +78,6 @@
|
||||
|
||||
// carousel demo
|
||||
$('.bs-docs-carousel-example').carousel()
|
||||
|
||||
// javascript build logic
|
||||
var inputsComponent = $("#less input")
|
||||
, inputsPlugin = $("#plugins input")
|
||||
, inputsVariables = $("#less-variables input")
|
||||
|
||||
// toggle all plugin checkboxes
|
||||
$('#less .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsComponent.prop('checked', !inputsComponent.is(':checked'))
|
||||
})
|
||||
|
||||
$('#plugins .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsPlugin.prop('checked', !inputsPlugin.is(':checked'))
|
||||
})
|
||||
|
||||
$('#less-variables .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsVariables.val('')
|
||||
})
|
||||
|
||||
// request built javascript
|
||||
$('.bs-customize-download .btn').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
|
||||
var css = $("#less input:checked")
|
||||
.map(function () { return this.value })
|
||||
.toArray()
|
||||
, js = $("#plugins input:checked")
|
||||
.map(function () { return this.value })
|
||||
.toArray()
|
||||
, vars = {}
|
||||
|
||||
$("#less-variables input")
|
||||
.each(function () {
|
||||
$(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
|
||||
})
|
||||
|
||||
$.ajax({
|
||||
type: 'POST'
|
||||
, url: /localhost/.test(window.location) ? 'http://localhost:9001' : 'http://bootstrap.herokuapp.com'
|
||||
, dataType: 'jsonpi'
|
||||
, params: {
|
||||
js: js
|
||||
, css: css
|
||||
, vars: vars
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
// Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi
|
||||
$.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) {
|
||||
var url = opts.url;
|
||||
|
||||
return {
|
||||
send: function(_, completeCallback) {
|
||||
var name = 'jQuery_iframe_' + jQuery.now()
|
||||
, iframe, form
|
||||
|
||||
iframe = $('<iframe>')
|
||||
.attr('name', name)
|
||||
.appendTo('head')
|
||||
|
||||
form = $('<form>')
|
||||
.attr('method', opts.type) // GET or POST
|
||||
.attr('action', url)
|
||||
.attr('target', name)
|
||||
|
||||
$.each(opts.params, function(k, v) {
|
||||
|
||||
$('<input>')
|
||||
.attr('type', 'hidden')
|
||||
.attr('name', k)
|
||||
.attr('value', typeof v == 'string' ? v : JSON.stringify(v))
|
||||
.appendTo(form)
|
||||
})
|
||||
|
||||
form.appendTo('body').submit()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}(window.jQuery)
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
window.onload = function () { // wait for load in a dumb way because B-0
|
||||
var cw = '/*!\n * Bootstrap v3.0.0-rc.2\n *\n * Copyright 2013 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Designed and built with all the love in the world @twitter by @mdo and @fat.\n */\n\n'
|
||||
|
||||
function generateUrl() {
|
||||
var vars = {}
|
||||
|
||||
$('#less-variables-section input')
|
||||
.each(function () {
|
||||
$(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
|
||||
})
|
||||
|
||||
var data = {
|
||||
vars: vars,
|
||||
css: $('#less-section input:not(:checked)').map(function () { return this.value }).toArray(),
|
||||
js: $('#plugin-section input:not(:checked)').map(function () { return this.value }).toArray()
|
||||
}
|
||||
|
||||
if ($.isEmptyObject(data.vars) && !data.css.length && !data.js.length) return
|
||||
|
||||
window.location = jQuery.param.querystring('/customize/', data)
|
||||
}
|
||||
|
||||
function parseUrl() {
|
||||
var data = jQuery.deparam.querystring()
|
||||
|
||||
if (data.js) {
|
||||
for (var i = 0; i < data.js.length; i++) {
|
||||
var input = $('input[value="'+data.js[i]+'"]')
|
||||
input && input.prop('checked', false)
|
||||
}
|
||||
}
|
||||
|
||||
if (data.css) {
|
||||
for (var i = 0; i < data.css.length; i++) {
|
||||
var input = $('input[value="'+data.css[i]+'"]')
|
||||
input && input.prop('checked', false)
|
||||
}
|
||||
}
|
||||
|
||||
if (data.vars) {
|
||||
// todo (fat): vars
|
||||
}
|
||||
}
|
||||
|
||||
function generateZip(css, js, complete) {
|
||||
if (!css && !js) return alert('you want to build nothing… o_O')
|
||||
|
||||
var zip = new JSZip()
|
||||
|
||||
if (css) {
|
||||
var cssFolder = zip.folder('css')
|
||||
for (var fileName in css) {
|
||||
cssFolder.file(fileName, css[fileName])
|
||||
}
|
||||
}
|
||||
|
||||
if (js) {
|
||||
var jsFolder = zip.folder('js')
|
||||
for (var fileName in js) {
|
||||
jsFolder.file(fileName, js[fileName])
|
||||
}
|
||||
}
|
||||
|
||||
var content = zip.generate()
|
||||
|
||||
location.href = 'data:application/zip;base64,' + content
|
||||
|
||||
complete()
|
||||
}
|
||||
|
||||
function generateCustomCSS(vars) {
|
||||
var result = ''
|
||||
|
||||
for (var key in vars) {
|
||||
result += key + ': ' + vars[key] + ';\n'
|
||||
}
|
||||
|
||||
return result + '\n\n'
|
||||
}
|
||||
|
||||
function generateCSS() {
|
||||
var $checked = $('#less-section input:checked')
|
||||
|
||||
if (!$checked.length) return false
|
||||
|
||||
var result = {}
|
||||
var vars = {}
|
||||
var css = ''
|
||||
|
||||
$('#less-variables-section input')
|
||||
.each(function () {
|
||||
$(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
|
||||
})
|
||||
|
||||
css += __less['variables.less']
|
||||
if (vars) css += generateCustomCSS(vars)
|
||||
css += __less['mixins.less']
|
||||
css += $checked
|
||||
.map(function () { return __less[this.value] })
|
||||
.toArray()
|
||||
.join('\n')
|
||||
|
||||
css = css.replace(/@import[^\n]*/gi, '') //strip any imports
|
||||
|
||||
try {
|
||||
var parser = new less.Parser({
|
||||
paths: ['variables.less', 'mixins.less']
|
||||
, optimization: 0
|
||||
, filename: 'bootstrap.css'
|
||||
}).parse(css, function (err, tree) {
|
||||
if (err) return alert(err)
|
||||
|
||||
result = {
|
||||
'bootstrap.css' : cw + tree.toCSS(),
|
||||
'bootstrap.min.css' : cw + tree.toCSS({ compress: true })
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
return alert(err)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
function generateJavascript() {
|
||||
var $checked = $('#plugin-section input:checked')
|
||||
if (!$checked.length) return false
|
||||
|
||||
var js = $checked
|
||||
.map(function () { return __js[this.value] })
|
||||
.toArray()
|
||||
.join('\n')
|
||||
|
||||
return {
|
||||
'bootstrap.js': js,
|
||||
'bootstrap.min.js': cw + uglify(js)
|
||||
}
|
||||
}
|
||||
|
||||
var $downloadBtn = $('#btn-download').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
$downloadBtn.addClass('loading')
|
||||
generateZip(generateCSS(), generateJavascript(), function () {
|
||||
$downloadBtn.removeClass('loading')
|
||||
setTimeout(function () {
|
||||
generateUrl()
|
||||
}, 1)
|
||||
})
|
||||
})
|
||||
|
||||
var inputsComponent = $('#less-section input')
|
||||
var inputsPlugin = $('#plugin-section input')
|
||||
var inputsVariables = $('#less-variables-section input')
|
||||
|
||||
$('#less-section .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsComponent.prop('checked', !inputsComponent.is(':checked'))
|
||||
})
|
||||
|
||||
$('#plugin-section .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsPlugin.prop('checked', !inputsPlugin.is(':checked'))
|
||||
})
|
||||
|
||||
$('#less-variables-section .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsVariables.val('')
|
||||
})
|
||||
|
||||
try {
|
||||
parseUrl()
|
||||
} catch (e) {
|
||||
// maybe alert user that we can't parse their url
|
||||
}
|
||||
}
|
||||
Vendored
+1287
File diff suppressed because it is too large
Load Diff
+1425
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user