diff --git a/tools/droiddoc/templates-sac/assets/css/default.css b/tools/droiddoc/templates-sac/assets/css/default.css index c349c8992..9b1fe5a3b 100644 --- a/tools/droiddoc/templates-sac/assets/css/default.css +++ b/tools/droiddoc/templates-sac/assets/css/default.css @@ -2208,6 +2208,7 @@ a:visited, #nav-swap { height:30px; border-top:1px solid #ccc; + display: none; } #nav-swap a { display:inline-block; @@ -2242,6 +2243,10 @@ a:visited, margin-left:0; } +#nav-tree, #swapper { + display: none; +} + #nav-tree ul { list-style:none; padding:0; @@ -2336,11 +2341,13 @@ a:visited, border-bottom: 1px solid #CCC; background:#e9e9e9; background: rgba(0, 0, 0, 0.05); /* matches #nav li.expanded */ + display: none; } #api-nav-title { padding:0 5px; white-space:nowrap; + display: none; } #api-level-toggle { @@ -3580,8 +3587,9 @@ EndColorStr='#ececec'); border-color: #33b5e5; } +// Fudging this so SAC looks OK .develop #header .wrap { - border-color: #F80; + border-color: #CCC; } .distribute #header .wrap { @@ -4568,3 +4576,83 @@ a.download-sdk { .annotation-message { display: block; } + +.dac-custom-search { + background: #fff; + margin: 0 -10px; + padding: 20px 10px; + z-index: 1; +} + +.dac-custom-search .dac-fab, .dac-custom-search .dac-button-social { + top: -48px; +} + +.dac-custom-search-section-title { + color: #505050; +} + +.dac-custom-search-entry { + margin-bottom: 36px; + margin-top: 24px; + margin-left: 0em; +} + +.dac-custom-search-image { + background-size: cover; + height: 112px; +} + +.dac-custom-search-title { + color: #333; + font-size: 14px; + font-weight: 700; + line-height: 0px; + padding: 0; + margin: 1em 0em 1em 0em; +} + +.dac-custom-search-title a { + color: inherit; +} + +.dac-custom-search-section { + color: #999; + font-size: 16px; + font-variant: small-caps; + font-weight: 700; + margin: -5px 0 0 0; +} + +.dac-custom-search-snippet { + color: #666; + margin: 0em 0em .25em 0em; +} + +.dac-custom-search-link { + font-weight: 500; + word-wrap: break-word; + width: 100%; +} + +.dac-custom-search-load-more { + background: none; + border: none; + color: #333; + cursor: pointer; + display: block; + font-size: 14px; + font-weight: 700; + margin: 75px auto; + outline: none; + padding: 10px; +} + +.dac-custom-search-load-more:hover { + opacity: 0.7; +} + +.dac-custom-search-no-results { + color: #999; +} + diff --git a/tools/droiddoc/templates-sac/assets/js/docs.js b/tools/droiddoc/templates-sac/assets/js/docs.js index 0c9378002..195c9e5f0 100644 --- a/tools/droiddoc/templates-sac/assets/js/docs.js +++ b/tools/droiddoc/templates-sac/assets/js/docs.js @@ -1630,7 +1630,10 @@ function search_changed(e, kd, toroot) } else { // otherwise, results are already showing, so allow ajax to auto refresh the results // and ignore this Enter press to avoid the reload. - return false; + // return false; + // + // For now, we're not using AJAX so we respond to every Enter. + return true; } } else if (kd && gSelectedIndex >= 0) { window.location = $("a",$('#search_filtered li')[gSelectedIndex]).attr("href"); @@ -1691,6 +1694,11 @@ function search_changed(e, kd, toroot) // Search for Google matches + /* + * Commented this out because GOOGLE_DATA not defined for us and code + * causes an error. This probably has to do with the missing + * gms_lists.js file in SAC. TODO figure it all out. + * for (var i=0; i').text('No results')); + return; + } + + for (var i = 0; i < results.items.length; i++) { + var item = results.items[i]; + // No thumbnail images in SAC. + // var hasImage = item.pagemap && item.pagemap.cse_thumbnail; + var sectionMatch = item.link.match(/source\.android\.com\/(\w*)/); + var section = (sectionMatch && sectionMatch[1]) || 'blog'; + + var entry = $('
').addClass('dac-custom-search-entry cols'); + +// No thumbnail images in SAC. +// if (hasImage) { +// var image = item.pagemap.cse_thumbnail[0]; +// entry.append($('
').addClass('col-1of6') +// .append($('
').addClass('dac-custom-search-image').css('background-image', 'url(' + image.src + ')'))); +// } +// entry.append($('
').addClass(hasImage ? 'col-5of6' : 'col-6of6') + entry.append($('
') + .append($('

').addClass('dac-custom-search-section').text(section)) + .append( + $('').text(item.title).attr('href', item.link).wrap('

').parent().addClass('dac-custom-search-title') + ) + .append($('

').addClass('dac-custom-search-snippet').html(item.htmlSnippet.replace(/
/g, ''))) + .append($('
').addClass('dac-custom-search-link').text(item.formattedUrl).attr('href', item.link))); + + el.append(entry); + } + + if (results.queries.nextPage) { + var loadMoreButton = $('