-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
345 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": "*.js", | ||
"options": { | ||
"tabWidth": 2, | ||
"singleQuote": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,70 @@ | ||
// Require.js Module Loader - http://requirejs.org | ||
|
||
requirejs.config({ | ||
paths: { | ||
"jquery": "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min", | ||
// "jquery": "lib/jquery", -- local version of jquery if desired. | ||
"jquery.inview": "lib/jquery.inview" | ||
} | ||
paths: { | ||
jquery: '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min', | ||
// "jquery": "lib/jquery", -- local version of jquery if desired. | ||
'jquery.inview': 'lib/jquery.inview', | ||
}, | ||
}); | ||
|
||
define(function(){ | ||
|
||
var mods = []; | ||
|
||
//detect Class function | ||
function hasClass( className ) { | ||
if (!document.getElementsByClassName) { //class name function in old IE | ||
document.getElementsByClassName = function(search) { | ||
var d = document, elements, pattern, i, results = []; | ||
if (d.querySelectorAll) { // IE8 | ||
return d.querySelectorAll("." + search); | ||
} | ||
if (d.evaluate) { // IE6, IE7 | ||
pattern = ".//*[contains(concat(' ', @class, ' '), ' " + search + " ')]"; | ||
elements = d.evaluate(pattern, d, null, 0, null); | ||
while ((i = elements.iterateNext())) { | ||
results.push(i); | ||
} | ||
} else { | ||
elements = d.getElementsByTagName("*"); | ||
pattern = new RegExp("(^|\\s)" + search + "(\\s|$)"); | ||
for (i = 0; i < elements.length; i++) { | ||
if ( pattern.test(elements[i].className) ) { | ||
results.push(elements[i]); | ||
} | ||
} | ||
} | ||
return results; | ||
}; | ||
} | ||
return !!document.getElementsByClassName( className ).length; //return a boolean | ||
} | ||
|
||
//feature list | ||
if (hasClass('list-features')) { | ||
mods.push('mod/list-feature'); | ||
} | ||
|
||
//collapsing list | ||
if (hasClass('list-collapsing')) { | ||
mods.push('mod/list-collapsing'); | ||
} | ||
|
||
if (hasClass('version-switcher')) { | ||
mods.push('mod/version-switcher'); | ||
} | ||
|
||
if (hasClass('doc-floating-warning')) { | ||
mods.push('mod/floating-warning'); | ||
} | ||
|
||
require(mods); | ||
define(function () { | ||
var mods = []; | ||
|
||
//detect Class function | ||
function hasClass(className) { | ||
if (!document.getElementsByClassName) { | ||
//class name function in old IE | ||
document.getElementsByClassName = function (search) { | ||
var d = document, | ||
elements, | ||
pattern, | ||
i, | ||
results = []; | ||
if (d.querySelectorAll) { | ||
// IE8 | ||
return d.querySelectorAll('.' + search); | ||
} | ||
if (d.evaluate) { | ||
// IE6, IE7 | ||
pattern = | ||
".//*[contains(concat(' ', @class, ' '), ' " + search + " ')]"; | ||
elements = d.evaluate(pattern, d, null, 0, null); | ||
while ((i = elements.iterateNext())) { | ||
results.push(i); | ||
} | ||
} else { | ||
elements = d.getElementsByTagName('*'); | ||
pattern = new RegExp('(^|\\s)' + search + '(\\s|$)'); | ||
for (i = 0; i < elements.length; i++) { | ||
if (pattern.test(elements[i].className)) { | ||
results.push(elements[i]); | ||
} | ||
} | ||
} | ||
return results; | ||
}; | ||
} | ||
return !!document.getElementsByClassName(className).length; //return a boolean | ||
} | ||
|
||
//feature list | ||
if (hasClass('list-features')) { | ||
mods.push('mod/list-feature'); | ||
} | ||
|
||
//collapsing list | ||
if (hasClass('list-collapsing')) { | ||
mods.push('mod/list-collapsing'); | ||
} | ||
|
||
if (hasClass('version-switcher')) { | ||
mods.push('mod/version-switcher'); | ||
} | ||
|
||
if (hasClass('doc-floating-warning')) { | ||
mods.push('mod/floating-warning'); | ||
} | ||
|
||
require(mods); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
jQuery(document).ready(function($) { | ||
var menu = $('[role="banner"] [role="navigation"]'); | ||
var button = $('<div class="menu-button"><i class="icon icon-reorder"></i><span>Menu</span></div>'); | ||
jQuery(document).ready(function ($) { | ||
var menu = $('[role="banner"] [role="navigation"]'); | ||
var button = $( | ||
'<div class="menu-button"><i class="icon icon-reorder"></i><span>Menu</span></div>', | ||
); | ||
|
||
menu.addClass('nav-menu-on'); | ||
button.insertBefore(menu); | ||
button.on('click', function(){ | ||
menu.toggleClass('active'); | ||
button.toggleClass('active') | ||
}); | ||
}) | ||
menu.addClass('nav-menu-on'); | ||
button.insertBefore(menu); | ||
button.on('click', function () { | ||
menu.toggleClass('active'); | ||
button.toggleClass('active'); | ||
}); | ||
}); |
Oops, something went wrong.