angular-cn/public/_includes/_version-dropdown.jade

55 lines
1.8 KiB
Plaintext
Raw Normal View History

2015-03-01 09:42:31 -05:00
language = current.path[1]
2015-03-04 10:49:47 -05:00
title = "JavaScript "
2015-03-03 09:34:45 -05:00
filter = /(\.html$)/
replace = /(\.html$)|(^index\.html$)/
2015-03-04 13:03:49 -05:00
version = ''
page = ''
2015-03-03 09:34:45 -05:00
<!-- Replace _ undscores with . dots -->
2015-03-04 13:03:49 -05:00
if current.path[2]
version = current.path[2].replace(/\_+/gm, ".")
2015-03-03 09:34:45 -05:00
<!-- Replace _ undscores with . dots -->
if current.path[3]
2015-04-22 12:51:13 -04:00
if public.docs[current.path[1]][current.path[2]][current.path[3]]
page = current.path[3] + '/'
else
page = current.path[3] + '.html'
2015-03-01 09:42:31 -05:00
2015-03-03 09:34:45 -05:00
<!-- VERSION TREE CREATOR MIXIN -->
2015-03-03 17:22:30 -05:00
mixin tree(directory, urlPrefix, name, latest)
2015-03-03 09:34:45 -05:00
ul
2015-03-03 17:22:30 -05:00
for val, semvar in directory
if semvar !== '.git' && semvar !== '_data'
libVersion = (semvar == "latest") ? latest : semvar.replace(/\_+/gm, ".")
li <a href="#{urlPrefix}/#{semvar}/#{page}" md-button>#{name} #{libVersion}</a>
2015-03-03 09:34:45 -05:00
<!-- BUTTON TITLE GENERATION -->
2015-03-01 09:42:31 -05:00
if language == 'js'
if version == "latest"
2015-03-04 14:24:00 -05:00
title = 'Angular 2 for JavaScript'
2015-03-03 09:34:45 -05:00
else
2015-03-04 14:24:00 -05:00
title = 'Angular ' + version + ' for JavaScript'
2015-03-03 09:34:45 -05:00
2015-03-01 09:42:31 -05:00
if language == 'dart'
if version == "latest"
2015-03-04 14:24:00 -05:00
title = 'Angular 2 for Dart'
2015-03-03 09:34:45 -05:00
else
2015-03-04 14:24:00 -05:00
title = 'Angular ' + version + ' for Dart'
2015-03-01 09:42:31 -05:00
2015-03-02 22:07:47 -05:00
2015-03-03 09:34:45 -05:00
<!-- DROPDOWN BUTTON -->
2015-03-03 17:22:30 -05:00
nav.hero-subtitle.text-subhead.dropdown
2015-03-04 14:57:28 -05:00
button(aria-label="Select a version of Angular" md-button class="dropdown-button" ng-click="toggleVersionMenu($event)") #{title} <span class="icon icon-arrow-drop-down"></span>
2015-03-03 17:22:30 -05:00
div(class="overlay ng-hide" ng-click="toggleVersionMenu($event)" ng-show="showMenu")
<!-- DROPDOWN MENU -->
2015-03-05 09:30:53 -05:00
div(class="dropdown-menu" ng-class="showMenu ? 'is-visible' : ''")
2015-03-04 14:24:00 -05:00
mixin tree(public.docs.js, "/docs/js", "Angular 2 for JavaScript")
mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart")
2015-03-03 17:22:30 -05:00
ul
2015-03-04 14:24:00 -05:00
li <a href="https://angularjs.org/" md-button>#{name} Angular 1.X for JavaScript</a>
2015-03-04 16:57:25 -05:00
li <a href="https://docs.angulardart.org/" md-button>#{name} Angular 1.X for Dart</a>