diff options
Diffstat (limited to 'tools/droiddoc/templates')
30 files changed, 1396 insertions, 812 deletions
diff --git a/tools/droiddoc/templates/assets/android-developer-core.css b/tools/droiddoc/templates/assets/android-developer-core.css index 3fb6960..eeedc7f 100644 --- a/tools/droiddoc/templates/assets/android-developer-core.css +++ b/tools/droiddoc/templates/assets/android-developer-core.css @@ -4,12 +4,23 @@ info: core developer styles (developer.android.com) */ -@import url("http://www.google.com/css/goog.css"); -@import url("http://www.google.com/css/inlay.css"); + +/* RESET STYLES */ + +html,body,div,h1,h2,h3,h4,h5,h6,p,img, +dl,dt,dd,ol,ul,li,table,caption,tbody, +tfoot,thead,tr,th,td,form,fieldset, +embed,object,applet { + margin: 0; + padding: 0; + border: 0; +} /* BASICS */ body { + font-family:arial,sans-serif; + color:#000; font-size:13px; color:#333; overflow:hidden; @@ -19,17 +30,47 @@ body { background-repeat:repeat-x; } +a, a code { + color:#00c; +} + +a:active, +a:active code { + color:#f00; +} + +a:visited, +a:visited code { + color:#551a8b; +} + +input, select, +textarea, option { + font-family:inherit; + font-size:inherit; +} + +p { + padding:0; + margin:0 0 1em; +} + code, pre { color:#007000; font-family:monospace; line-height:1em; } +var { + color:#007000; + font-style:italic; +} + pre { - border:1px solid #5B7957; + border:1px solid #ccc; background-color:#fafafa; padding:10px; - margin:0 0 1em; + margin:0 0 1em 1em; overflow:auto; } @@ -43,55 +84,66 @@ p,ul,ol,dl,dd,dt,li { } ul,ol { - margin:0; - padding:0 0 1em 2em; + margin:0 0 .8em; + padding:0 0 0 2em; +} + +li { + padding:0 0 .5em; } dl { - margin:0; + margin:0 0 1em 0; padding:0; } dt { - font-weight:bold; margin:0; - padding:0 0 .5em; + padding:0; } dd { - font-weight:normal; - margin:0; - padding:0 0 .5em 1em; + margin:0 0 1em; + padding:0 0 0 2em; } -li p, li pre, li table, li img, -dd p, dd pre, dd table, dd img { - margin:.5em 0 0; +li p, dd p { + margin:1em 0 0; } -li { - padding:0 0 .5em; +li pre, li table, li img, +dd pre, dd table, dd img { + margin:1em 0 0 1em; } li ul, li ol { - padding: .5em 0 0 2em; + margin:.5em 0 0 0; + padding: 0 0 0 2em; } -dl dl { - padding:.5em 0 0; +dl li { + padding:.5em 0 0 0; } -li p { +dl dl, +ol dl, +ul dl { + margin:0 0 1em; padding:0; } table { + font-size:1em; margin:0 0 1em; + padding:0; + border-collapse:collapse; + border-width:0; + empty-cells:show; } td,th { - border:1px solid #666; + border:1px solid #ccc; padding:6px 12px; text-align:left; vertical-align:top; @@ -99,17 +151,7 @@ td,th { } th { - background-color:#ccc; -} - -a code { - color:#00c; -} -a:active code { - color:#f00; -} -a:visited code { - color:#551a8b; + background-color:#dee8f1; } hr.blue { @@ -124,6 +166,7 @@ hr.blue { margin:0; position:fixed; top:103px; + width:100%; } #header { @@ -131,25 +174,21 @@ hr.blue { height: 100px; position:relative; z-index:100; - min-width:730px; -} - -#header img { - padding:0; + min-width:620px; } #headerLeft{ - float:left; + position:absolute; border:none; - width:1px; margin:20px 0 0 10px; overflow:visible; + font-size: 36px; } #headerRight { float:right; border:none; - width:715px; + width:615px; height:100px; } @@ -162,10 +201,11 @@ hr.blue { height: 32px; position:absolute; bottom:0; + right:0; } #header li { - float: right; + float: left; margin: 0px 5px 0px 0px; padding:0; } @@ -180,9 +220,8 @@ hr.blue { font-weight: normal; width: 96px; height: 32px; - padding-top: 9px; text-align: center; - margin: 0px 0px 0px 0px; + margin: 0px; } #header li a:hover { @@ -191,18 +230,34 @@ hr.blue { color: #fff; } +#header li a span { + position:relative; + top:9px; +} + /* TAB HIGHLIGHTING */ -.home #home-link, -.publish #publish-link, -.guide #guide-link, -.reference #reference-link, -.sdk #sdk-link, -.community #community-link, -.about #about-link { +.home #home-link a, +.publish #publish-link a, +.guide #guide-link a, +.reference #reference-link a, +.sdk #sdk-link a, +.community #community-link a, +.about #about-link a { background-image: url(images/tab_selected.png); background-repeat: no-repeat; color: #fff; font-weight: bold; + cursor:default; +} + +.home #home-link a:hover, +.publish #publish-link a:hover, +.guide #guide-link a:hover, +.reference #reference-link a:hover, +.sdk #sdk-link a:hover, +.community #community-link a:hover, +.about #about-link a:hover { + background-image: url(images/tab_selected.png); } #headerLinks { @@ -234,10 +289,9 @@ hr.blue { /* main */ #mainBodyFixed { - float: left; - margin: 20px; + margin: 20px auto; color: #333; - min-width:920px; + width:920px; } #mainBodyFixed h3 { @@ -254,7 +308,14 @@ hr.blue { padding-bottom:.5em; } -#mainBodyFixed .green { +#mainBodyFixed h1 { + color:#435A6E; + font-size:1.7em; + margin: 1em 0; +} + +#mainBodyFixed .green, +#jd-content .green { color:#7BB026; background-color:none; } @@ -322,7 +383,7 @@ div.indent { text-align:left; } -#mainBodyRight td.blueBorderBox { +#mainBodyRight .blueBorderBox { border:5px solid #ddf0f2; padding:18px 18px 18px 18px; text-align:left; @@ -389,28 +450,25 @@ div.indent { } .groupTable { - width: 95%; + width: 100%; } .groupTable th { - padding: 10px 20px 10px 20px; + padding: 10px; color: #ffffff; background-color: #6D8293; border: 2px solid #fff; } -.groupTable .oddRow td { - padding: 20px 28px 20px 28px; +.groupTable td { + padding: 10px; color: #333333; background-color: #d9d9d9; border: 2px solid #fff; } .groupTable .evenRow td { - padding: 20px 28px 20px 28px; - color: #333333; background-color: #ededed; - border: 2px solid #fff; } span.BigBlue { @@ -496,7 +554,7 @@ vertical-align: bottom; color:#0000cc; } #search_filtered .jd-selected { - background-color: #7BB026; + background-color: #A4C639; cursor:pointer; } #search_filtered .jd-selected, @@ -514,10 +572,10 @@ vertical-align: bottom; padding-right: 6px; padding-top: 1px; padding-bottom: 1px; - font-size: 80%; + font-size: .8em; border: none; margin: 0; - line-height: 105%; + line-height: 1.05em; } .show-row { @@ -608,7 +666,7 @@ input.gsc-input { border:1px solid #BCCDF0; width:99%; padding-left:2px; - font-size:95%; + font-size:.95em; } td.gsc-search-button { @@ -721,17 +779,19 @@ div#app-list { #app-list img { width:90px; height:70px; - padding:0; + margin:0; } #app-list a.selected, -.app-list a:active.selected, -.app-list a:hover.selected { +#app-list a:active.selected, +#app-list a:hover.selected { background:#A4C639; color:#fff; + cursor:default; + text-decoration:none; } #app-list a:hover, -.app-list a:active { +#app-list a:active { background:#ff9900; text-decoration:underline; } @@ -751,7 +811,7 @@ div#app-list { } #carouselMain img { - padding:0; + margin:0; } /*carousel bulletin layouts*/ @@ -792,3 +852,4 @@ div#app-list { } + diff --git a/tools/droiddoc/templates/assets/android-developer-docs-devguide.css b/tools/droiddoc/templates/assets/android-developer-docs-devguide.css new file mode 100644 index 0000000..d8bd3b3 --- /dev/null +++ b/tools/droiddoc/templates/assets/android-developer-docs-devguide.css @@ -0,0 +1,19 @@ + +@import url("android-developer-docs.css"); + +/* Page title */ + +#jd-header h1 { + padding: 8px 0 0 0; +} + +/* Page content container */ + +#jd-header table { +margin: 0 0 1em 1em; +} + +#jd-content table table, +#jd-content table img { + margin:1em 0; +}
\ No newline at end of file diff --git a/tools/droiddoc/templates/assets/android-developer-docs.css b/tools/droiddoc/templates/assets/android-developer-docs.css index 5be4df0..cfbcc75 100755..100644 --- a/tools/droiddoc/templates/assets/android-developer-docs.css +++ b/tools/droiddoc/templates/assets/android-developer-docs.css @@ -15,7 +15,7 @@ color:#336666; margin:0; padding: 5px 10px; - font-size: 100%; + font-size: 1em; line-height: 15px; } @@ -26,29 +26,23 @@ padding:0 0 0 15px; } -#crumb { - font-size:95%; - padding:5px 20px; - float:right; - color:#336666; -} - /* SIDE NAVIGATION */ #side-nav { padding:0 6px 0 0; background-color: #fff; + font-size:12px; } #resize-packages-nav { /* keeps the resize handle below the h-scroll handle */ - height:200px; + height:270px; overflow:hidden; max-height:100%; } #packages-nav { - height:200px; + height:270px; max-height:inherit; position:relative; overflow:auto; @@ -57,6 +51,7 @@ #classes-nav, #devdoc-nav { overflow:auto; + position:relative; } #side-nav ul { @@ -66,25 +61,30 @@ } #side-nav ul ul { - margin: 0; + margin: .35em 0 0 0; padding: 0; } #side-nav li { - padding: 1px 0 2px 0; - line-height:1.1em; + padding:0; + line-height:16px; white-space:nowrap; } #side-nav li h2 { - font-size: 100%; + font-size:12px; font-weight: bold; - margin: 0; - padding: 8px 0 0 10px; + margin:.5em 0 0 0; + padding: 3px 0 1px 9px; } #side-nav li a { - padding: 0 0 0 11px; + text-decoration:none; + padding: 0 0 0 18px; +} + +#side-nav li a:hover { + text-decoration:underline; } #side-nav li a+a { @@ -93,23 +93,55 @@ #side-nav li li li a { /*sdk lists*/ - padding: 0 0 0 25px; + padding: 0 0 0 28px; } #side-nav .selected { - background-color: #97a2ac; + background-color: #435a6e; color: #fff; font-weight:bold; } #side-nav .selected a { color: #fff; + text-decoration:none; } #side-nav strong { display:block; } +#side-nav .toggle-img { + margin:0; + padding:0; + position:absolute; + top:0; + left:0; + height:16px; + width:15px; + outline-style:none; +} + +#side-nav .closed .toggle-img { + background:url('images/triangle-closed-small.png') 7px 4px no-repeat; +} +#side-nav .open .toggle-img { + background:url('images/triangle-opened-small.png') 7px 4px no-repeat; +} + +#side-nav .toggle-list { + position:relative; +} + +#side-nav .toggle-list ul { + margin:0; + display:none; +} + +#side-nav .toggle-list div { + display:block; +} + #index-links .selected { background-color: #fff; color: #000; @@ -121,6 +153,53 @@ padding:7px 0 4px 10px; } +/* nav tree */ + +#nav-tree ul { + padding:5px 0 1.5em; +} + +#side-nav #nav-tree ul li a, +#side-nav #nav-tree ul li span.no-children { + padding: 0 0 0 0; + margin: 0; +} + +#nav-tree .plus { + margin: 0 3px 0 0; +} + +#nav-tree ul ul { + list-style: none; + margin: 0; + padding: 0 0 0 0; +} + +#nav-tree ul li { + margin: 0; + padding: 0 0 0 0; + white-space: nowrap; +} + +#nav-tree .children_ul { + margin:0; +} + +#nav-tree a.nolink { + color: black; + text-decoration: none; +} + +#nav-tree span.label { + width: 100%; +} + +#nav-tree { + overflow-x: auto; + overflow-y: scroll; +} + + /* DOCUMENT BODY */ #doc-content { @@ -128,13 +207,29 @@ } #jd-header { - background-color: #9bb0c3; - padding: 10px 20px; + background-color: #E9E9E9; + padding: 7px 20px; } #jd-header h1 { margin: 0 0 10px; - font-size:160%; + font-size:1.7em; +} + +#jd-header .crumb { + font-size:.9em; + line-height:1em; + color:#777; +} + +#jd-header .crumb a, +#jd-header .crumb a:visited { + text-decoration:none; + color:#777; +} + +#jd-header .crumb a:hover { + text-decoration:underline; } #jd-header table { @@ -148,13 +243,22 @@ vertical-align:top; } +#jd-header.guide-header { + background-color:#fff; + color:#435a6e; + height:50px; +} + +#jd-descr { + position:relative; +} /* inheritance table */ .jd-inheritance-table { border-spacing:0; margin:0; padding:0; - font-size:90%; + font-size:.9em; } .jd-inheritance-table td { border: none; @@ -170,7 +274,7 @@ } #jd-content { - padding: 12px 20px; + padding: 18px 20px; } hr { @@ -181,51 +285,60 @@ hr { #jd-content h1 { /*sdk page*/ - font-size:160%; + font-size:1.6em; color:#336666; margin:0 0 .5em; } #jd-content h2 { - font-size:140%; - background-color: #97a2ac; - border-right:20px solid #97a2ac; - position:relative; - left:-20px; - width:100%; - padding: 8px 0 8px 20px; - z-index:-1; + font-size:1.45em; + color:#111; + border-top:2px solid #ccc; + padding: .5em 0 0; + margin: 1.75em 0 1em 0; + max-width:968px; } #jd-content h3 { - font-size:130%; - border-top: 3px solid #97a2ac; - padding:3px 0 5px; + font-size:1.2em; + color:#222; + padding: .75em 0 .65em 0; + margin:0; } #jd-content h4 { - font-size:110%; + font-size:1.1em; margin-bottom:.5em; + color:#222; +} + +#jd-content .small-header { + font-size:1em; + color:#000; + font-weight:bold; + border:none; + padding:0; + margin:1em 0 .5em; + position:inherit; } -img { - padding:0 0 1em 0; +#jd-content img { + margin: 0 0 1em 1em; } #jd-content li img, #jd-content dd img { - margin:.5em 0 0; - padding:0; + margin:.5em 0 0 1em; } .nolist { list-style:none; - padding:0 0 1em; - margin:0 0 0 1em; + padding:0; + margin:0 0 1em 1em; } h4 .normal { - font-size:90%; + font-size:.9em; font-weight:normal; } @@ -244,7 +357,7 @@ h4 .normal { } h4.jd-details-title { - font-size:115%; + font-size:1.15em; background-color: #d6d6d6; margin:0 0 .6em; padding:3px; @@ -275,43 +388,9 @@ h4.jd-tagtitle { font-style:italic; } -.sidebox-wrapper { - float: right; - width:300px; - background-color:#fff; - padding-left:15px; -} - -.sidebox-inner { - border-left:2px solid #7BB026; - padding:0 5px 0 15px; -} - -.sidebox { - float: right; - width:300px; - background-color:#fff; - border-left:2px solid #7BB026; - margin-left:15px; - padding:0 5px 0 15px; -} - -#jd-content .sidebox h2, -#jd-content .sidebox h3, -#jd-content .sidebox-inner h2, -#jd-content .sidebox-inner h3 { - background-color:#fff; - border:none; - font-size:110%; - margin:0; - padding:0 0 10px; - left:0; - z-index:0; -} - #jd-content table h2 { background-color: #d6d6d6; - font-size: 110%; + font-size: 1.1em; margin:0 0 10px; padding:5px; left:0; @@ -319,25 +398,46 @@ h4.jd-tagtitle { } div.special { - padding: 10px 25px 0; + padding: 15px 20px 3px; margin: 0 0 1em; background-color: #ddf0f2; } +div.special p { + margin: .25em 0; +} + +div.special ol { + margin: 0; +} + +div.special ol li { + margin: 0; + padding: 0; +} + +#jd-content div.special h2, #jd-content div.special h3 { color:#669999; - font-size:120%; + font-size:1.2em; border:none; margin:0 0 .5em; + padding:0; } -p.note, p.caution, p.warning { +/* old p.note, p.caution, p.warning { margin:0 0 1em; padding: 4px 10px; background-color: #efefef; border-top: 1px solid; border-bottom: 1px solid; } +*/ +p.note, p.caution, p.warning { + margin: 1em; + padding: 0 0 0 .5em; + border-left: 4px solid; +} p.special-note { background-color:#EBF3DB; @@ -346,7 +446,7 @@ p.special-note { } p.note { - border-color: #3366CC; + border-color: #99aacc; } p.caution { @@ -369,37 +469,208 @@ li p.note, li p.warning, li p.caution { dl.xml dt { font-variant:small-caps; + font-size:1.2em; +} + +dl.xml dl { + padding:0; +} + +dl.xml dl dt { + font-variant:normal; + font-size:1em; +} + +.listhead li { + font-weight: bold; +} + +.listhead li *, /*ie*/.listhead li li { + font-weight: normal; +} + +ol.no-style, +ul.no-style { + list-style:none; + padding-left:1em; } .new { - font-size: 78%; + font-size: .78em; font-weight: bold; color: red; text-decoration: none; } +pre.classic { + background-color:transparent; + border:none; + padding:0; +} + + +/* BEGIN quickview sidebar element styles */ + +#qv-wrapper { + float: right; + position:relative; + width:315px; + background-color:#fff; + padding:4px 30px 15px 20px; + top:-55px; + left:20px; +} + +#qv { + background-color:#fff; + border:4px solid #dee8f1; + margin:0 0 0 15px; + padding:0 6px 6px; + margin-top:0px; + width:295; + float:right; +} + +#qv ol { + list-style:none; + padding: 0; +} + +#qv ol ol{ + list-style:none; + padding: 0 0 3px 12px; + margin:0; +} + +#qv ul { + padding: 0 10px 0 2em; +} + +#qv li { + padding: 0 10px; + margin: 2 0 0; + line-height: 1.2em; +} + +#qv ul li { + padding: 0 10px 0 0; +} + +#qv li.selected a { + color:#555; + text-decoration:none; +} + +#qv a { + color:#cc6600; +} + +#qv p { + margin:8px 0 0; + padding:0 10px; +} + +#qv-extra #rule { + padding: 0 10px; + margin: 0; +} + +#qv-sub-rule { + padding: 6px 20px; + margin: 0; +} + +#qv-sub-rule p { + margin: 0; +} + +#jd-content #qv h2 { + font-size:1.05em; + font-weight:bold; + margin:12px 0 .25em 0; + padding:0 10px; + background-color:transparent; + color:#7BB026; + border:none; + left:0; + z-index:1; +} + +/* END quickview sidebar element styles */ + +/* Begin sidebox sidebar element styles */ + +.sidebox-wrapper { + float: right; + width:300px; + background-color:#fff; + margin: 0 0 0 15px; + padding: 5px 0 5px 15px; +} + +.sidebox-inner { + border-left:1px solid #dee8f1; + background-color:#ffffee; + padding:0 5px 0 15px; +} + +.sidebox { + float: right; + width:285px; + background-color:#ffffee; + border-left:1px solid #dee8f1; + margin: 0 0 0 15px; + padding:5px 8px 0 12px; +} + + +#jd-content .sidebox h2, +#jd-content .sidebox h3, +#jd-content .sidebox-inner h2, +#jd-content .sidebox-inner h3 { + border:none; + font-size:1em; + margin:0; + padding:4px 0 4px; + left:0; + z-index:0; +} + +.sidebox hr, +.sidebox-inner hr { + background-color:#ccc; + border:none; +} + +/* End sidebox sidebar element styles */ + /* table of contents */ ol.toc { - margin: 1em 0 0 0; + margin: 0 0 1em 0; padding: 0; list-style: none; + font-size:95%; } ol.toc li { font-weight: bold; - margin: .5em 0 0 1.5em; + margin: 0 0 .5em 1em; padding: 0; } +ol.toc li p { + font-weight: normal; +} + ol.toc li ol { margin: 0; padding: 0; } -ol.toc li ol li { +ol.toc li li { padding: 0; - margin: .1em 0 0 1em; + margin: 0 0 0 1em; font-weight: normal; list-style: none; } @@ -458,8 +729,8 @@ tr.alt-color { } /* expando trigger */ -.jd-expando-trigger { - padding:0; +#jd-content .jd-expando-trigger { + margin:0; } /* jd-expando */ @@ -487,7 +758,7 @@ table.download th { color:#fff; } -/* INLAY 240PX EXTENSION */ +/* INLAY 180 COPY and 240PX EXTENSION */ /* modified to 43px so that all browsers eliminate the package panel h-scroll */ .g-tpl-240 .g-unit, .g-unit .g-tpl-240 .g-unit, @@ -523,10 +794,45 @@ table.download th { float: right; } +/* 180px */ +.g-tpl-180 .g-unit, +.g-unit .g-tpl-180 .g-unit, +.g-unit .g-unit .g-tpl-180 .g-unit { + display: block; + margin: 0 0 0 180px; + width: auto; + float: none; +} +.g-unit .g-unit .g-tpl-180 .g-first, +.g-unit .g-tpl-180 .g-first, +.g-tpl-180 .g-first { + display: block; + margin: 0; + width: 180px; + float: left; +} +/* 180px alt */ +.g-tpl-180-alt .g-unit, +.g-unit .g-tpl-180-alt .g-unit, +.g-unit .g-unit .g-tpl-180-alt .g-unit { + display: block; + margin: 0 180px 0 0; + width: auto; + float: none; +} +.g-unit .g-unit .g-tpl-180-alt .g-first, +.g-unit .g-tpl-180-alt .g-first, +.g-tpl-180-alt .g-first { + display: block; + margin: 0; + width: 180px; + float: right; +} + /* JQUERY RESIZABLE STYLES */ .ui-resizable { position: relative; } -.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; } +.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; z-index:1; } .ui-resizable .ui-resizable-handle { display: block; } body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ @@ -538,24 +844,50 @@ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body body { overflow:visible; } + + #header { + height:60px; + } + + #headerLeft { + margin:0; + } + #headerRight { + display:none; + } + + #body-content { + position:inherit; + } + #side-nav { display:none; } #doc-content { - margin-left:0; - height:auto; - width:auto; + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; } #jd-header { - border-bottom:3px solid #9bb0c3; + padding:10px 0; } - #jd-content h2 { - border-top:2px solid #97a2ac; - border-bottom:2px solid #97a2ac; + #jd-content { + padding:15px 0 0; + } + + #footer { + float:none; + margin:2em 0 0; + } + + h4.jd-details-title { + border-bottom:1px solid #666; } pre { @@ -577,4 +909,9 @@ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body page-break-inside: avoid; } + #qv, + #qv-wrapper { + display:none; + } + }
\ No newline at end of file diff --git a/tools/droiddoc/templates/assets/android-developer-docs.js b/tools/droiddoc/templates/assets/android-developer-docs.js index 58da116..f2276ee 100644 --- a/tools/droiddoc/templates/assets/android-developer-docs.js +++ b/tools/droiddoc/templates/assets/android-developer-docs.js @@ -4,7 +4,12 @@ var devdocNav; var sidenav; var content; var HEADER_HEIGHT = 103; -var cookie_style = 'android_dev_docs'; +var cookie_style = 'android_developer'; +var NAV_PREF_TREE = "tree"; +var NAV_PREF_PANELS = "panels"; +var nav_pref; +var toRoot; + function addLoadEvent(newfun) { var current = window.onload; @@ -21,6 +26,10 @@ function addLoadEvent(newfun) { addLoadEvent(prepare); window.onresize = resizeAll; +function setToRoot(root) { + toRoot = root; +} + function restoreWidth(navWidth) { var windowWidth = $(window).width() + "px"; content.css({marginLeft:navWidth, width:parseInt(windowWidth) - parseInt(navWidth) + "px"}); @@ -32,12 +41,15 @@ function restoreWidth(navWidth) { function restoreHeight(packageHeight) { var windowHeight = ($(window).height() - HEADER_HEIGHT); + var swapperHeight = windowHeight - 13; + $("#swapper").css({height:swapperHeight + "px"}); sidenav.css({height:windowHeight + "px"}); content.css({height:windowHeight + "px"}); - resizePackagesNav.css({maxHeight:windowHeight + "px", height:packageHeight}); - classesNav.css({height:windowHeight - parseInt(packageHeight) + "px"}); + resizePackagesNav.css({maxHeight:swapperHeight + "px", height:packageHeight}); + classesNav.css({height:swapperHeight - parseInt(packageHeight) + "px"}); $("#packages-nav").css({height:parseInt(packageHeight) - 6 + "px"}); //move 6px to give space for the resize handle devdocNav.css({height:sidenav.css("height")}); + $("#nav-tree").css({height:swapperHeight + "px"}); } function getCookie(cookie) { @@ -47,6 +59,9 @@ function getCookie(cookie) { if (index != -1) { var valStart = index + myCookie.length; var valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } var val = document.cookie.substring(valStart, valEnd); return val; } @@ -54,9 +69,14 @@ function getCookie(cookie) { return 0; } -function writeCookie(cookie, val) { - if (location.href.indexOf("reference") != -1) { - document.cookie = cookie_style+'_'+cookie+'='+val+'; path=/gae/reference'; +function writeCookie(cookie, val, path, expiration) { + if (!val) return; + if (location.href.indexOf("/reference/") != -1) { + document.cookie = cookie_style+'_reference_'+cookie+'='+ val+'; path=' + toRoot + path + + ((expiration) ? '; expires=' + expiration : ''); + } else if (location.href.indexOf("/guide/") != -1) { + document.cookie = cookie_style+'_guide_'+cookie+'='+val+'; path=' + toRoot + path + + ((expiration) ? '; expires=' + expiration : ''); } } @@ -68,8 +88,14 @@ function prepare() { sidenav = $("#side-nav"); devdocNav = $("#devdoc-nav"); - var cookieWidth = getCookie('width'); - var cookieHeight = getCookie('height'); + + if (location.href.indexOf("/reference/") != -1) { + var cookiePath = "reference_"; + } else if (location.href.indexOf("/guide/") != -1) { + var cookiePath = "guide_"; + } + var cookieWidth = getCookie(cookiePath+'width'); + var cookieHeight = getCookie(cookiePath+'height'); if (cookieWidth) { restoreWidth(cookieWidth); } else { @@ -89,30 +115,43 @@ function prepare() { function highlightNav(fullPageName) { var lastSlashPos = fullPageName.lastIndexOf("/"); var firstSlashPos = fullPageName.indexOf("/",8); // first slash after http:// - if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (index.html) + if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (add 'index.html') fullPageName = fullPageName + "index.html"; } var htmlPos = fullPageName.lastIndexOf(".html", fullPageName.length); - var pageName = fullPageName.slice(firstSlashPos, htmlPos + 5); - var link = $("#devdoc-nav a[href$='"+pageName+"']"); - if (link.length == 0) { // if there's no match, maybe the nav url ends in a slash, also - link = $("#devdoc-nav a[href$='"+pageName.slice(0,pageName.indexOf("index.html"))+"']"); + var pathPageName = fullPageName.slice(firstSlashPos, htmlPos + 5); + var link = $("#devdoc-nav a[href$='"+ pathPageName+"']"); + if (link.length == 0) { // if there's no match, then the nav url must be the parent dir (ie, this doc isn't listed, so highlight the parent + link = $("#devdoc-nav a[href$='"+ pathPageName.slice(0, pathPageName.lastIndexOf("/") + 1)+"']"); } link.parent().addClass('selected'); + if (link.parent().parent().is(':hidden')) { + toggle(link.parent().parent().parent(), false); + } else if (link.parent().parent().hasClass('toggle-list')) { + toggle(link.parent().parent(), false); + } } function resizeHeight() { var windowHeight = ($(window).height() - HEADER_HEIGHT); + var swapperHeight = windowHeight - 13; + $("#swapper").css({height:swapperHeight + "px"}); sidenav.css({height:windowHeight + "px"}); content.css({height:windowHeight + "px"}); - resizePackagesNav.css({maxHeight:windowHeight + "px"}); - classesNav.css({height:windowHeight - parseInt(resizePackagesNav.css("height")) + "px"}); + resizePackagesNav.css({maxHeight:swapperHeight + "px"}); + classesNav.css({height:swapperHeight - parseInt(resizePackagesNav.css("height")) + "px"}); $("#packages-nav").css({height:parseInt(resizePackagesNav.css("height")) - 6 + "px"}); //move 6px for handle devdocNav.css({height:sidenav.css("height")}); - writeCookie("height", resizePackagesNav.css("height")); + $("#nav-tree").css({height:swapperHeight + "px"}); + writeCookie("height", resizePackagesNav.css("height"), "reference/", null); } function resizeWidth() { + if (location.href.indexOf("/reference/") != -1) { + var path = "reference/"; + } else if (location.href.indexOf("/guide/") != -1) { + var path = "guide/"; + } var windowWidth = $(window).width() + "px"; if (sidenav.length) { var sidenavWidth = sidenav.css("width"); @@ -123,7 +162,7 @@ function resizeWidth() { resizePackagesNav.css({width:sidenavWidth}); classesNav.css({width:sidenavWidth}); $("#packages-nav").css({width:sidenavWidth}); - writeCookie("width", sidenavWidth); + writeCookie("width", sidenavWidth, path, null); } function resizeAll() { @@ -131,14 +170,116 @@ function resizeAll() { resizeWidth(); } -//added to onload when the bottom-left panel is empty -function maxPackageHeight() { - var windowHeight = resizePackagesNav.css("maxHeight"); - resizePackagesNav.css({height:windowHeight}); - $("#packages-nav").css({height:windowHeight}); +function loadLast(cookiePath) { + var lastPage = getCookie(cookiePath + "_lastpage"); + if (lastPage) { + window.location = lastPage; + return false; + } + return true; } $(document).ready(function(){ $("#resize-packages-nav").resizable({handles: "s", resize: function(e, ui) { resizeHeight(); } }); $(".side-nav-resizable").resizable({handles: "e", resize: function(e, ui) { resizeWidth(); } }); -});
\ No newline at end of file +}); + +$(window).unload(function(){ + var href = location.href; + if (href.indexOf("/reference/") != -1) { + writeCookie("lastpage", href, "", null); + } else if (href.indexOf("/guide/") != -1) { + writeCookie("lastpage", href, "", null); + } +}); + + + + +function toggle(obj, slide) { + var ul = $("ul", obj); + var li = ul.parent(); + if (li.hasClass("closed")) { + if (slide) { + ul.slideDown("fast"); + } else { + ul.show(); + } + li.removeClass("closed"); + li.addClass("open"); + $(".toggle-img", li).attr("title", "hide pages"); + } else { + ul.slideUp("fast"); + li.removeClass("open"); + li.addClass("closed"); + $(".toggle-img", li).attr("title", "show pages"); + } +} + + + +function buildToggleLists() { + $(".toggle-list").each( + function(i) { + $("div", this).append("<a class='toggle-img' href='#' title='show pages' onClick='toggle(this.parentNode.parentNode, true); return false;'></a>"); + $(this).addClass("closed"); + }); +} + +function getNavPref() { + var v = getCookie('reference_nav'); + if (v != NAV_PREF_TREE) { + v = NAV_PREF_PANELS; + } + return v; +} + +function chooseDefaultNav() { + nav_pref = getNavPref(); + if (nav_pref == NAV_PREF_TREE) { + $("#nav-panels").toggle(); + $("#panel-link").toggle(); + $("#nav-tree").toggle(); + $("#tree-link").toggle(); + } +} + +function swapNav() { + if (nav_pref == NAV_PREF_TREE) { + nav_pref = NAV_PREF_PANELS; + } else { + nav_pref = NAV_PREF_TREE; + init_navtree("nav-tree", toRoot, NAVTREE_DATA); + } + 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()); + + $("#nav-panels").toggle(); + $("#panel-link").toggle(); + $("#nav-tree").toggle(); + $("#tree-link").toggle(); + + if ($("#nav-tree").is(':visible')) scrollIntoView("nav-tree"); + else { + scrollIntoView("packages-nav"); + scrollIntoView("classes-nav"); + } +} + +function scrollIntoView(nav) { + var navObj = $("#"+nav); + if (navObj.is(':visible')) { + var selected = $(".selected", navObj); + if (selected.length == 0) return; + + var scrolling = document.getElementById(nav); + var navHeight = navObj.height(); + var offset = selected.position(); + if(offset.top > navHeight - 92) { + scrolling.scrollTop = offset.top - navHeight + 92; + } + } +} + + diff --git a/tools/droiddoc/templates/assets/carousel.js b/tools/droiddoc/templates/assets/carousel.js index 9aecad7..dee3130 100755..100644 --- a/tools/droiddoc/templates/assets/carousel.js +++ b/tools/droiddoc/templates/assets/carousel.js @@ -1,291 +1,293 @@ -/* file: carousel.js
- date: oct 2008
- author: jeremydw,smain
- info: operates the carousel widget for announcements on
- the android developers home page. modified from the
- original market.js from jeremydw. */
-
-/* -- video switcher -- */
-
-var oldVid = "multi"; // set the default video
-var nowPlayingString = "Now playing:";
-var assetsRoot = "/gae/assets/";
-
-
-/* -- app thumbnail switcher -- */
-
-var currentDroid;
-var oldDroid;
-
-// shows a random application
-function randomDroid(){
-
- // count the total number of apps
- var droidListLength = 0;
- for (var k in droidList)
- droidListLength++;
-
- // pick a random app and show it
- var j = 0;
- var i = Math.floor(droidListLength*Math.random());
- for (var x in droidList) {
- if(j++ == i){
- currentDroid = x;
- showPreview(x);
- centerSlide(x);
- }
- }
-
-}
-
-// shows a bulletin, swaps the carousel highlighting
-function droid(appName){
-
- oldDroid = $("#droidlink-"+currentDroid);
- currentDroid = appName;
-
- var droid = droidList[appName];
- var layout = droid.layout;
- var imgDiv = document.getElementById("bulletinImg");
- var descDiv = document.getElementById("bulletinDesc");
-
- if (layout == "imgLeft") {
- imgDiv.className = "img-left";
- descDiv.className = "desc-right";
- } else if (layout == "imgTop") {
- imgDiv.className = "img-top";
- descDiv.className = "desc-bottom";
- } else if (layout == "imgRight") {
- imgDiv.className = "img-right";
- descDiv.className = "desc-left";
- }
-
- imgDiv.innerHTML = "<img src='" + assetsRoot + "images/home/" + droid.img + "'>";
- descDiv.innerHTML = (droid.title != "") ? "<h3>" + droid.title + "</h3>" + droid.desc : droid.desc;
-
- if(oldDroid)
- oldDroid.removeClass("selected");
-
- $("#droidlink-"+appName).addClass("selected");
-}
-
-
-// -- * build the carousel based on the droidList * -- //
-function buildCarousel() {
- var appList = document.getElementById("app-list");
- for (var x in droidList) {
- var droid = droidList[x];
- var icon = droid.icon;
- var name = droid.name;
- var a = document.createElement("a");
- var img = document.createElement("img");
- var br = document.createElement("br");
- var text = document.createTextNode(droid.name);
-
- a.setAttribute("id", "droidlink-" + x);
- a.className = x;
- a.setAttribute("href", "#");
- a.onclick = function() { showPreview(this.className); return false; }
- img.setAttribute("src", assetsRoot + "images/home/" + droid.icon);
- img.setAttribute("alt", "");
-
- a.appendChild(img);
- a.appendChild(br);
- a.appendChild(text);
- appList.appendChild(a);
- }
-}
-
-// -- * slider * -- //
-
-// -- dependencies:
-// (1) div containing slides, (2) a "clip" div to hide the scroller
-// (3) control arrows
-
-// -- * config below * -- //
-
-var slideCode = droidList; // the dictionary of slides
-var slideList = 'app-list'; // the div containing the slides
-var arrowRight = 'arrow-right'; // the right control arrow
-var arrowLeft = 'arrow-left'; // the left control arrow
-
-
-function showPreview(slideName) {
-// centerSlide(slideName);
- droid(slideName); // do this function when slide is clicked
-
-}
-
-var thumblist = document.getElementById(slideList);// the div containing the slides
-
-var slideWidth = 144; // width of a slide including all margins, etc.
-var slidesAtOnce = 3; // no. of slides to appear at once (requires odd number to have a centered slide)
-
-// -- * no editing should be needed below * -- //
-
-var originPosition = {};
-var is_animating = 0;
-var currentStripPosition = 0;
-var centeringPoint = 0;
-var rightScrollLimit = 0;
-
-// makeSlideStrip()
-// - figures out how many slides there are
-// - determines the centering point of the slide strip
-function makeSlideStrip() {
- var slideTotal = 0;
- centeringPoint = Math.ceil(slidesAtOnce/2);
- for (var x in slideCode) {
- slideTotal++;
- }
- var i = 0;
- for (var code in slideCode) {
- if (i <= centeringPoint-1) {
- originPosition[code] = 0;
- } else {
- if (i >= slideTotal-centeringPoint+1) {
- originPosition[code] = (slideTotal-slidesAtOnce)*slideWidth;
- } else {
- originPosition[code] = (i-centeringPoint+1)*slideWidth;
- }
- }
- i++;
- }
- rightScrollLimit = -1*(slideTotal-slidesAtOnce)*slideWidth;
-}
-
-// slides with acceleration
-function slide(goal, id, go_left, cp) {
- var div = document.getElementById(id);
- var animation = {};
- animation.time = 0.5; // in seconds
- animation.fps = 60;
- animation.goal = goal;
- origin = 0.0;
- animation.origin = Math.abs(origin);
- animation.frames = (animation.time * animation.fps) - 1.0;
- var current_frame = 0;
- var motions = Math.abs(animation.goal - animation.origin);
- function animate() {
- var ease_right = function (t) { return (1 - Math.cos(t * Math.PI))/2.0; };
- var ease = ease_right;
- if (go_left == 1) {
- ease = function(t) { return 1.0 - ease_right(t); };
- }
- var left = (ease(current_frame/animation.frames) * Math.abs(animation.goal - animation.origin)) - cp;
- if(left < 0) {
- left = 0;
- }
- if(!isNaN(left)) {
- div.style.left = '-' + Math.round(left) + 'px';
- }
- current_frame += 1;
- if (current_frame == animation.frames) {
- is_animating = 0;
- window.clearInterval(timeoutId)
- }
- }
- var timeoutId = window.setInterval(animate, animation.time/animation.fps * 1000);
-}
-
-//Get style property
-function getStyle(element, cssProperty){
- var elem = document.getElementById(element);
- if(elem.currentStyle){
- return elem.currentStyle[cssProperty]; //IE
- } else{
- var style = document.defaultView.getComputedStyle(elem, null); //firefox, Opera
- return style.getPropertyValue(cssProperty);
- }
-}
-
-// Left and right arrows
-function page_left() {
- var amount = slideWidth;
- animateSlide(amount, 'left');
-}
-
-function page_right() {
- var amount = slideWidth;
- animateSlide(amount, 'right');
-}
-
-
-// animates the strip
-// - sets arrows to on or off
-function animateSlide(amount,dir) {
- var currentStripPosition = parseInt(getStyle(slideList,'left'));
- var motionDistance;
- if (amount == slideWidth ) {
- motionDistance = slideWidth;
- } else {
- motionDistance = amount;
- }
-
- var rightarrow = document.getElementById(arrowRight);
- var leftarrow = document.getElementById(arrowLeft);
-
- function aToggle(state,aDir) {
- if (state == 'on') {
- if (aDir =='right') {
- rightarrow.className = 'arrow-right-on';
- rightarrow.href = "javascript:page_right()";
- } else {
- leftarrow.className = 'arrow-left-on';
- leftarrow.href = "javascript:page_left()";
- }
- } else {
- if (aDir =='right') {
- rightarrow.href = "javascript:{}";
- rightarrow.className = 'arrow-right-off';
- } else {
- leftarrow.href = "javascript:{}";
- leftarrow.className = 'arrow-left-off';
- }
- }
- }
-
- function arrowChange(rP) {
- if (rP >= rightScrollLimit) {
- aToggle('on','right');
- }
- if (rP <= rightScrollLimit) {
- aToggle('off','right');
- }
- if (rP <= slideWidth) {
- aToggle('on','left');
- }
- if (rP >= 0) {
- aToggle('off','left');
- }
- }
-
- if (dir == 'right' && is_animating == 0) {
- arrowChange(currentStripPosition-motionDistance);
- is_animating = 1;
- slide(motionDistance, slideList, 0, currentStripPosition);
- } else if (dir == 'left' && is_animating == 0) {
- arrowChange(currentStripPosition+motionDistance);
- is_animating = 1;
- rightStripPosition = currentStripPosition + motionDistance;
- slide(motionDistance, slideList, 1, rightStripPosition);
- }
-}
-
-function centerSlide(slideName) {
- var currentStripPosition = parseInt(getStyle(slideList,'left'));
- var dir = 'left';
- var originpoint = Math.abs(currentStripPosition);
- if (originpoint <= originPosition[slideName]) {
- dir = 'right';
- }
- var motionValue = Math.abs(originPosition[slideName]-originpoint);
- animateSlide(motionValue,dir);
-}
-
-
-function initCarousel(def) {
- buildCarousel();
- showPreview(def);
- makeSlideStrip();
-}
\ No newline at end of file +/* file: carousel.js + date: oct 2008 + author: jeremydw,smain + info: operates the carousel widget for announcements on + the android developers home page. modified from the + original market.js from jeremydw. */ + +/* -- video switcher -- */ + +var oldVid = "multi"; // set the default video +var nowPlayingString = "Now playing:"; +var assetsRoot = "/assets/"; + + +/* -- app thumbnail switcher -- */ + +var currentDroid; +var oldDroid; + +// shows a random application +function randomDroid(){ + + // count the total number of apps + var droidListLength = 0; + for (var k in droidList) + droidListLength++; + + // pick a random app and show it + var j = 0; + var i = Math.floor(droidListLength*Math.random()); + for (var x in droidList) { + if(j++ == i){ + currentDroid = x; + showPreview(x); + centerSlide(x); + } + } + +} + +// shows a bulletin, swaps the carousel highlighting +function droid(appName){ + + oldDroid = $("#droidlink-"+currentDroid); + currentDroid = appName; + + var droid = droidList[appName]; + var layout = droid.layout; + var imgDiv = document.getElementById("bulletinImg"); + var descDiv = document.getElementById("bulletinDesc"); + + if (layout == "imgLeft") { + imgDiv.className = "img-left"; + descDiv.className = "desc-right"; + } else if (layout == "imgTop") { + imgDiv.className = "img-top"; + descDiv.className = "desc-bottom"; + } else if (layout == "imgRight") { + imgDiv.className = "img-right"; + descDiv.className = "desc-left"; + } + + imgDiv.innerHTML = "<img src='" + assetsRoot + "images/home/" + droid.img + "'>"; + descDiv.innerHTML = (droid.title != "") ? "<h3>" + droid.title + "</h3>" + droid.desc : droid.desc; + + if(oldDroid) + oldDroid.removeClass("selected"); + + $("#droidlink-"+appName).addClass("selected"); +} + + +// -- * build the carousel based on the droidList * -- // +function buildCarousel() { + var appList = document.getElementById("app-list"); + for (var x in droidList) { + var droid = droidList[x]; + var icon = droid.icon; + var name = droid.name; + var a = document.createElement("a"); + var img = document.createElement("img"); + var br = document.createElement("br"); + var text = document.createTextNode(droid.name); + + a.setAttribute("id", "droidlink-" + x); + a.className = x; + a.setAttribute("href", "#"); + a.onclick = function() { showPreview(this.className); return false; } + img.setAttribute("src", assetsRoot + "images/home/" + droid.icon); + img.setAttribute("alt", ""); + + a.appendChild(img); + a.appendChild(br); + a.appendChild(text); + appList.appendChild(a); + } +} + +// -- * slider * -- // + +// -- dependencies: +// (1) div containing slides, (2) a "clip" div to hide the scroller +// (3) control arrows + +// -- * config below * -- // + +var slideCode = droidList; // the dictionary of slides +var slideList = 'app-list'; // the div containing the slides +var arrowRight = 'arrow-right'; // the right control arrow +var arrowLeft = 'arrow-left'; // the left control arrow + + +function showPreview(slideName) { +// centerSlide(slideName); + if (slideName.indexOf('selected') != -1) { + return false; + } + droid(slideName); // do this function when slide is clicked +} + +var thumblist = document.getElementById(slideList);// the div containing the slides + +var slideWidth = 144; // width of a slide including all margins, etc. +var slidesAtOnce = 3; // no. of slides to appear at once (requires odd number to have a centered slide) + +// -- * no editing should be needed below * -- // + +var originPosition = {}; +var is_animating = 0; +var currentStripPosition = 0; +var centeringPoint = 0; +var rightScrollLimit = 0; + +// makeSlideStrip() +// - figures out how many slides there are +// - determines the centering point of the slide strip +function makeSlideStrip() { + var slideTotal = 0; + centeringPoint = Math.ceil(slidesAtOnce/2); + for (var x in slideCode) { + slideTotal++; + } + var i = 0; + for (var code in slideCode) { + if (i <= centeringPoint-1) { + originPosition[code] = 0; + } else { + if (i >= slideTotal-centeringPoint+1) { + originPosition[code] = (slideTotal-slidesAtOnce)*slideWidth; + } else { + originPosition[code] = (i-centeringPoint+1)*slideWidth; + } + } + i++; + } + rightScrollLimit = -1*(slideTotal-slidesAtOnce)*slideWidth; +} + +// slides with acceleration +function slide(goal, id, go_left, cp) { + var div = document.getElementById(id); + var animation = {}; + animation.time = 0.5; // in seconds + animation.fps = 60; + animation.goal = goal; + origin = 0.0; + animation.origin = Math.abs(origin); + animation.frames = (animation.time * animation.fps) - 1.0; + var current_frame = 0; + var motions = Math.abs(animation.goal - animation.origin); + function animate() { + var ease_right = function (t) { return (1 - Math.cos(t * Math.PI))/2.0; }; + var ease = ease_right; + if (go_left == 1) { + ease = function(t) { return 1.0 - ease_right(t); }; + } + var left = (ease(current_frame/animation.frames) * Math.abs(animation.goal - animation.origin)) - cp; + if(left < 0) { + left = 0; + } + if(!isNaN(left)) { + div.style.left = '-' + Math.round(left) + 'px'; + } + current_frame += 1; + if (current_frame == animation.frames) { + is_animating = 0; + window.clearInterval(timeoutId) + } + } + var timeoutId = window.setInterval(animate, animation.time/animation.fps * 1000); +} + +//Get style property +function getStyle(element, cssProperty){ + var elem = document.getElementById(element); + if(elem.currentStyle){ + return elem.currentStyle[cssProperty]; //IE + } else{ + var style = document.defaultView.getComputedStyle(elem, null); //firefox, Opera + return style.getPropertyValue(cssProperty); + } +} + +// Left and right arrows +function page_left() { + var amount = slideWidth; + animateSlide(amount, 'left'); +} + +function page_right() { + var amount = slideWidth; + animateSlide(amount, 'right'); +} + + +// animates the strip +// - sets arrows to on or off +function animateSlide(amount,dir) { + var currentStripPosition = parseInt(getStyle(slideList,'left')); + var motionDistance; + if (amount == slideWidth ) { + motionDistance = slideWidth; + } else { + motionDistance = amount; + } + + var rightarrow = document.getElementById(arrowRight); + var leftarrow = document.getElementById(arrowLeft); + + function aToggle(state,aDir) { + if (state == 'on') { + if (aDir =='right') { + rightarrow.className = 'arrow-right-on'; + rightarrow.href = "javascript:page_right()"; + } else { + leftarrow.className = 'arrow-left-on'; + leftarrow.href = "javascript:page_left()"; + } + } else { + if (aDir =='right') { + rightarrow.href = "javascript:{}"; + rightarrow.className = 'arrow-right-off'; + } else { + leftarrow.href = "javascript:{}"; + leftarrow.className = 'arrow-left-off'; + } + } + } + + function arrowChange(rP) { + if (rP >= rightScrollLimit) { + aToggle('on','right'); + } + if (rP <= rightScrollLimit) { + aToggle('off','right'); + } + if (rP <= slideWidth) { + aToggle('on','left'); + } + if (rP >= 0) { + aToggle('off','left'); + } + } + + if (dir == 'right' && is_animating == 0) { + arrowChange(currentStripPosition-motionDistance); + is_animating = 1; + slide(motionDistance, slideList, 0, currentStripPosition); + } else if (dir == 'left' && is_animating == 0) { + arrowChange(currentStripPosition+motionDistance); + is_animating = 1; + rightStripPosition = currentStripPosition + motionDistance; + slide(motionDistance, slideList, 1, rightStripPosition); + } +} + +function centerSlide(slideName) { + var currentStripPosition = parseInt(getStyle(slideList,'left')); + var dir = 'left'; + var originpoint = Math.abs(currentStripPosition); + if (originpoint <= originPosition[slideName]) { + dir = 'right'; + } + var motionValue = Math.abs(originPosition[slideName]-originpoint); + animateSlide(motionValue,dir); +} + + +function initCarousel(def) { + buildCarousel(); + showPreview(def); + makeSlideStrip(); +} diff --git a/tools/droiddoc/templates/assets/images/android_wrench.png b/tools/droiddoc/templates/assets/images/android_wrench.png Binary files differnew file mode 100644 index 0000000..6390a2d --- /dev/null +++ b/tools/droiddoc/templates/assets/images/android_wrench.png diff --git a/tools/droiddoc/templates/assets/images/grad-rule-qv.png b/tools/droiddoc/templates/assets/images/grad-rule-qv.png Binary files differnew file mode 100644 index 0000000..bae2d18 --- /dev/null +++ b/tools/droiddoc/templates/assets/images/grad-rule-qv.png diff --git a/tools/droiddoc/templates/assets/images/home/market-large.png b/tools/droiddoc/templates/assets/images/home/market-large.png Binary files differindex fecc22b..55ab924 100644 --- a/tools/droiddoc/templates/assets/images/home/market-large.png +++ b/tools/droiddoc/templates/assets/images/home/market-large.png diff --git a/tools/droiddoc/templates/assets/images/home/market-small.png b/tools/droiddoc/templates/assets/images/home/market-small.png Binary files differindex 7799475..fa1201c 100644 --- a/tools/droiddoc/templates/assets/images/home/market-small.png +++ b/tools/droiddoc/templates/assets/images/home/market-small.png diff --git a/tools/droiddoc/templates/assets/images/home/sdk-small.png b/tools/droiddoc/templates/assets/images/home/sdk-small.png Binary files differindex 62cbb30..f90fdda 100644 --- a/tools/droiddoc/templates/assets/images/home/sdk-small.png +++ b/tools/droiddoc/templates/assets/images/home/sdk-small.png diff --git a/tools/droiddoc/templates/assets/images/triangle-closed-small.png b/tools/droiddoc/templates/assets/images/triangle-closed-small.png Binary files differnew file mode 100644 index 0000000..dc75915 --- /dev/null +++ b/tools/droiddoc/templates/assets/images/triangle-closed-small.png diff --git a/tools/droiddoc/templates/assets/images/triangle-closed.png b/tools/droiddoc/templates/assets/images/triangle-closed.png Binary files differnew file mode 100644 index 0000000..a34a055 --- /dev/null +++ b/tools/droiddoc/templates/assets/images/triangle-closed.png diff --git a/tools/droiddoc/templates/assets/images/triangle-opened-small.png b/tools/droiddoc/templates/assets/images/triangle-opened-small.png Binary files differnew file mode 100644 index 0000000..184031d --- /dev/null +++ b/tools/droiddoc/templates/assets/images/triangle-opened-small.png diff --git a/tools/droiddoc/templates/assets/images/triangle-opened.png b/tools/droiddoc/templates/assets/images/triangle-opened.png Binary files differnew file mode 100644 index 0000000..a709604 --- /dev/null +++ b/tools/droiddoc/templates/assets/images/triangle-opened.png diff --git a/tools/droiddoc/templates/assets/navtree.js b/tools/droiddoc/templates/assets/navtree.js new file mode 100644 index 0000000..f48e1dc --- /dev/null +++ b/tools/droiddoc/templates/assets/navtree.js @@ -0,0 +1,179 @@ + +function new_node(me, mom, text, link, children_data) +{ + var node = new Object(); + node.children = Array(); + node.children_data = children_data; + node.depth = mom.depth + 1; + + node.li = document.createElement("li"); + mom.get_children_ul().appendChild(node.li); + + node.label_div = document.createElement("div"); + node.li.appendChild(node.label_div); + node.label_div.style.paddingLeft = 10*node.depth + "px"; + node.label_div.className = "label"; + + if (children_data == null) { + // 12 is the width of the triangle and padding extra space + node.label_div.style.paddingLeft = ((10*node.depth)+12) + "px"; + } else { + node.label_div.style.paddingLeft = 10*node.depth + "px"; + node.expand_toggle = document.createElement("a"); + node.expand_toggle.href = "javascript:void(0)"; + node.expand_toggle.onclick = function() { + if (node.expanded) { + $(node.get_children_ul()).slideUp("fast"); + node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png"; + node.expanded = false; + } else { + expand_node(me, node); + } + }; + node.label_div.appendChild(node.expand_toggle); + + node.plus_img = document.createElement("img"); + node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png"; + node.plus_img.className = "plus"; + node.plus_img.border = "0"; + node.expand_toggle.appendChild(node.plus_img); + + node.expanded = false; + } + + var a = document.createElement("a"); + node.label_div.appendChild(a); + node.label = document.createTextNode(text); + a.appendChild(node.label); + if (link) { + a.href = me.toroot + link; + } else { + if (children_data != null) { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expand_toggle.onclick; + // This next line shouldn't be necessary. I'll buy a beer for the first + // person who figures out how to remove this line and have the link + // toggle shut on the first try. --joeo@android.com + node.expanded = false; + } + } + + + node.children_ul = null; + node.get_children_ul = function() { + if (!node.children_ul) { + node.children_ul = document.createElement("ul"); + node.children_ul.className = "children_ul"; + node.children_ul.style.display = "none"; + node.li.appendChild(node.children_ul); + } + return node.children_ul; + }; + + return node; +} + +function expand_node(me, node) +{ + if (node.children_data && !node.expanded) { + if (node.children_visited) { + $(node.get_children_ul()).slideDown("fast"); + } else { + get_node(me, node); + $(node.get_children_ul()).slideDown("fast"); + } + node.plus_img.src = me.toroot + "assets/images/triangle-opened-small.png"; + node.expanded = true; + } +} + +function get_node(me, mom) +{ + mom.children_visited = true; + for (var i in mom.children_data) { + var node_data = mom.children_data[i]; + mom.children[i] = new_node(me, mom, node_data[0], node_data[1], + node_data[2]); + } +} + +function this_page_relative(toroot) +{ + var full = document.location.pathname; + var file = ""; + if (toroot.substr(0, 1) == "/") { + if (full.substr(0, toroot.length) == toroot) { + return full.substr(toroot.length); + } else { + // the file isn't under toroot. Fail. + return null; + } + } else { + if (toroot != "./") { + toroot = "./" + toroot; + } + do { + if (toroot.substr(toroot.length-3, 3) == "../" || toroot == "./") { + var pos = full.lastIndexOf("/"); + file = full.substr(pos) + file; + full = full.substr(0, pos); + toroot = toroot.substr(0, toroot.length-3); + } + } while (toroot != "" && toroot != "/"); + return file.substr(1); + } +} + +function find_page(url, data) +{ + var nodes = data; + var result = null; + for (var i in nodes) { + var d = nodes[i]; + if (d[1] == url) { + return new Array(i); + } + else if (d[2] != null) { + result = find_page(url, d[2]); + if (result != null) { + return (new Array(i).concat(result)); + } + } + } + return null; +} + +function init_navtree(navtree_id, toroot, root_nodes) +{ + var me = new Object(); + me.toroot = toroot; + me.node = new Object(); + + me.node.li = document.getElementById(navtree_id); + me.node.children_data = root_nodes; + me.node.children = new Array(); + me.node.children_ul = document.createElement("ul"); + me.node.get_children_ul = function() { return me.node.children_ul; }; + //me.node.children_ul.className = "children_ul"; + me.node.li.appendChild(me.node.children_ul); + me.node.depth = 0; + + get_node(me, me.node); + + me.this_page = this_page_relative(toroot); + me.breadcrumbs = find_page(me.this_page, root_nodes); + if (me.breadcrumbs != null && me.breadcrumbs.length != 0) { + var mom = me.node; + for (var i in me.breadcrumbs) { + var j = me.breadcrumbs[i]; + mom = mom.children[j]; + expand_node(me, mom); + } + mom.label_div.className = mom.label_div.className + " selected"; + addLoadEvent(function() { + scrollIntoView("nav-tree"); + }); + } +} + diff --git a/tools/droiddoc/templates/assets/search_autocomplete.js b/tools/droiddoc/templates/assets/search_autocomplete.js index b5d26ea..392aa46 100644 --- a/tools/droiddoc/templates/assets/search_autocomplete.js +++ b/tools/droiddoc/templates/assets/search_autocomplete.js @@ -136,7 +136,7 @@ function search_changed(e, kd, toroot) gSelectedIndex = -1; for (i=0; i<DATA.length; i++) { var s = DATA[i]; - if (text.length != 0 && s.label.toLowerCase().indexOf(text.toLowerCase()) != -1) { + if (text.length != 0 && s.label.indexOf(text) != -1) { gMatches[matchedCount] = s; if (gSelectedID == s.id) { gSelectedIndex = matchedCount; @@ -156,8 +156,10 @@ function search_focus_changed(obj, focused) obj.style.color="#000000"; } } else { - obj.value = DEFAULT_TEXT; - obj.style.color="#aaaaaa"; + if(obj.value == ""){ + obj.value = DEFAULT_TEXT; + obj.style.color="#aaaaaa"; + } document.getElementById("search_filtered").className = "no-display"; } } diff --git a/tools/droiddoc/templates/assets/style.css b/tools/droiddoc/templates/assets/style.css index 37f66d4..5ad1118 100644 --- a/tools/droiddoc/templates/assets/style.css +++ b/tools/droiddoc/templates/assets/style.css @@ -313,3 +313,4 @@ div#jd-build-id { margin-top: 0px; } } + diff --git a/tools/droiddoc/templates/assets/triangle-close.png b/tools/droiddoc/templates/assets/triangle-close.png Binary files differdeleted file mode 100644 index 5595adf..0000000 --- a/tools/droiddoc/templates/assets/triangle-close.png +++ /dev/null diff --git a/tools/droiddoc/templates/assets/triangle-none.gif b/tools/droiddoc/templates/assets/triangle-none.gif Binary files differnew file mode 100644 index 0000000..0c7b469 --- /dev/null +++ b/tools/droiddoc/templates/assets/triangle-none.gif diff --git a/tools/droiddoc/templates/assets/triangle-open.png b/tools/droiddoc/templates/assets/triangle-open.png Binary files differdeleted file mode 100644 index 116ce91..0000000 --- a/tools/droiddoc/templates/assets/triangle-open.png +++ /dev/null diff --git a/tools/droiddoc/templates/class.cs b/tools/droiddoc/templates/class.cs index 19df5fb..1fd4369 100644 --- a/tools/droiddoc/templates/class.cs +++ b/tools/droiddoc/templates/class.cs @@ -10,14 +10,15 @@ function toggle_inherited(base) { if (list.style.display == "none") { list.style.display = "block"; summary.style.display = "none"; - trigger.src = "<?cs var:toroot ?>assets/triangle-open.png"; + trigger.src = "<?cs var:toroot ?>assets/images/triangle-closed.png"; } else { list.style.display = "none"; summary.style.display = "block"; - trigger.src = "<?cs var:toroot ?>assets/triangle-close.png"; + trigger.src = "<?cs var:toroot ?>assets/images/triangle-opened.png"; } } </script> + <?cs include:"header.cs" ?> <div class="g-unit" id="doc-content"> @@ -80,17 +81,17 @@ function toggle_inherited(base) { <?cs # this next line must be exactly like this to be parsed by eclipse ?> <!-- ======== NESTED CLASS SUMMARY ======== --> <?cs if:subcount(class.inners) ?> -<h4><?cs call:expando_trigger("nested-classes", "close") ?>Nested Classes</h4> +<h4><?cs call:expando_trigger("nested-classes", "opened") ?>Nested Classes</h4> <?cs call:expandable_class_list("nested-classes", class.inners, "summary") ?> <?cs /if ?> <?cs if:subcount(class.subclasses.direct) ?> -<h4><?cs call:expando_trigger("subclasses-direct", "open") ?>Known Direct Subclasses</h4> +<h4><?cs call:expando_trigger("subclasses-direct", "closed") ?>Known Direct Subclasses</h4> <?cs call:expandable_class_list("subclasses-direct", class.subclasses.direct, "list") ?> <?cs /if ?> <?cs if:subcount(class.subclasses.indirect) ?> -<h4><?cs call:expando_trigger("subclasses-indirect", "open") ?>Known Indirect Subclasses</h4> +<h4><?cs call:expando_trigger("subclasses-indirect", "closed") ?>Known Indirect Subclasses</h4> <?cs call:expandable_class_list("subclasses-indirect", class.subclasses.indirect, "list") ?> <?cs /if ?> @@ -195,7 +196,7 @@ function toggle_inherited(base) { <?cs each:cl=class.inherited ?> <?cs if:subcount(cl.attrs) ?> -<h4><?cs call:expando_trigger("inherited-attrs-"+cl.qualified, "open") ?>XML Attributes inherited +<h4><?cs call:expando_trigger("inherited-attrs-"+cl.qualified, "closed") ?>XML Attributes inherited from <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> </h4> @@ -239,7 +240,7 @@ function toggle_inherited(base) { <?cs each:cl=class.inherited ?> <?cs if:subcount(cl.constants) ?> -<h4><?cs call:expando_trigger("inherited-constants-"+cl.qualified, "open") ?>Constants inherited +<h4><?cs call:expando_trigger("inherited-constants-"+cl.qualified, "closed") ?>Constants inherited from <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> </h4> @@ -266,7 +267,7 @@ function toggle_inherited(base) { <?cs each:cl=class.inherited ?> <?cs if:subcount(cl.fields) ?> -<h4><?cs call:expando_trigger("inherited-fields-"+cl.qualified, "open") ?>Fields inherited +<h4><?cs call:expando_trigger("inherited-fields-"+cl.qualified, "closed") ?>Fields inherited from <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> </h4> @@ -314,7 +315,7 @@ function toggle_inherited(base) { <?cs each:cl=class.inherited ?> <?cs if:subcount(cl.methods) ?> -<h4><?cs call:expando_trigger("inherited-methods-"+cl.qualified, "open") ?>Methods inherited +<h4><?cs call:expando_trigger("inherited-methods-"+cl.qualified, "closed") ?>Methods inherited from <?cs var:cl.kind ?> <a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a> </h4> diff --git a/tools/droiddoc/templates/customization.cs b/tools/droiddoc/templates/customization.cs index 4ff861c..c5420bb 100644 --- a/tools/droiddoc/templates/customization.cs +++ b/tools/droiddoc/templates/customization.cs @@ -1,151 +1,24 @@ -<?cs # This default template file is meant to be replaced. ?> -<?cs # Use the -tempatedir arg to javadoc to set your own directory with a replacement for this file in it. ?> -<?cs # As of OCT '08, there's no need to replace this... framework and gae are identical. ?> +<?cs # This default template file is meant to be replaced. ?> +<?cs # Use the -templatedir arg to javadoc to set your own directory with a ?> +<?cs # replacement for this file in it. ?> <?cs def:custom_masthead() ?> - <div id="header"> - <div id="headerLeft"> - <a href="<?cs var:toroot ?>"><img src="<?cs var:toroot ?>assets/images/bg_logo.jpg" /></a> - </div> - <div id="headerRight"> - <div id="headerLinks" align="right"> - <img src="<?cs var:toroot ?>assets/images/icon_world.jpg"><span class="text"> <a href="#">English</a> | <a href="http://www.android.com">Android.com</a></span> - </div> - - - - <div id="search" align="right"> - <div id="searchForm"> -<form accept-charset="utf-8" class="gsc-search-box" onsubmit="document.location='<?cs var:toroot ?>search.html?' + document.getElementById('search_autocomplete').value; return false;"> - <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody> - <tr> - <td class="gsc-input"> - <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off" tabindex="1" - value="search developer docs" - onFocus="search_focus_changed(this, true)" - onBlur="search_focus_changed(this, false)" - onkeydown="return search_changed(event, true, '<?cs var:toroot?>')" - onkeyup="search_changed(event, false, '<?cs var:toroot?>')" /> - <br/> - <div id="search_filtered_div"> - <table id="search_filtered" class="no-display" cellspacing=0> - </table> - </div> - </td> - <td class="gsc-search-button"> - <input type="button" value="Search" title="search" id="search-button" class="gsc-search-button" onclick="document.location='<?cs var:toroot ?>search.html?' + document.getElementById('search_autocomplete').value;"/> - </td> - <td class="gsc-clear-button"> - <div title="clear results" class="gsc-clear-button"> </div> - </td> - </tr></tbody> - </table> -</form> -</div> - </div> - <ul class="<?cs - if:reference ?>reference<?cs - elif:guide ?>guide<?cs - elif:sdk ?>sdk<?cs - elif:home ?>home<?cs - elif:community ?>community<?cs - elif:publish ?>publish<?cs - elif:about ?>about<?cs /if ?>"> - <li><a href="<?cs var:toroot ?>community/" id="community-link">Community</a></li> - <li><a href="http://android-developers.blogspot.com">Blog</a></li> - //<li><a href="<?cs var:toroot ?>publish/" id="publish-link">Publish</a></li> - <li><a href="<?cs var:toroot ?>reference/packages.html" id="reference-link">Reference</a></li> - <li><a href="<?cs var:toroot ?>guide/" id="guide-link">Dev Guide</a></li> - <li><a href="<?cs var:toroot ?>sdk/" id="sdk-link">SDK</a></li> - <li><a href="<?cs var:toroot ?>" id="home-link">Home</a></li> - </ul> - </div> - </div> - -<?cs /def ?> - - -<?cs # appears in the blue bar at the top of every page ?> -<?cs def:custom_subhead() ?> - <?cs if:android.buglink ?> - <a href="http://b/createIssue?component=27745&owner=jcohen&cc=android-bugs&issue.summary=javadoc+bug%3A+<?cs var:filename ?>&issue.type=BUG&issue.priority=P2&issue.severity=S2&"><font color="red">See a bug? Report it here.</font></a> - - <?cs /if ?> -<?cs /def ?> - - -<?cs def:custom_left_nav() ?> -<div class="g-section g-tpl-240" id="body-content"> - <div class="g-unit g-first side-nav-resizable" id="side-nav"> - <div id="resize-packages-nav"> - <div id="packages-nav"> - <div id="index-links"><nobr> - <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> | - <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr> - </div> - <ul> - <?cs each:pkg=docs.packages ?> - <li <?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>class="selected"<?cs /if ?>><?cs call:package_link(pkg) ?></li> - <?cs /each ?> - </ul><br/> - </div> <!-- end packages --> - </div> <!-- end resize-packages --> - <div id="classes-nav"> - <?cs if:subcount(class.package) ?> - <ul> - <?cs call:list("Interfaces", class.package.interfaces) ?> - <?cs call:list("Classes", class.package.classes) ?> - <?cs call:list("Enums", class.package.enums) ?> - <?cs call:list("Exceptions", class.package.exceptions) ?> - <?cs call:list("Errors", class.package.errors) ?> - </ul> - <?cs elif:subcount(package) ?> - <ul> - <?cs call:class_link_list("Interfaces", package.interfaces) ?> - <?cs call:class_link_list("Classes", package.classes) ?> - <?cs call:class_link_list("Enums", package.enums) ?> - <?cs call:class_link_list("Exceptions", package.exceptions) ?> - <?cs call:class_link_list("Errors", package.errors) ?> - </ul> - <?cs else ?> - <script> - /*addLoadEvent(maxPackageHeight);*/ - </script> - <p style="padding:10px">Select a package to view its members</p> - <?cs /if ?><br/> - </div><!-- end classes --> - </div> <!-- end side-nav --> -<?cs /def ?> - -<?cs def:sdk_nav() ?> -<div class="g-section g-tpl-180" id="body-content"> - <div class="g-unit g-first" id="side-nav"> - <div id="devdoc-nav"> - <?cs include:"../../../java/android/html/sdk/sdk_toc.cs" ?> +<div id="header"> + <div id="headerLeft"> + <a href="<?cs var:toroot ?>index.html" tabindex="-1"><?cs var:page.title ?></a> </div> - </div> <!-- end side-nav --> -<?cs /def ?> + <div id="headerRight"> + <?cs call:default_search_box() ?> + </div><!-- headerRight --> +</div><!-- header --> -<?cs def:guide_nav() ?> -<div class="g-section g-tpl-240 side-nav-resizable" id="body-content"> - <div class="g-unit g-first" id="side-nav"> - <div id="devdoc-nav"> - <?cs include:"../../../java/android/html/guide/guide_toc.cs" ?> - </div> - </div> <!-- end side-nav --> -<?cs /def ?> +<?cs /def ?><?cs # custom_masthead ?> -<?cs def:publish_nav() ?> -<div class="g-section g-tpl-180" id="body-content"> - <div class="g-unit g-first" id="side-nav"> - <div id="devdoc-nav"> - <?cs include:"../../../java/android/html/publish/publish_toc.cs" ?> - </div> - </div> <!-- end side-nav --> -<?cs /def ?> <?cs # appears on the left side of the blue bar at the bottom of every page ?> -<?cs def:custom_copyright() ?>Copyright 2008 <a href="http://open.android.com/">The Android Open Source Project</a><?cs /def ?> +<?cs def:custom_copyright() ?><?cs /def ?> <?cs # appears on the right side of the blue bar at the bottom of every page ?> -<?cs def:custom_buildinfo() ?>Build <?cs var:page.build ?> - <?cs var:page.now ?><?cs /def ?>
\ No newline at end of file +<?cs def:custom_buildinfo() ?>Build <?cs var:page.build ?> - <?cs var:page.now ?><?cs /def ?> + +<?cs def:custom_left_nav() ?><?cs call:default_left_nav() ?><?cs /def ?> diff --git a/tools/droiddoc/templates/devdoc-nav.cs b/tools/droiddoc/templates/devdoc-nav.cs deleted file mode 100644 index a69c175..0000000 --- a/tools/droiddoc/templates/devdoc-nav.cs +++ /dev/null @@ -1,66 +0,0 @@ -<ul> - <li><div><a href="<?cs var:toroot ?>index.html">Home</a></div></li> - <li><div><a href="<?cs var:toroot ?>what-is-android.html">What is Android?</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/index.html">Getting Started</a></div> - <ul> - <li><div><a href="<?cs var:toroot ?>intro/installing.html">Installing the SDK</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/upgrading.html">Upgrading the SDK</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/develop-and-debug.html">Developing/Debugging</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/hello-android.html">Hello Android</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/anatomy.html">Anatomy of an App</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/tutorial.html">Notepad Tutorial</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/tools.html">Development Tools</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/appmodel.html">Application Model</a></div></li> - <li><div><a href="<?cs var:toroot ?>intro/lifecycle.html">Application Life Cycle</a></div></li> - </ul> - </li> - <li><div><div><a href="<?cs var:toroot ?>devel/index.html">Developing Applications</a></div> - <ul> - <li><div><a href="<?cs var:toroot ?>devel/implementing-ui.html">Implementing a UI</a></div></li> - <li><div><a href="<?cs var:toroot ?>devel/building-blocks.html">Building Blocks</a></div></li> - <li><div><a href="<?cs var:toroot ?>devel/data.html">Data Storage and Retrieval</a></div></li> - <li><div><a href="<?cs var:toroot ?>devel/security.html">Security Model</a></div></li> - <li><div><a href="<?cs var:toroot ?>devel/resources-i18n.html">Resources and i18n</a></div></li> - </ul> - </li> - <li><div><a href="<?cs var:toroot ?>toolbox/index.html">Developer Toolbox</a></div> - <ul> - <li><div><a href="<?cs var:toroot ?>toolbox/philosophy.html">Design Philosophy</a></div></li> - <li><div><a href="<?cs var:toroot ?>toolbox/custom-components.html">Building Custom Components</a></div></li> - <li><div><a href="<?cs var:toroot ?>toolbox/optional-apis.html">Optional APIs</a></div></li> - </ul> - </li> - <li><div><a href="<?cs var:toroot ?>samples/index.html">Sample Code</a></div> - <ul> - <li><div><a href="<?cs var:toroot ?>samples/ApiDemos/index.html">API Demos</a></div></li> - <li><div><a href="<?cs var:toroot ?>samples/LunarLander/index.html">Lunar Lander</a></div></li> - <li><div><a href="<?cs var:toroot ?>samples/NotePad/index.html">Note Pad</a></div></li> - </ul> - </li> - <li> <a href="<?cs var:toroot ?>reference/index.html"><strong>Reference Information</strong></a> - <ul> - <li><a href="<?cs var:toroot ?>reference/packages.html">Package Index</a></li> - <li><a href="<?cs var:toroot ?>reference/classes.html">Class Index</a></li> - <li><a href="<?cs var:toroot ?>reference/hierarchy.html">Class Hierarchy</a></li> - <li><a href="<?cs var:toroot ?>reference/view-gallery.html">List of Views</a></li> - <li><a href="<?cs var:toroot ?>reference/available-intents.html">List of Intents</a></li> - <li><a href="<?cs var:toroot ?>reference/android/Manifest.permission.html">List of Permissions</a></li> - <li><a href="<?cs var:toroot ?>reference/available-resources.html">List of Resource Types</a></li> - <li><a href="<?cs var:toroot ?>reference/aidl.html">Android IDL</a></li> - <li><a href="<?cs var:toroot ?>reference/glossary.html">Glossary</a></li> - <li><a href="<?cs var:toroot ?>reference/keywords.html">Index</a></li> - </ul> - </li> - <li><div><a href="<?cs var:toroot ?>kb/index.html">FAQs</a></div> - <ul> - <li><div><a href="<?cs var:toroot ?>kb/general.html">General</a></div></li> - <li><div><a href="<?cs var:toroot ?>kb/commontasks.html">Common Tasks</a></div></li> - <li><div><a href="<?cs var:toroot ?>kb/troubleshooting.html">Troubleshooting</a></div></li> - <li><div><a href="<?cs var:toroot ?>kb/licensingandoss.html">Open Source Licensing</a></div></li> - <li><div><a href="<?cs var:toroot ?>kb/framework.html">Application Framework</a></div></li> - <li><div><a href="<?cs var:toroot ?>kb/security.html">Security</a></div></li> - </ul> - </li> - <li><div><a href="<?cs var:toroot ?>roadmap.html">Roadmap</a></div></li> - <li><div><a href="<?cs var:toroot ?>goodies/index.html">Goodies</a></div></li> -</ul>
\ No newline at end of file diff --git a/tools/droiddoc/templates/docpage.cs b/tools/droiddoc/templates/docpage.cs index 26f231c..bd4d551 100644 --- a/tools/droiddoc/templates/docpage.cs +++ b/tools/droiddoc/templates/docpage.cs @@ -4,19 +4,31 @@ <body class="gc-documentation"> <?cs include:"header.cs" ?> -<div class="g-unit" id="doc-content"> - -<div id="jd-header"> +<div class="g-unit" id="doc-content"><a name="top"></a> + +<div id="jd-header" class="guide-header"> + <span class="crumb"> + <?cs if:parent.link ?> + <a href="<?cs var:parent.link ?>"><?cs var:parent.title ?></a> > + <?cs else ?> + <?cs /if ?> + </span> <h1><?cs var:page.title ?></h1> </div> <div id="jd-content"> + <div class="jd-descr"> <?cs call:tag_list(root.descr) ?> </div> + <a href="#top" style="float:right">↑ Go to top</a> + <?cs if:parent.link ?> + <p><a href="<?cs var:parent.link ?>">← Back to <?cs var:parent.title ?></a></p> + <?cs /if ?> </div> + <?cs include:"footer.cs" ?> </div><!-- end doc-content --> </div><!-- end body-content --> diff --git a/tools/droiddoc/templates/head_tag.cs b/tools/droiddoc/templates/head_tag.cs index 7ae2281..acca358 100644 --- a/tools/droiddoc/templates/head_tag.cs +++ b/tools/droiddoc/templates/head_tag.cs @@ -6,11 +6,23 @@ elif:sdk ?>SDK | <?cs elif:sample ?>Samples | <?cs /if ?>Android Developers</title> -<link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" media="screen"> + +<?cs if:guide ?> +<link href="<?cs var:toroot ?>assets/android-developer-docs-devguide.css" rel="stylesheet" type="text/css" /> +<?cs else ?> +<link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" /> +<?cs /if ?> <script src="<?cs var:toroot ?>assets/search_autocomplete.js"></script> <script src="<?cs var:toroot ?>reference/lists.js"></script> <script src="<?cs var:toroot ?>assets/jquery-resizable.min.js"></script> <script src="<?cs var:toroot ?>assets/android-developer-docs.js"></script> +<script> + setToRoot("<?cs var:toroot ?>"); +</script> + +<script src="<?cs var:toroot ?>navtree_data.js"></script> +<script src="<?cs var:toroot ?>assets/navtree.js"></script> + <noscript> <style> @@ -18,7 +30,8 @@ #body-content{position:relative; top:0;} #doc-content{overflow:visible;border-left:3px solid #666;} #side-nav{padding:0;} + #side-nav .toggle-list ul {display:block;} #resize-packages-nav{border-bottom:3px solid #666;} </style> </noscript> -</head>
\ No newline at end of file +</head> diff --git a/tools/droiddoc/templates/header.cs b/tools/droiddoc/templates/header.cs index b5984c8..e8301be 100644 --- a/tools/droiddoc/templates/header.cs +++ b/tools/droiddoc/templates/header.cs @@ -1,12 +1,3 @@ -<a name="top"></a> <?cs call:custom_masthead() ?> +<?cs call:custom_left_nav() ?> -<?cs if:guide ?> - <?cs call:guide_nav() ?> -<?cs elif:publish ?> - <?cs call:publish_nav() ?> -<?cs elif:sdk ?> - <?cs call:sdk_nav() ?> -<?cs else ?> - <?cs call:custom_left_nav() ?> -<?cs /if ?> diff --git a/tools/droiddoc/templates/macros.cs b/tools/droiddoc/templates/macros.cs index 42ee9bb..1325496 100644 --- a/tools/droiddoc/templates/macros.cs +++ b/tools/droiddoc/templates/macros.cs @@ -225,7 +225,7 @@ This <?cs var:kind ?> is deprecated. <?cs def:expando_trigger(id, default) ?> <a href="javascript:toggle_inherited('<?cs var:id ?>')" class="jd-expando-trigger" ><img id="<?cs var:id ?>-trigger" - src="<?cs var:toroot ?>assets/triangle-<?cs var:default ?>.png" + src="<?cs var:toroot ?>assets/images/triangle-<?cs var:default ?>.png" class="jd-expando-trigger" /></a> <?cs /def ?> @@ -250,5 +250,108 @@ This <?cs var:kind ?> is deprecated. <?cs /def ?> +<?cs def:default_left_nav() ?> +<div class="g-section g-tpl-240" id="body-content"> + <div class="g-unit g-first side-nav-resizable" id="side-nav"> + <div id="swapper"> + <div id="nav-panels"> + <div id="resize-packages-nav"> + <div id="packages-nav"> + <div id="index-links"><nobr> + <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> | + <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr> + </div> + <ul> + <?cs each:pkg=docs.packages ?> + <li <?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>class="selected"<?cs /if ?>><?cs call:package_link(pkg) ?></li> + <?cs /each ?> + </ul><br/> + </div> <!-- end packages --> + </div> <!-- end resize-packages --> + <div id="classes-nav"> + <?cs if:subcount(class.package) ?> + <ul> + <?cs call:list("Interfaces", class.package.interfaces) ?> + <?cs call:list("Classes", class.package.classes) ?> + <?cs call:list("Enums", class.package.enums) ?> + <?cs call:list("Exceptions", class.package.exceptions) ?> + <?cs call:list("Errors", class.package.errors) ?> + </ul> + <?cs elif:subcount(package) ?> + <ul> + <?cs call:class_link_list("Interfaces", package.interfaces) ?> + <?cs call:class_link_list("Classes", package.classes) ?> + <?cs call:class_link_list("Enums", package.enums) ?> + <?cs call:class_link_list("Exceptions", package.exceptions) ?> + <?cs call:class_link_list("Errors", package.errors) ?> + </ul> + <?cs else ?> + <script> + /*addLoadEvent(maxPackageHeight);*/ + </script> + <p style="padding:10px">Select a package to view its members</p> + <?cs /if ?><br/> + </div><!-- end classes --> + </div><!-- end nav-panels --> + <div id="nav-tree" style="display:none"> + <div id="index-links"><nobr> + <a href="<?cs var:toroot ?>reference/packages.html" <?cs if:(page.title == "Package Index") ?>class="selected"<?cs /if ?> >Package Index</a> | + <a href="<?cs var:toroot ?>reference/classes.html" <?cs if:(page.title == "Class Index") ?>class="selected"<?cs /if ?>>Class Index</a></nobr> + </div> + </div><!-- end nav-tree --> + </div><!-- end swapper --> + </div> <!-- end side-nav --> + + <script> + $("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav"); + chooseDefaultNav(); + if ($("#nav-tree").is(':visible')) init_navtree("nav-tree", "<?cs var:toroot ?>", NAVTREE_DATA); + else { + addLoadEvent(function() { + scrollIntoView("packages-nav"); + scrollIntoView("classes-nav"); + }); + } + $("#swapper").css({borderBottom:"2px solid #aaa"}); + </script> + +<?cs /def ?> + +<?cs def:default_search_box() ?> +<div id="search" align="right"> + <div id="searchForm"> + <form accept-charset="utf-8" class="gsc-search-box" + onsubmit="document.location='<?cs var:toroot ?>search.html?' + document.getElementById('search_autocomplete').value; return false;"> + <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody> + <tr> + <td class="gsc-input"> + <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off" + tabindex="1" title="search developer docs" + value="search developer docs" + onFocus="search_focus_changed(this, true)" + onBlur="search_focus_changed(this, false)" + onkeydown="return search_changed(event, true, '<?cs var:toroot?>')" + onkeyup="search_changed(event, false, '<?cs var:toroot?>')" /> + <br/> + <div id="search_filtered_div"> + <table id="search_filtered" class="no-display" cellspacing=0> + </table> + </div> + </td> + <td class="gsc-search-button"> + <input type="button" value="Search" title="search" id="search-button" class="gsc-search-button" onclick="document.location='<?cs var:toroot ?>search.html?' + document.getElementById('search_autocomplete').value;" tabindex="2"/> + </td> + <td class="gsc-clear-button"> + <div title="clear results" class="gsc-clear-button"> </div> + </td> + </tr></tbody> + </table> + </form> + </div><!-- searchForm --> +</div><!-- search --> +<?cs /def ?> + + + <?cs include:"customization.cs" ?> diff --git a/tools/droiddoc/templates/navtree_data.cs b/tools/droiddoc/templates/navtree_data.cs new file mode 100644 index 0000000..c707232 --- /dev/null +++ b/tools/droiddoc/templates/navtree_data.cs @@ -0,0 +1,4 @@ +var NAVTREE_DATA = +<?cs var:reference_tree ?> +; + diff --git a/tools/droiddoc/templates/packages.cs b/tools/droiddoc/templates/packages.cs index a214dcf..14f7246 100644 --- a/tools/droiddoc/templates/packages.cs +++ b/tools/droiddoc/templates/packages.cs @@ -1,6 +1,7 @@ <?cs include:"macros.cs" ?> <html> <?cs include:"head_tag.cs" ?> +<body class="gc-documentation"> <?cs include:"header.cs" ?> <div class="g-unit" id="doc-content"> diff --git a/tools/droiddoc/templates/sdkpage.cs b/tools/droiddoc/templates/sdkpage.cs deleted file mode 100644 index 45b4d1f..0000000 --- a/tools/droiddoc/templates/sdkpage.cs +++ /dev/null @@ -1,90 +0,0 @@ -<?cs include:"macros.cs" ?> -<html> -<?cs include:"head_tag.cs" ?> -<body class="gc-documentation"> -<a name="top"></a> -<?cs call:custom_masthead() ?> - -<?cs call:sdk_nav() ?> - - -<div class="g-unit" id="doc-content" > - -<div id="jd-content" style="min-width:820px"> - -<h1><?cs var:sdk.version ?></h1> -<p><em> -<?cs var:sdk.date ?> - -<a href="RELEASENOTES.html">Release Notes</a> -</em></p> - -<div class="sidebox-wrapper" style="width:250px"> -<div class="sidebox-inner"> -<h2>Get Started</h2> -<p><a href="requirements.html">System and Sofware Requirements →</a></p> -<p><a href="installing.html">Guide to Installing the SDK →</a></p> - -<h2>Upgrade</h2> -<p><a href="upgrading.html">Upgrading the SDK →</a></p> -<p><a href="">API changes overview →</a></p> -<p><a href="">API differences report →</a></p> - -<h2>Using Eclipse?</h2> -<p>Android provides an Eclipse plugin to help make programming and debugging easier.</p> -<p><a href="">Install Eclipse plugin →</a></p> -</div> -</div> - - -<p>Before downloading, please read the <a href="terms.html">Terms</a> - that govorn the use of the Android SDK.</p> - -<p class="special-note"><strong>Please note:</strong> The Android SDK is under active development. - Please keep this in mind as you explore its capabilities. If you discover any issues, we - welcome you to notify us of them via our Issue Tracker.</p> - -<table class="download"> - <tr> - <th>Platform</th> - <th>Package</th> - <th>Size</th> - <th>MD5 Checksum</th> -</tr> -<tr> - <td>Windows</td> - <td> -<a href="http://dl.google.com/android/<?cs var:sdk.win_download ?>"><?cs var:sdk.win_download ?></a> - </td> - <td><?cs var:sdk.win_bytes ?></td> - <td><?cs var:sdk.win_checksum ?></td> -</tr> -<tr class="alt-color"> - <td>Mac OS X (intel)</td> - <td> -<a href="http://dl.google.com/android/<?cs var:sdk.mac_download ?>"><?cs var:sdk.mac_download ?></a> - </td> - <td><?cs var:sdk.mac_bytes ?></td> - <td><?cs var:sdk.mac_checksum ?></td> -</tr> -<tr> - <td>Linux (i386)</td> - <td> -<a href="http://dl.google.com/android/<?cs var:sdk.linux_download ?>"><?cs var:sdk.linux_download ?></a> - </td> - <td><?cs var:sdk.linux_bytes ?></td> - <td><?cs var:sdk.linux_checksum ?></td> -</tr> -</table> - - -</div><!-- end jd-content --> - -<?cs include:"footer.cs" ?> -</div><!-- end doc-content --> -</div><!-- end body-content --> -<?cs include:"analytics.cs" ?> -</body> -</html> - - - |