2011-10-20 06:56:06 +02:00
|
|
|
$(function(){
|
2011-05-05 09:59:16 +02:00
|
|
|
|
2011-12-22 03:42:43 +01:00
|
|
|
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
|
|
|
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
|
|
|
// ++++++++++++++++++++++++++++++++++++++++++
|
2011-07-02 06:37:12 +02:00
|
|
|
|
2012-01-06 01:03:05 +01:00
|
|
|
|
2011-12-21 23:22:20 +01:00
|
|
|
// Hide the Mobile Safari address bar once loaded
|
|
|
|
// ==============================================
|
|
|
|
|
2011-12-23 04:15:09 +01:00
|
|
|
// Set a timeout...
|
2012-01-06 06:43:28 +01:00
|
|
|
// setTimeout(function(){
|
|
|
|
// // Hide the address bar!
|
|
|
|
// window.scrollTo(0, 1);
|
|
|
|
// }, 0);
|
2011-12-21 23:22:20 +01:00
|
|
|
|
2012-01-06 01:03:05 +01:00
|
|
|
|
2011-06-28 01:47:12 +02:00
|
|
|
// table sort example
|
2011-07-02 06:37:12 +02:00
|
|
|
// ==================
|
|
|
|
|
2011-12-22 03:42:43 +01:00
|
|
|
// make code pretty
|
2011-12-23 04:17:41 +01:00
|
|
|
window.prettyPrint && prettyPrint()
|
2011-05-05 09:59:16 +02:00
|
|
|
|
2011-12-22 03:42:43 +01:00
|
|
|
// table sort example
|
|
|
|
if ($.fn.tableSorter) {
|
|
|
|
$("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } )
|
|
|
|
}
|
2011-07-02 06:37:12 +02:00
|
|
|
|
|
|
|
// add on logic
|
2011-12-22 03:42:43 +01:00
|
|
|
$('.add-on :checkbox').on('click', function () {
|
|
|
|
var $this = $(this)
|
|
|
|
, method = $this.attr('checked') ? 'addClass' : 'removeClass'
|
|
|
|
$(this).parents('.add-on')[method]('active')
|
2011-09-09 05:21:03 +02:00
|
|
|
})
|
2011-07-02 06:30:12 +02:00
|
|
|
|
2011-07-01 00:56:25 +02:00
|
|
|
// Disable certain links in docs
|
2011-12-22 03:42:43 +01:00
|
|
|
// 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!!
|
2011-07-02 06:37:12 +02:00
|
|
|
|
2011-12-22 03:42:43 +01:00
|
|
|
$('[href^=#]').click(function (e) {
|
2011-09-09 05:21:03 +02:00
|
|
|
e.preventDefault()
|
|
|
|
})
|
2011-05-05 09:59:16 +02:00
|
|
|
|
2011-06-30 19:40:28 +02:00
|
|
|
// Copy code blocks in docs
|
2011-12-22 03:42:43 +01:00
|
|
|
$(".copy-code").on('focus', function () {
|
|
|
|
var el = this
|
|
|
|
setTimeout(function () { $(el).select() }, 0)
|
2011-09-11 07:54:47 +02:00
|
|
|
})
|
2011-12-22 03:42:43 +01:00
|
|
|
|
|
|
|
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' }
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-23 04:15:09 +01:00
|
|
|
})
|