From 8545fe97877dc275df40ab98d408f21ce9a362cf Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 19 Oct 2011 21:56:06 -0700 Subject: greatly simply js plugins - remove js api where reasonable --- docs/assets/js/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 16a20e068..74024caa1 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,4 +1,4 @@ -$(document).ready(function(){ +$(function(){ // table sort example // ================== -- cgit v1.2.3 From 0980a33b4703677e1aaf3cd949c0437512fa6f33 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Tue, 20 Dec 2011 19:37:41 -0800 Subject: update all to new on api + add animation support to tabs --- docs/assets/js/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 74024caa1..dd759bf8b 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -37,7 +37,7 @@ $(function(){ // POSITION STATIC TWIPSIES // ======================== - $(window).bind( 'load resize', function () { + $(window).on('load resize', function () { $(".twipsies a").each(function () { $(this) .twipsy({ -- cgit v1.2.3 From 20aecb983838422c7b43e20960b10d4d79fefaa3 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Wed, 21 Dec 2011 16:22:20 -0600 Subject: updated all docs to jQuery 1.7, move all docs JS to application.js, and move dropdowns css to dedicated file --- docs/assets/js/application.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 74024caa1..255f624be 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,5 +1,36 @@ $(function(){ + // Hide the Mobile Safari address bar once loaded + // ============================================== + + window.addEventListener("load",function() { + // Set a timeout... + setTimeout(function(){ + // Hide the address bar! + window.scrollTo(0, 1); + }, 0); + }); + + + // Docs topbar nav + // =============== + + $('.nav .active').click(function(e) { + e.preventDefault(); + $(this).siblings().toggle(); + }); + + + // Show grid dimensions on hover + // ============================= + + $('.show-grid > div').hover(function() { + var width = $(this).width(); + $(this).attr('title', width); + $(this).twipsy(); + }); + + // table sort example // ================== -- cgit v1.2.3 From efacac0d6c812abffa8a84a48fa760f5f56c92f0 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 21 Dec 2011 18:42:43 -0800 Subject: clean up all the js across all the doc pages --- docs/assets/js/application.js | 86 ++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 37 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index dd759bf8b..c653233e6 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,52 +1,64 @@ $(function(){ - // table sort example - // ================== + // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT + // IT'S ALL JUST JUNK FOR OUR DOCS! + // ++++++++++++++++++++++++++++++++++++++++++ - $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } ) + // make code pretty + prettyPrint && prettyPrint() + // table sort example + if ($.fn.tableSorter) { + $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } ) + } // add on logic - // ============ - - $('.add-on :checkbox').click(function () { - if ($(this).attr('checked')) { - $(this).parents('.add-on').addClass('active') - } else { - $(this).parents('.add-on').removeClass('active') - } + $('.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 + // 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!! - $('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function (e) { + $('[href^=#]').click(function (e) { e.preventDefault() }) // Copy code blocks in docs - $(".copy-code").focus(function () { - var el = this; - // push select to event loop for chrome :{o - setTimeout(function () { $(el).select(); }, 1); - }); - - - // POSITION STATIC TWIPSIES - // ======================== - - $(window).on('load resize', function () { - $(".twipsies a").each(function () { - $(this) - .twipsy({ - live: false - , placement: $(this).attr('title') - , trigger: 'manual' - , offset: 2 - }) - .twipsy('show') - }) + $(".copy-code").on('focus', function () { + var el = this + setTimeout(function () { $(el).select() }, 0) }) -}); + + if ($.fn.twipsy) { + + // position static twipsies for components page + if ($(".twipsies a").length) { + $(window).on('load resize', function () { + $(".twipsies a").each(function () { + $(this) + .twipsy({ + placement: $(this).attr('title') + , trigger: 'manual' + }) + .twipsy('show') + }) + }) + } + + // add tipsies to grid for scaffolding + if ($('#grid-system').length) { + + $('#grid-system').twipsy({ + selector: '.show-grid > div' + , title: function () { return $(this).width() + 'px' } + }) + + } + } + +}) \ No newline at end of file -- cgit v1.2.3 From 3396fc0542a5fbbed658a95f931472fc24feee56 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Thu, 22 Dec 2011 19:17:41 -0800 Subject: check for prettyprint on window --- docs/assets/js/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index c8e796a39..eae84b138 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -17,7 +17,7 @@ $(function(){ // ================== // make code pretty - prettyPrint && prettyPrint() + window.prettyPrint && prettyPrint() // table sort example if ($.fn.tableSorter) { -- cgit v1.2.3 From fb9401b355366452d310d39f51224999da4daa82 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 5 Jan 2012 01:34:14 -0800 Subject: tweaks abound, updated prettify styles, new sidenav component started, sprite icons started --- docs/assets/js/google-code-prettify/prettify.css | 41 +++++++----------------- 1 file changed, 12 insertions(+), 29 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/google-code-prettify/prettify.css b/docs/assets/js/google-code-prettify/prettify.css index da6b6e7e1..7ff618550 100644 --- a/docs/assets/js/google-code-prettify/prettify.css +++ b/docs/assets/js/google-code-prettify/prettify.css @@ -2,40 +2,23 @@ .lit { color: #195f91; } .pun, .opn, .clo { color: #93a1a1; } .fun { color: #dc322f; } -.str, .atv { color: #268bd2; } -.kwd, .tag { color: #195f91; } -.typ, .atn, .dec, .var { color: #CB4B16; } +.str, .atv { color: #62C462; } +.kwd, .linenums .tag { color: #049CD9; } +.typ, .atn, .dec, .var { color: #EE5F5B; } .pln { color: #93a1a1; } pre.prettyprint { - background: #fefbf3; + background-color: #fefbf3; padding: 9px; - border: 1px solid rgba(0,0,0,.2); - -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.1); - -moz-box-shadow: 0 1px 2px rgba(0,0,0,.1); - box-shadow: 0 1px 2px rgba(0,0,0,.1); + margin-bottom: 9px; +} + +pre.prettyprint { + color: #ccc; + background-color: #252525; } /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin: 0 0 0 40px; } /* IE indents via margin-left */ -ol.linenums li { color: rgba(0,0,0,.15); line-height: 20px; } +ol.linenums li { color: #444; line-height: 18px; } /* Alternate shading for lines */ -li.L1, li.L3, li.L5, li.L7, li.L9 { } - -/* -$base03: #002b36; -$base02: #073642; -$base01: #586e75; -$base00: #657b83; -$base0: #839496; -$base1: #93a1a1; -$base2: #eee8d5; -$base3: #fdf6e3; -$yellow: #b58900; -$orange: #cb4b16; -$red: #dc322f; -$magenta: #d33682; -$violet: #6c71c4; -$blue: #268bd2; -$cyan: #2aa198; -$green: #859900; -*/ \ No newline at end of file +li.L1, li.L3, li.L5, li.L7, li.L9 { } \ No newline at end of file -- cgit v1.2.3 From 90e3a706ba8c01462516efd3c60cd124620950b9 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 5 Jan 2012 16:03:05 -0800 Subject: add jank js back to docs application.js for responsive dropdown in topbar --- docs/assets/js/application.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index eae84b138..63791bd37 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -4,6 +4,7 @@ $(function(){ // IT'S ALL JUST JUNK FOR OUR DOCS! // ++++++++++++++++++++++++++++++++++++++++++ + // Hide the Mobile Safari address bar once loaded // ============================================== @@ -13,6 +14,16 @@ $(function(){ window.scrollTo(0, 1); }, 0); + + // Docs topbar nav + // =============== + + $('.nav .active').on('click', function (e) { + e.preventDefault() + $(this).siblings().toggle() + }); + + // table sort example // ================== -- cgit v1.2.3 From 314feb702f9a95ee473e529650e16654714cd9f4 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Thu, 5 Jan 2012 18:32:08 -0800 Subject: listen to window for dropdown clear --- docs/assets/js/application.js | 9 --------- 1 file changed, 9 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 63791bd37..6194b88db 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -15,15 +15,6 @@ $(function(){ }, 0); - // Docs topbar nav - // =============== - - $('.nav .active').on('click', function (e) { - e.preventDefault() - $(this).siblings().toggle() - }); - - // table sort example // ================== -- cgit v1.2.3 From c56e9d2d35299b4c9e4e3d1aabcf59cedc9143f2 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 5 Jan 2012 21:43:28 -0800 Subject: massive docs update, mostly to all our new forms, and to the buttons --- docs/assets/js/application.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 63791bd37..5fe8b53ef 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -9,10 +9,10 @@ $(function(){ // ============================================== // Set a timeout... - setTimeout(function(){ - // Hide the address bar! - window.scrollTo(0, 1); - }, 0); + // setTimeout(function(){ + // // Hide the address bar! + // window.scrollTo(0, 1); + // }, 0); // Docs topbar nav -- cgit v1.2.3 From cfc2353059df628c67d19a3c5c3ead2cc6051f53 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 6 Jan 2012 23:59:22 -0800 Subject: front page docs updated to include old getting started section, update code styles to look like github gists, and lots more docs updates --- docs/assets/js/google-code-prettify/prettify.css | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/google-code-prettify/prettify.css b/docs/assets/js/google-code-prettify/prettify.css index 7ff618550..e3bbf8b6c 100644 --- a/docs/assets/js/google-code-prettify/prettify.css +++ b/docs/assets/js/google-code-prettify/prettify.css @@ -2,10 +2,10 @@ .lit { color: #195f91; } .pun, .opn, .clo { color: #93a1a1; } .fun { color: #dc322f; } -.str, .atv { color: #62C462; } -.kwd, .linenums .tag { color: #049CD9; } -.typ, .atn, .dec, .var { color: #EE5F5B; } -.pln { color: #93a1a1; } +.str, .atv { color: #D14; } +.kwd, .linenums .tag { color: #1e347b; } +.typ, .atn, .dec, .var { color: teal; } +.pln { color: #48484c; } pre.prettyprint { background-color: #fefbf3; padding: 9px; @@ -17,8 +17,14 @@ pre.prettyprint { background-color: #252525; } +pre.prettyprint { + padding: 8px; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} + /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin: 0 0 0 40px; } /* IE indents via margin-left */ -ol.linenums li { color: #444; line-height: 18px; } +ol.linenums li { color: #bebec5; line-height: 18px; text-shadow: 0 1px 0 #fff; } /* Alternate shading for lines */ li.L1, li.L3, li.L5, li.L7, li.L9 { } \ No newline at end of file -- cgit v1.2.3 From d6a1402f2af5111e11a87a6029b642dc0b814854 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 7 Jan 2012 01:03:26 -0800 Subject: update form shadows and tweak prettyprint styles --- docs/assets/js/google-code-prettify/prettify.css | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/google-code-prettify/prettify.css b/docs/assets/js/google-code-prettify/prettify.css index e3bbf8b6c..c2031b594 100644 --- a/docs/assets/js/google-code-prettify/prettify.css +++ b/docs/assets/js/google-code-prettify/prettify.css @@ -21,10 +21,22 @@ pre.prettyprint { padding: 8px; background-color: #f7f7f9; border: 1px solid #e1e1e8; + -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; + -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; + box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; } /* Specify class=linenums on a pre to get line numbering */ -ol.linenums { margin: 0 0 0 40px; } /* IE indents via margin-left */ -ol.linenums li { color: #bebec5; line-height: 18px; text-shadow: 0 1px 0 #fff; } +ol.linenums { + margin: 0 0 0 33px; /* IE indents via margin-left */ +} +ol.linenums li { + padding-left: 7px; + color: #bebec5; + line-height: 18px; + text-shadow: 0 1px 0 #fff; +} /* Alternate shading for lines */ -li.L1, li.L3, li.L5, li.L7, li.L9 { } \ No newline at end of file +li.L1, li.L3, li.L5, li.L7, li.L9 { + +} \ No newline at end of file -- cgit v1.2.3 From 45d671d97f4d448780729bbb6357e9ec776f980c Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 7 Jan 2012 01:22:52 -0800 Subject: tweak spacing once more on prettify; add support for uneditable inputs to input-append and prepend --- docs/assets/js/google-code-prettify/prettify.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/google-code-prettify/prettify.css b/docs/assets/js/google-code-prettify/prettify.css index c2031b594..f195124a9 100644 --- a/docs/assets/js/google-code-prettify/prettify.css +++ b/docs/assets/js/google-code-prettify/prettify.css @@ -31,7 +31,7 @@ ol.linenums { margin: 0 0 0 33px; /* IE indents via margin-left */ } ol.linenums li { - padding-left: 7px; + padding-left: 12px; color: #bebec5; line-height: 18px; text-shadow: 0 1px 0 #fff; -- cgit v1.2.3 From a339f0051b21f9e51d47c3eb1fd7d37f126e87a0 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 7 Jan 2012 12:22:51 -0800 Subject: fixing tablesorter styles by adding the jquery plugin back to the lib, fixing the docs examples --- docs/assets/js/jquery.tablesorter.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/assets/js/jquery.tablesorter.js (limited to 'docs/assets/js') diff --git a/docs/assets/js/jquery.tablesorter.js b/docs/assets/js/jquery.tablesorter.js new file mode 100644 index 000000000..8ca383e39 --- /dev/null +++ b/docs/assets/js/jquery.tablesorter.js @@ -0,0 +1,3 @@ +(function($){$.extend({tablesorter:new +function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((ab)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i Date: Sat, 7 Jan 2012 20:40:28 -0800 Subject: overhaul the entire tabs component structure and docs; remove side nav and make it a nav list to build on new .nav base class --- docs/assets/js/google-code-prettify/prettify.css | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/google-code-prettify/prettify.css b/docs/assets/js/google-code-prettify/prettify.css index f195124a9..0d54905fb 100644 --- a/docs/assets/js/google-code-prettify/prettify.css +++ b/docs/assets/js/google-code-prettify/prettify.css @@ -6,21 +6,13 @@ .kwd, .linenums .tag { color: #1e347b; } .typ, .atn, .dec, .var { color: teal; } .pln { color: #48484c; } -pre.prettyprint { - background-color: #fefbf3; - padding: 9px; - margin-bottom: 9px; -} - -pre.prettyprint { - color: #ccc; - background-color: #252525; -} -pre.prettyprint { +.prettyprint { padding: 8px; background-color: #f7f7f9; border: 1px solid #e1e1e8; +} +.prettyprint.linenums { -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; -- cgit v1.2.3 From 6f2f947a4309a8fdeb7067612447c0f1a15dcfd9 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 11 Jan 2012 21:42:55 -0800 Subject: add build tool for js + rename twipsy to tooltip + lots of little doc cleanup --- docs/assets/js/application.js | 83 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 4 deletions(-) (limited to 'docs/assets/js') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index c31fc97a0..0e14a5350 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -48,18 +48,18 @@ $(function(){ setTimeout(function () { $(el).select() }, 0) }) - if ($.fn.twipsy) { + if ($.fn.tooltip) { // position static twipsies for components page if ($(".twipsies a").length) { $(window).on('load resize', function () { $(".twipsies a").each(function () { $(this) - .twipsy({ + .tooltip({ placement: $(this).attr('title') , trigger: 'manual' }) - .twipsy('show') + .tooltip('show') }) }) } @@ -67,7 +67,7 @@ $(function(){ // add tipsies to grid for scaffolding if ($('#grid-system').length) { - $('#grid-system').twipsy({ + $('#grid-system').tooltip({ selector: '.show-grid > div' , title: function () { return $(this).width() + 'px' } }) @@ -75,4 +75,79 @@ $(function(){ } } + // javascript build logic + + var inputs = $("#javascript input") + + // toggle all plugin checkboxes + $('#selectAll').on('click', function (e) { + e.preventDefault() + inputs.attr('checked', !inputs.is(':checked')) + }) + + // handle build button dropdown + var buildTypes = $('#javascriptBuilder .dropdown-menu li').on('click', function () { + buildTypes.removeClass('active') + $(this).addClass('active') + }) + + // request built javascript + $('#javascriptBuild').on('click', function () { + + var names = $("#javascript input:checked") + .map(function () { return this.value }) + .toArray() + + if (names[names.length - 1] == 'bootstrap-transition.js') { + names.unshift(names.pop()) + } + + $.ajax({ + type: 'POST' + , dataType: 'jsonpi' + , params: { + branch: '2.0-wip' + , dir: 'js' + , filenames: names + , compress: buildTypes.first().hasClass('active') + } + , url: "http://bootstrap.herokuapp.com" + }) + }) + }) + + +// 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 = $('