From cf7a3b9eb3e17f19ec598e1d77f5bc74751295ac Mon Sep 17 00:00:00 2001 From: Dirk Dougherty Date: Thu, 21 May 2015 00:52:33 -0700 Subject: [PATCH] Highlight "Preview" subtab on preview pages. Support templating for ndk files within templates-sdk. Change-Id: Iade5ac4630c9e763c377ab5749f16832e3ba47b7 --- .../templates-sdk/assets/css/default.css | 20 ++- .../assets/images/android_logo_ndk.png | Bin 0 -> 4712 bytes .../assets/images/android_logo_ndk@2x.png | Bin 0 -> 18596 bytes .../droiddoc/templates-sdk/assets/js/docs.js | 17 ++- .../templates-sdk/components/masthead.cs | 64 +++++++++- .../droiddoc/templates-sdk/customizations.cs | 119 +++++++++++------- tools/droiddoc/templates-sdk/docpage.cs | 43 ++++--- tools/droiddoc/templates-sdk/head_tag.cs | 5 + 8 files changed, 197 insertions(+), 71 deletions(-) create mode 100644 tools/droiddoc/templates-sdk/assets/images/android_logo_ndk.png create mode 100644 tools/droiddoc/templates-sdk/assets/images/android_logo_ndk@2x.png diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css index 71d15df22..8513843e0 100644 --- a/tools/droiddoc/templates-sdk/assets/css/default.css +++ b/tools/droiddoc/templates-sdk/assets/css/default.css @@ -7438,6 +7438,10 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me font-weight: 400; } +.dac-header-crumbs-link.current.ndk { + color: #00BCD4; +} + @media (max-width: 719px) { .dac-header-crumbs { display: none; @@ -7630,6 +7634,10 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me padding-bottom: 11px; } +.dac-nav-link.has-subnav.ndk, .dac-nav-link.selected.ndk { + border-bottom: 3px solid #00BCD4; +} + .dac-nav-secondary { border-bottom: 1px solid #e5e5e5; display: none; @@ -7660,11 +7668,12 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me } } -.dac-nav-secondary .dac-nav-item:first-child .dac-nav-link { - padding-left: 20px; +.dac-nav-secondary .dac-nav-link.selected { + border: none; + font-weight: 700; } -.dac-nav-secondary .dac-nav-link.selected { +.dac-nav-secondary .dac-nav-link.selected.ndk { border: none; font-weight: 700; } @@ -7750,6 +7759,11 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me padding: 0 20px; } + .dac-nav-link.has-subnav.ndk, .dac-nav-link.selected.ndk { + border: none; + padding: 0 20px; + } + .dac-logo-image { margin-right: 5px; vertical-align: top; diff --git a/tools/droiddoc/templates-sdk/assets/images/android_logo_ndk.png b/tools/droiddoc/templates-sdk/assets/images/android_logo_ndk.png new file mode 100644 index 0000000000000000000000000000000000000000..511c200b5e1be6215097710a7dcf3fb2ec3c958b GIT binary patch literal 4712 zcmeHKT}TvB6rRn@+*&ZnAffU>f>P;E#Gn^-qn1E29FZW59)yaXvU=#jHSHlPBB7$9 zpn53WC=hyysfS*QNFo{wlt2tpTD8E+%53|-nZ0@4xih=a2tD}0xA)w0?mhR+nRD;l zJ+-rTTPRo<)HE#=*&g17wg@a%U>4>SJgM>28#3hN1;sv!`!VI=G8Q# zoMywkfO$<$!%WS*nO$Y?Ika2gY=hFOQW|Cn)ayY*WtMdTx#KDuW(#c9U?aE@tO7TI zc_8r_d<8xMUxMdBLkpK)L+go*0%+=P&AAcOU%=CRa5dn`w)7obq~NWi!g#afDVZSSPQ-fpMtrdj0to$ zgDb#pQ21uR6$oMgtphA7H`Ku(7Uvi`yaoOQQx}KI(mh1W*CrOHo<8X796PD-s)0!A zVD!1|mMQc?MVr`~LdRC+%d&fAU^zxG?S6p1l&}IwB(y+VOwW!s#F$=zW(bQ#=O5cI z@_g>DRy{Tu2xy4_j@Swq&wwkzi~3mG*;qqt3i=1=^U(1FeJH{mdY7IR%WpjlhX=qx zu!RA9gdmEIDKEp|Ug+OIUIY4pxA3_ZK1<;2H7JTS&LR|xb0Hc;g-=o86NE4N7K_t$ zfod1{Rd}k{9llios3y*uZZ3ei4E&cFkoT$I)$j1l49ItL?o)o(XAAT#p9P}~Kn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+DsXK^dw+V`U?jXL6bb0MF bCzw{a@$Jix=Py2erqSIyd;Y82ou_{RDva;+ literal 0 HcmV?d00001 diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index 2efe3dc65..30a29fc85 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -163,6 +163,21 @@ $(document).ready(function() { } else { navEl.find("> li.home > a").addClass('selected'); } + +// highlight NDK tabs + } else if ($("body").hasClass("ndk")) { + parentNavEl = navEl.find("> li.ndk > a"); + parentNavEl.addClass('has-subnav'); + if ($("body").hasClass("guide")) { + navEl.find("> li.guides > a").addClass("selected ndk"); + } else if ($("body").hasClass("reference")) { + navEl.find("> li.reference > a").addClass("selected ndk"); + } else if ($("body").hasClass("samples")) { + navEl.find("> li.samples > a").addClass("selected ndk"); + } else if ($("body").hasClass("downloads")) { + navEl.find("> li.downloads > a").addClass("selected ndk"); + } + // highlight Develop tab } else if ($("body").hasClass("develop") || $("body").hasClass("google")) { parentNavEl = navEl.find("> li.develop > a"); @@ -1056,7 +1071,7 @@ function checkSticky() { var top = $(window).scrollTop(); // we set the navbar fixed when the scroll position is beyond the height of the site header... - var shouldBeSticky = top >= stickyTop; + var shouldBeSticky = top > stickyTop; // ... except if the document content is shorter than the sidenav height. // (this is necessary to avoid crazy behavior on OSX Lion due to overscroll bouncing) if ($("#doc-col").height() < $("#side-nav").height()) { diff --git a/tools/droiddoc/templates-sdk/components/masthead.cs b/tools/droiddoc/templates-sdk/components/masthead.cs index 000d95ff9..d3fe1c357 100644 --- a/tools/droiddoc/templates-sdk/components/masthead.cs +++ b/tools/droiddoc/templates-sdk/components/masthead.cs @@ -58,26 +58,36 @@ - +
    elements added here with javascript ?> -
+ + - + + Back to Android Developers + Developer Console - + + @@ -87,6 +97,49 @@ + + + + + + + +
+
+ +
+
+ +
+
+
+ + @@ -499,53 +521,64 @@ def:header_search_widget() ?> - diff --git a/tools/droiddoc/templates-sdk/docpage.cs b/tools/droiddoc/templates-sdk/docpage.cs index 3af70495a..d69023f6c 100644 --- a/tools/droiddoc/templates-sdk/docpage.cs +++ b/tools/droiddoc/templates-sdk/docpage.cs @@ -6,25 +6,30 @@ google develop guide samples previewdistribute googleplay essentials users engage monetize disttools storiesaboutdesign trainingcoursegoogle ndk guide samples reference downloadsdevelop guide samples previewdistribute googleplay essentials users engage monetize disttools stories analyzeaboutdesign trainingcourse" itemscope itemtype="http://schema.org/Article"> diff --git a/tools/droiddoc/templates-sdk/head_tag.cs b/tools/droiddoc/templates-sdk/head_tag.cs index cfc8b1788..3ffa09da5 100644 --- a/tools/droiddoc/templates-sdk/head_tag.cs +++ b/tools/droiddoc/templates-sdk/head_tag.cs @@ -36,6 +36,11 @@ if:android.whichdoc != 'online' ?>http:http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold" title="roboto"> +