summaryrefslogtreecommitdiffstats
path: root/tools/droiddoc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/droiddoc')
-rw-r--r--tools/droiddoc/templates-sdk/assets/css/default.css9
-rw-r--r--tools/droiddoc/templates-sdk/assets/js/docs.js44
-rw-r--r--tools/droiddoc/templates-sdk/components/masthead.cs50
-rw-r--r--tools/droiddoc/templates-sdk/customizations.cs4
-rw-r--r--tools/droiddoc/templates-sdk/docpage.cs8
-rw-r--r--tools/droiddoc/templates-sdk/head_tag.cs15
6 files changed, 95 insertions, 35 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css
index 96259a7..8cfb45d 100644
--- a/tools/droiddoc/templates-sdk/assets/css/default.css
+++ b/tools/droiddoc/templates-sdk/assets/css/default.css
@@ -3152,6 +3152,7 @@ div#deprecatedSticker {
-webkit-box-shadow:-5px 5px 10px #ccc;
}
+div#langMessage,
div#naMessage {
display:none;
width:555px;
@@ -3159,6 +3160,8 @@ div#naMessage {
margin:0 auto;
}
+
+div#langMessage>div,
div#naMessage div {
z-index:99;
width:450px;
@@ -3172,12 +3175,16 @@ div#naMessage div {
-webkit-box-shadow:-10px 10px 40px #888;
}
/* IE6 can't position fixed */
+* html div#langMessage>div,
* html div#naMessage div { position:absolute; }
div#naMessage strong {
font-size:1.1em;
}
+div#langMessage .lang {
+ display:none;
+}
/* --------------------------------------------------------------------------
Slideshow Controls & Next/Prev
@@ -7389,4 +7396,4 @@ a.home-new-cta-btn:hover,
.resource-card-6x2 > .card-bg.helpouts-card-bg:after {
display:none;
-} \ No newline at end of file
+}
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index a556f4f..a3c24f4 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -20,6 +20,17 @@ $.ajaxSetup({
/****** ON LOAD SET UP STUFF *********/
$(document).ready(function() {
+
+ // show lang dialog if the URL includes /intl/
+ //if (location.pathname.substring(0,6) == "/intl/") {
+ // var lang = location.pathname.split('/')[2];
+ // if (lang != getLangPref()) {
+ // $("#langMessage a.yes").attr("onclick","changeLangPref('" + lang
+ // + "', true); $('#langMessage').hide(); return false;");
+ // $("#langMessage .lang." + lang).show();
+ // $("#langMessage").show();
+ // }
+ //}
// load json file for JD doc search suggestions
$.getScript(toRoot + 'jd_lists_unified.js');
@@ -658,7 +669,7 @@ function toggleFullscreen(enable) {
setTimeout(updateSidenavFixedWidth,delay); // need to wait a moment for css to switch
enabled = false;
}
- writeCookie("fullscreen", enabled, null, null);
+ writeCookie("fullscreen", enabled, null);
setNavBarLeftPos();
resizeNav(delay);
updateSideNavPosition();
@@ -819,7 +830,7 @@ function reInitScrollbars() {
function saveNavPanels() {
var basePath = getBaseUri(location.pathname);
var section = basePath.substring(1,basePath.indexOf("/",1));
- writeCookie("height", resizePackagesNav.css("height"), section, null);
+ writeCookie("height", resizePackagesNav.css("height"), section);
}
@@ -900,16 +911,12 @@ function readCookie(cookie) {
return 0;
}
-function writeCookie(cookie, val, section, expiration) {
+function writeCookie(cookie, val, section) {
if (val==undefined) return;
section = section == null ? "_" : "_"+section+"_";
- if (expiration == null) {
- var date = new Date();
- date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week
- expiration = date.toGMTString();
- }
+ var age = 2*365*24*60*60; // set max-age to 2 years
var cookieValue = cookie_namespace + section + cookie + "=" + val
- + "; expires=" + expiration+"; path=/";
+ + "; max-age=" + age +"; path=/";
document.cookie = cookieValue;
}
@@ -1149,9 +1156,7 @@ function swapNav() {
nav_pref = NAV_PREF_TREE;
init_default_navtree(toRoot);
}
- var date = new Date();
- date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
- writeCookie("nav", nav_pref, "reference", date.toGMTString());
+ writeCookie("nav", nav_pref, "reference");
$("#nav-panels").toggle();
$("#panel-link").toggle();
@@ -1219,11 +1224,7 @@ function changeNavLang(lang) {
}
function changeLangPref(lang, submit) {
- var date = new Date();
- expires = date.toGMTString(date.setTime(date.getTime()+(10*365*24*60*60*1000)));
- // keep this for 50 years
- //alert("expires: " + expires)
- writeCookie("pref_lang", lang, null, expires);
+ writeCookie("pref_lang", lang, null);
// ####### TODO: Remove this condition once we're stable on devsite #######
// This condition is only needed if we still need to support legacy GAE server
@@ -1988,7 +1989,7 @@ function search_changed(e, kd, toroot)
// Search for matching JD docs
- if (text.length >= 3) {
+ if (text.length >= 2) {
// Regex to match only the beginning of a word
var textRegex = new RegExp("\\b" + text.toLowerCase(), "g");
@@ -2732,10 +2733,7 @@ function changeApiLevel() {
selectedLevel = parseInt($("#apiLevelSelector option:selected").val());
toggleVisisbleApis(selectedLevel, "body");
- var date = new Date();
- date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
- var expiration = date.toGMTString();
- writeCookie(API_LEVEL_COOKIE, selectedLevel, null, expiration);
+ writeCookie(API_LEVEL_COOKIE, selectedLevel, null);
if (selectedLevel < minLevel) {
var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class";
@@ -4216,4 +4214,4 @@ function showSamples() {
}
}
}
-})(); \ No newline at end of file
+})();
diff --git a/tools/droiddoc/templates-sdk/components/masthead.cs b/tools/droiddoc/templates-sdk/components/masthead.cs
index 2dde104..d07b378 100644
--- a/tools/droiddoc/templates-sdk/components/masthead.cs
+++ b/tools/droiddoc/templates-sdk/components/masthead.cs
@@ -3,6 +3,52 @@
<?cs call:preview_masthead() ?>
<?cs else ?>
<a name="top"></a>
+
+<!-- dialog to prompt lang pref change when loaded from hardcoded URL
+<div id="langMessage" style="display:none">
+ <div>
+ <div class="lang en">
+ <p>You requested a page in English, would you like to proceed with this language setting?</p>
+ </div>
+ <div class="lang es">
+ <p>You requested a page in Spanish (Español), would you like to proceed with this language setting?</p>
+ </div>
+ <div class="lang ja">
+ <p>You requested a page in Japanese (日本語), would you like to proceed with this language setting?</p>
+ </div>
+ <div class="lang ko">
+ <p>You requested a page in Korean (한국어), would you like to proceed with this language setting?</p>
+ </div>
+ <div class="lang ru">
+ <p>You requested a page in Russian (Русский), would you like to proceed with this language setting?</p>
+ </div>
+ <div class="lang zh-cn">
+ <p>You requested a page in Simplified Chinese (简体中文), would you like to proceed with this language setting?</p>
+ </div>
+ <div class="lang zh-tw">
+ <p>You requested a page in Traditional Chinese (繁體中文), would you like to proceed with this language setting?</p>
+ </div>
+ <a href="#" class="button yes" onclick="return false;">
+ <span class="lang en">Yes</span>
+ <span class="lang es">Sí</span>
+ <span class="lang ja">Yes</span>
+ <span class="lang ko">Yes</span>
+ <span class="lang ru">Yes</span>
+ <span class="lang zh-cn">是的</span>
+ <span class="lang zh-tw">没有</span>
+ </a>
+ <a href="#" class="button" onclick="$('#langMessage').hide();return false;">
+ <span class="lang en">No</span>
+ <span class="lang es">No</span>
+ <span class="lang ja">No</span>
+ <span class="lang ko">No</span>
+ <span class="lang ru">No</span>
+ <span class="lang zh-cn">没有</span>
+ <span class="lang zh-tw">没有</span>
+ </a>
+ </div>
+</div> -->
+
<?cs if:!devsite ?><?cs # leave out the global header for devsite; it is in devsite template ?>
<!-- Header -->
<div id="header-wrapper">
@@ -160,6 +206,7 @@
<div class="wrap" style="position:relative;z-index:1">
<?cs if:reference ?>
+ <?cs # HIDE HELPOUTS RECRUIT BANNER
<a id="helpoutsLink" class="resource resource-card resource-card-6x2x3 resource-card-6x2 helpouts-card"
href="http://helpouts.google.com/partner/landing/provider/googledevelopers" target="_blank">
<div class="card-bg helpouts-card-bg"></div>
@@ -185,6 +232,7 @@
$("span#helpoutsLinkText").text(textB);
}
</script>
+ END HIDE HELPOUTS ?>
<?cs /if ?>
<ul class="nav-x col-9 develop" style="width:100%">
@@ -346,4 +394,4 @@ color:#666;font-weight:100;font-size:27px;">L Developer Preview</h1></div>
?>
-<?cs /def ?> \ No newline at end of file
+<?cs /def ?>
diff --git a/tools/droiddoc/templates-sdk/customizations.cs b/tools/droiddoc/templates-sdk/customizations.cs
index e0e3ca1..03e5079 100644
--- a/tools/droiddoc/templates-sdk/customizations.cs
+++ b/tools/droiddoc/templates-sdk/customizations.cs
@@ -449,8 +449,8 @@ def:header_search_widget() ?>
<option value="ja">日本語</option>
<option value="ko">한국어</option>
<option value="ru">Русский</option>
- <option value="zh-cn">中文 (中国)</option>
- <option value="zh-tw">中文 (台灣)</option>
+ <option value="zh-cn">中文(简体)</option>
+ <option value="zh-tw">中文(繁體)</option>
</select>
</div>
<script type="text/javascript">
diff --git a/tools/droiddoc/templates-sdk/docpage.cs b/tools/droiddoc/templates-sdk/docpage.cs
index 7cd9d43..a5440d4 100644
--- a/tools/droiddoc/templates-sdk/docpage.cs
+++ b/tools/droiddoc/templates-sdk/docpage.cs
@@ -194,10 +194,10 @@ include:"header.cs" ?>
<?cs include:"trailer.cs" ?>
<script src="https://developer.android.com/ytblogger_lists_unified.js" type="text/javascript"></script>
- <script src="<?cs var:toroot ?>jd_lists_unified.js?v=3" type="text/javascript"></script>
- <script src="<?cs var:toroot ?>jd_extras.js?v=4" type="text/javascript"></script>
- <script src="<?cs var:toroot ?>jd_collections.js?v=4" type="text/javascript"></script>
- <script src="<?cs var:toroot ?>jd_tag_helpers.js?v=3" type="text/javascript"></script>
+ <script src="<?cs var:toroot ?>jd_lists_unified.js?v=7" type="text/javascript"></script>
+ <script src="<?cs var:toroot ?>jd_extras.js?v=8" type="text/javascript"></script>
+ <script src="<?cs var:toroot ?>jd_collections.js?v=8" type="text/javascript"></script>
+ <script src="<?cs var:toroot ?>jd_tag_helpers.js?v=5" type="text/javascript"></script>
</body>
</html>
diff --git a/tools/droiddoc/templates-sdk/head_tag.cs b/tools/droiddoc/templates-sdk/head_tag.cs
index 7ecb7f9..005bb8e 100644
--- a/tools/droiddoc/templates-sdk/head_tag.cs
+++ b/tools/droiddoc/templates-sdk/head_tag.cs
@@ -24,8 +24,8 @@
<meta name="Description" content="<?cs var:page.metaDescription ?>"><?cs
/if ?>
<link rel="shortcut icon" type="image/x-icon" href="<?cs var:toroot ?>favicon.ico" />
-<title><?cs
- if:page.title ?><?cs
+<title><?cs
+ if:page.title ?><?cs
var:page.title ?> | <?cs
/if ?>Android Developers</title>
@@ -38,7 +38,7 @@ if:android.whichdoc != 'online' ?>http:<?cs
if:android.whichdoc != 'online' ?>http:<?cs
/if ?>//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
title="roboto">
-<link href="<?cs var:toroot ?>assets/css/default.css?v=2" rel="stylesheet" type="text/css">
+<link href="<?cs var:toroot ?>assets/css/default.css?v=3" rel="stylesheet" type="text/css">
<?cs if:reference && !(reference.gms || reference.gcm || preview) ?>
<!-- FULLSCREEN STYLESHEET -->
@@ -62,7 +62,14 @@ else
var metaTags = [<?cs var:meta.tags ?>];
var devsite = <?cs if:devsite ?>true<?cs else ?>false<?cs /if ?>;
</script>
-<script src="<?cs var:toroot ?>assets/js/docs.js?v=2" type="text/javascript"></script>
+<script src="<?cs var:toroot ?>assets/js/docs.js?v=3" type="text/javascript"></script>
+
+<?cs if:helpoutsWidget ?>
+<script type="text/javascript" src="https://helpouts.google.com/ps/res/embed.js" defer async
+ data-helpouts-embed data-helpouts-vertical="programming"
+ data-helpouts-tags="<?cs var:page.tags ?>" data-helpouts-prefix="android"
+ data-helpouts-standalone="true"></script>
+<?cs /if ?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){