From 4737d693e00989a0f90f832a7c8f4f784df14077 Mon Sep 17 00:00:00 2001 From: Jacob Thornton <jacobthornton@gmail.com> Date: Sat, 28 Jan 2012 00:36:37 -0800 Subject: [PATCH] remove quick start section to simplify landing page + start rewriting application js to work ie7 --- docs/assets/css/bootstrap.css | 2 +- docs/assets/js/application.js | 400 +++++++++++++--------------- docs/index.html | 33 --- docs/templates/pages/index.mustache | 33 --- 4 files changed, 191 insertions(+), 277 deletions(-) diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 7a55680417..cd0d620bf4 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -1986,7 +1986,7 @@ table .span12 { .navbar-search .search-query :-moz-placeholder { color: #eeeeee; } -.navbar-search .search-query ::-webkit-input-placeholder { +.navbar-search .search-query::-webkit-input-placeholder { color: #eeeeee; } .navbar-search .search-query:hover { diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index a071a855b4..b522f6bacc 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,231 +1,211 @@ -$(function(){ - - // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT - // IT'S ALL JUST JUNK FOR OUR DOCS! - // ++++++++++++++++++++++++++++++++++++++++++ - - - // Hide the Mobile Safari address bar once loaded - // ============================================== - - // Set a timeout... - // setTimeout(function(){ - // // Hide the address bar! - // window.scrollTo(0, 1); - // }, 0); - - - // table sort example - // ================== - - // make code pretty - window.prettyPrint && prettyPrint() - - // table sort example - if ($.fn.tablesorter) { - $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } ) - $(".tablesorter-example").tablesorter({ sortList: [[1,0]] }) - } - - // add on logic - $('.add-on :checkbox').on('click', function () { - var $this = $(this) - , method = $this.attr('checked') ? 'addClass' : 'removeClass' - $(this).parents('.add-on')[method]('active') - }) - - // Disable certain links in docs - // Please do not carry these styles over to your projects - // it's merely here to prevent button clicks form taking you - // away from your spot on page!! - - $('section [href^=#]').click(function (e) { - e.preventDefault() - }) - - // Copy code blocks in docs - $(".copy-code").on('focus', function () { - var el = this - setTimeout(function () { $(el).select() }, 0) - }) - - if ($.fn.tooltip) { - - // position static twipsies for components page - if ($(".twipsies a").length) { - $(window).on('load resize', function () { - $(".twipsies a").each(function () { - $(this) - .tooltip({ - placement: $(this).attr('title') - , trigger: 'manual' - }) - .tooltip('show') - }) - }) - } - - // add tipsies to grid for scaffolding - if ($('#grid-system').length) { +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ - $('#grid-system').tooltip({ - selector: '.show-grid > div' - , title: function () { return $(this).width() + 'px' } - }) +!function ($) { - } - } - - - // fix sub nav playa - var $win = $(window) - , $nav = $('.subnav') - , navTop = $('.subnav').length && $('.subnav').offset().top - 40 - , isFixed = 0 - - processScroll() - - $win.on('scroll', processScroll) - - function processScroll() { - var i, scrollTop = $win.scrollTop() - if (scrollTop >= navTop && !isFixed) { - isFixed = 1 - $nav.addClass('subnav-fixed') - } else if (scrollTop <= navTop && isFixed) { - isFixed = 0 - $nav.removeClass('subnav-fixed') - } - } + $(function(){ -}) -// JS for javascript demos -$(function () { - // tooltip demo - $('.tooltip-demo.well').tooltip({ - selector: "a[rel=tooltip]" - }) - - $('.tooltip-test').tooltip({ - 'z-index': 3000 - }) - - $('.popover-test').popover({ - 'z-index': 3000 - }) - - // popover demo - $("a[rel=popover]") - .popover() - .click(function(e) { + // Disable certain links in docs + $('section [href^=#]').click(function (e) { e.preventDefault() }) - // button state demo - $('#fat-btn') - .click(function () { - var btn = $(this) - btn.button('loading') - setTimeout(function () { - btn.button('reset') - }, 3000) - }) - - // carousel demo - $('#myCarousel').carousel() -}) - - -// Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi -// by the talented Ben Vinegar -!function($) { - $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { - var url = opts.url; + // make code pretty + window.prettyPrint && prettyPrint() - return { - send: function(_, completeCallback) { - var name = 'jQuery_iframe_' + jQuery.now() - , iframe, form + // table sort example + if ($.fn.tablesorter) { + $("#sortTableExample").tablesorter({ sortList: [[1,0]] }) + $(".tablesorter-example").tablesorter({ sortList: [[1,0]] }) + } - iframe = $('<iframe>') - .attr('name', name) - .appendTo('head') + // add-ons + $('.add-on :checkbox').on('click', function () { + var $this = $(this) + , method = $this.attr('checked') ? 'addClass' : 'removeClass' + $(this).parents('.add-on')[method]('active') + }) - form = $('<form>') - .attr('method', opts.type) // GET or POST - .attr('action', url) - .attr('target', name) + if ($.fn.tooltip) { + + // position static twipsies for components page + if ($(".twipsies a").length) { + $(window).on('load resize', function () { + $(".twipsies a").each(function () { + $(this) + .tooltip({ + placement: $(this).attr('title') + , trigger: 'manual' + }) + .tooltip('show') + }) + }) + } - $.each(opts.params, function(k, v) { + // add tipsies to grid for scaffolding + if ($('#grid-system').length) { - $('<input>') - .attr('type', 'hidden') - .attr('name', k) - .attr('value', typeof v == 'string' ? v : JSON.stringify(v)) - .appendTo(form) + $('#grid-system').tooltip({ + selector: '.show-grid > div' + , title: function () { return $(this).width() + 'px' } }) - form.appendTo('body').submit() } } - }) -}(jQuery); - - // javascript build logic - -$(function () { - - var inputsComponent = $("#components.download input") - , inputsPlugin = $("#plugins.download input") - , inputsVariables = $("#variables.download input") - - // toggle all plugin checkboxes - $('#components.download .toggle-all').on('click', function (e) { - e.preventDefault() - inputsComponent.attr('checked', !inputsComponent.is(':checked')) - }) - - $('#plugins.download .toggle-all').on('click', function (e) { - e.preventDefault() - inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) - }) - - $('#variables.download .toggle-all').on('click', function (e) { - e.preventDefault() - inputsVariables.val('') - }) - - // request built javascript - $('.download-btn').on('click', function () { - - var css = $("#components.download input:checked") - .map(function () { return this.value }) - .toArray() - , js = $("#plugins.download input:checked") - .map(function () { return this.value }) - .toArray() - , vars = {} - , img = ['glyphicons-halflings-sprite.png', 'glyphicons-halflings-sprite-white.png'] - - $("#variables.download input") - .each(function () { - $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) - }) - $.ajax({ - type: 'POST' - , url: 'http://bootstrap.herokuapp.com' - , dataType: 'jsonpi' - , params: { - branch: '2.0-wip' - , js: js - , css: css - , vars: vars - , img: img + // fix sub nav playa + var $win = $(window) + , $nav = $('.subnav') + , navTop = $('.subnav').length && $('.subnav').offset().top - 40 + , isFixed = 0 + + processScroll() + + $win.on('scroll', processScroll) + + function processScroll() { + var i, scrollTop = $win.scrollTop() + if (scrollTop >= navTop && !isFixed) { + isFixed = 1 + $nav.addClass('subnav-fixed') + } else if (scrollTop <= navTop && isFixed) { + isFixed = 0 + $nav.removeClass('subnav-fixed') + } } - }) - }) }) +// JS for javascript demos +// $(function () { +// // tooltip demo +// $('.tooltip-demo.well').tooltip({ +// selector: "a[rel=tooltip]" +// }) + +// $('.tooltip-test').tooltip({ +// 'z-index': 3000 +// }) + +// $('.popover-test').popover({ +// 'z-index': 3000 +// }) + +// // popover demo +// $("a[rel=popover]") +// .popover() +// .click(function(e) { +// e.preventDefault() +// }) + +// // button state demo +// $('#fat-btn') +// .click(function () { +// var btn = $(this) +// btn.button('loading') +// setTimeout(function () { +// btn.button('reset') +// }, 3000) +// }) + +// // carousel demo +// $('#myCarousel').carousel() + +// }) + + +// // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi +// // by the talented Ben Vinegar +// !function($) { +// $.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() +// } +// } +// }) +// }(jQuery); + +// // javascript build logic + +// $(function () { + +// var inputsComponent = $("#components.download input") +// , inputsPlugin = $("#plugins.download input") +// , inputsVariables = $("#variables.download input") + +// // toggle all plugin checkboxes +// $('#components.download .toggle-all').on('click', function (e) { +// e.preventDefault() +// inputsComponent.attr('checked', !inputsComponent.is(':checked')) +// }) + +// $('#plugins.download .toggle-all').on('click', function (e) { +// e.preventDefault() +// inputsPlugin.attr('checked', !inputsPlugin.is(':checked')) +// }) + +// $('#variables.download .toggle-all').on('click', function (e) { +// e.preventDefault() +// inputsVariables.val('') +// }) + +// // request built javascript +// $('.download-btn').on('click', function () { + +// var css = $("#components.download input:checked") +// .map(function () { return this.value }) +// .toArray() +// , js = $("#plugins.download input:checked") +// .map(function () { return this.value }) +// .toArray() +// , vars = {} +// , img = ['glyphicons-halflings-sprite.png', 'glyphicons-halflings-sprite-white.png'] + +// $("#variables.download input") +// .each(function () { +// $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) +// }) + +// $.ajax({ +// type: 'POST' +// , url: 'http://bootstrap.herokuapp.com' +// , dataType: 'jsonpi' +// , params: { +// branch: '2.0-wip' +// , js: js +// , css: css +// , vars: vars +// , img: img +// } +// }) +// }) + +// }) + +}(window.jQuery) \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 1459da26c2..25e4778028 100644 --- a/docs/index.html +++ b/docs/index.html @@ -212,39 +212,6 @@ </li> </ul> - <hr class="soften"> - - <!-- Quickstart options - ================================================== --> - <h1>Get started in no time.</h1> - <p class="marketing-byline">Quickly start using Bootstrap within your workflow and development process.</p> - <div class="getting-started"> - <div class="row"> - <div class="span4"> - <h3>Prostyle with Node</h3> - <p>If you use Node, download the repo, customize Bootstrap, and run make.</p> - <pre class="prettyprint"> -$ git clone git@github.com:twitter/bootstrap.git -$ make</pre> - </div> - <div class="span4"> - <h3>Hotlink the CSS</h3> - <p>For the quickest and easiest start, just copy this snippet into your code to get the CSS.</p> - <form> - <textarea class="copy-code" rows="1"><link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.min.css"></textarea> - </form> - </div> - <div class="span4"> - <h3>Use LESS.js</h3> - <p>A fan of using LESS? No problem, just link to the appropriate .less and .js files:</p> - <form> - <textarea class="copy-code" rows="2"><link rel="stylesheet/less" href="/path/to/bootstrap.less"> - <script src="/path/to/less.js"></script></textarea> - </form> - </div> - </div><!-- /row --> - </div><!-- /getting-started --> - </div><!-- /.marketing --> </div><!-- /#overview --> diff --git a/docs/templates/pages/index.mustache b/docs/templates/pages/index.mustache index 5eb2774ab7..5fa70645a6 100644 --- a/docs/templates/pages/index.mustache +++ b/docs/templates/pages/index.mustache @@ -147,38 +147,5 @@ </li> </ul> - <hr class="soften"> - - <!-- Quickstart options - ================================================== --> - <h1>{{_i}}Get started in no time.{{/i}}</h1> - <p class="marketing-byline">{{_i}}Quickly start using Bootstrap within your workflow and development process.{{/i}}</p> - <div class="getting-started"> - <div class="row"> - <div class="span4"> - <h3>{{_i}}Prostyle with Node{{/i}}</h3> - <p>{{_i}}If you use Node, download the repo, customize Bootstrap, and run make.{{/i}}</p> - <pre class="prettyprint"> -$ git clone git@github.com:twitter/bootstrap.git -$ make</pre> - </div> - <div class="span4"> - <h3>{{_i}}Hotlink the CSS{{/i}}</h3> - <p>{{_i}}For the quickest and easiest start, just copy this snippet into your code to get the CSS.{{/i}}</p> - <form> - <textarea class="copy-code" rows="1"><link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.min.css"></textarea> - </form> - </div> - <div class="span4"> - <h3>{{_i}}Use LESS.js{{/i}}</h3> - <p>{{_i}}A fan of using LESS? No problem, just link to the appropriate .less and .js files:{{/i}}</p> - <form> - <textarea class="copy-code" rows="2"><link rel="stylesheet/less" href="/path/to/bootstrap.less"> - <script src="/path/to/less.js"></script></textarea> - </form> - </div> - </div><!-- /row --> - </div><!-- /getting-started --> - </div><!-- /.marketing --> </div><!-- /#overview --> \ No newline at end of file -- GitLab