Massive clobber of all template files in developer site for new design
Change-Id: I5f243dcb377a8b2e573c404a9e685cc64e0e06d2
|
@ -0,0 +1,278 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
|
@ -0,0 +1,20 @@
|
|||
Copyright (c) 2011 John Resig, http://jquery.com/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,19 +0,0 @@
|
|||
|
||||
@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;
|
||||
}
|
|
@ -1,614 +0,0 @@
|
|||
var resizePackagesNav;
|
||||
var classesNav;
|
||||
var devdocNav;
|
||||
var sidenav;
|
||||
var content;
|
||||
var HEADER_HEIGHT = 117;
|
||||
var cookie_namespace = 'android_developer';
|
||||
var NAV_PREF_TREE = "tree";
|
||||
var NAV_PREF_PANELS = "panels";
|
||||
var nav_pref;
|
||||
var toRoot;
|
||||
var isMobile = false; // true if mobile, so we can adjust some layout
|
||||
var isIE6 = false; // true if IE6
|
||||
|
||||
// TODO: use $(document).ready instead
|
||||
function addLoadEvent(newfun) {
|
||||
var current = window.onload;
|
||||
if (typeof window.onload != 'function') {
|
||||
window.onload = newfun;
|
||||
} else {
|
||||
window.onload = function() {
|
||||
current();
|
||||
newfun();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var agent = navigator['userAgent'].toLowerCase();
|
||||
// If a mobile phone, set flag and do mobile setup
|
||||
if ((agent.indexOf("mobile") != -1) || // android, iphone, ipod
|
||||
(agent.indexOf("blackberry") != -1) ||
|
||||
(agent.indexOf("webos") != -1) ||
|
||||
(agent.indexOf("mini") != -1)) { // opera mini browsers
|
||||
isMobile = true;
|
||||
addLoadEvent(mobileSetup);
|
||||
// If not a mobile browser, set the onresize event for IE6, and others
|
||||
} else if (agent.indexOf("msie 6") != -1) {
|
||||
isIE6 = true;
|
||||
addLoadEvent(function() {
|
||||
window.onresize = resizeAll;
|
||||
});
|
||||
} else {
|
||||
addLoadEvent(function() {
|
||||
window.onresize = resizeHeight;
|
||||
});
|
||||
}
|
||||
|
||||
function mobileSetup() {
|
||||
$("body").css({'overflow':'auto'});
|
||||
$("html").css({'overflow':'auto'});
|
||||
$("#body-content").css({'position':'relative', 'top':'0'});
|
||||
$("#doc-content").css({'overflow':'visible', 'border-left':'3px solid #DDD'});
|
||||
$("#side-nav").css({'padding':'0'});
|
||||
$("#nav-tree").css({'overflow-y': 'auto'});
|
||||
}
|
||||
|
||||
/* loads the lists.js file to the page.
|
||||
Loading this in the head was slowing page load time */
|
||||
addLoadEvent( function() {
|
||||
var lists = document.createElement("script");
|
||||
lists.setAttribute("type","text/javascript");
|
||||
lists.setAttribute("src", toRoot+"reference/lists.js");
|
||||
document.getElementsByTagName("head")[0].appendChild(lists);
|
||||
} );
|
||||
|
||||
addLoadEvent( function() {
|
||||
$("pre:not(.no-pretty-print)").addClass("prettyprint");
|
||||
prettyPrint();
|
||||
} );
|
||||
|
||||
function setToRoot(root) {
|
||||
toRoot = root;
|
||||
// note: toRoot also used by carousel.js
|
||||
}
|
||||
|
||||
function restoreWidth(navWidth) {
|
||||
var windowWidth = $(window).width() + "px";
|
||||
content.css({marginLeft:parseInt(navWidth) + 6 + "px"}); //account for 6px-wide handle-bar
|
||||
|
||||
if (isIE6) {
|
||||
content.css({width:parseInt(windowWidth) - parseInt(navWidth) - 6 + "px"}); // necessary in order for scrollbars to be visible
|
||||
}
|
||||
|
||||
sidenav.css({width:navWidth});
|
||||
resizePackagesNav.css({width:navWidth});
|
||||
classesNav.css({width:navWidth});
|
||||
$("#packages-nav").css({width: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: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 readCookie(cookie) {
|
||||
var myCookie = cookie_namespace+"_"+cookie+"=";
|
||||
if (document.cookie) {
|
||||
var index = document.cookie.indexOf(myCookie);
|
||||
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;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function writeCookie(cookie, val, section, expiration) {
|
||||
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();
|
||||
}
|
||||
document.cookie = cookie_namespace + section + cookie + "=" + val + "; expires=" + expiration+"; path=/";
|
||||
}
|
||||
|
||||
function init() {
|
||||
$("#side-nav").css({position:"absolute",left:0});
|
||||
content = $("#doc-content");
|
||||
resizePackagesNav = $("#resize-packages-nav");
|
||||
classesNav = $("#classes-nav");
|
||||
sidenav = $("#side-nav");
|
||||
devdocNav = $("#devdoc-nav");
|
||||
|
||||
var cookiePath = "";
|
||||
if (location.href.indexOf("/reference/") != -1) {
|
||||
cookiePath = "reference_";
|
||||
} else if (location.href.indexOf("/guide/") != -1) {
|
||||
cookiePath = "guide_";
|
||||
} else if (location.href.indexOf("/sdk/") != -1) {
|
||||
cookiePath = "sdk_";
|
||||
} else if ((location.href.indexOf("/resources/") != -1) ||
|
||||
(location.href.indexOf("/training/") != -1)) {
|
||||
cookiePath = "resources_";
|
||||
}
|
||||
|
||||
if (!isMobile) {
|
||||
$("#resize-packages-nav").resizable({handles: "s", resize: function(e, ui) { resizePackagesHeight(); } });
|
||||
$("#side-nav").resizable({handles: "e", resize: function(e, ui) { resizeWidth(); } });
|
||||
var cookieWidth = readCookie(cookiePath+'width');
|
||||
var cookieHeight = readCookie(cookiePath+'height');
|
||||
if (cookieWidth) {
|
||||
restoreWidth(cookieWidth);
|
||||
} else if ($("#side-nav").length) {
|
||||
resizeWidth();
|
||||
}
|
||||
if (cookieHeight) {
|
||||
restoreHeight(cookieHeight);
|
||||
} else {
|
||||
resizeHeight();
|
||||
}
|
||||
}
|
||||
|
||||
if (devdocNav.length) { // only dev guide, resources, and sdk
|
||||
tryPopulateResourcesNav();
|
||||
highlightNav(location.href);
|
||||
}
|
||||
}
|
||||
|
||||
function tryPopulateResourcesNav() {
|
||||
var sampleList = $('#devdoc-nav-sample-list');
|
||||
var articleList = $('#devdoc-nav-article-list');
|
||||
var tutorialList = $('#devdoc-nav-tutorial-list');
|
||||
var topicList = $('#devdoc-nav-topic-list');
|
||||
|
||||
if (!topicList.length || !ANDROID_TAGS || !ANDROID_RESOURCES)
|
||||
return;
|
||||
|
||||
var topics = [];
|
||||
for (var topic in ANDROID_TAGS['topic']) {
|
||||
topics.push({name:topic,title:ANDROID_TAGS['topic'][topic]});
|
||||
}
|
||||
topics.sort(function(x,y){ return (x.title < y.title) ? -1 : 1; });
|
||||
for (var i = 0; i < topics.length; i++) {
|
||||
topicList.append(
|
||||
$('<li>').append(
|
||||
$('<a>')
|
||||
.attr('href', toRoot + "resources/browser.html?tag=" + topics[i].name)
|
||||
.append($('<span>')
|
||||
.addClass('en')
|
||||
.html(topics[i].title)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
var _renderResourceList = function(tag, listNode) {
|
||||
var resources = [];
|
||||
var tags;
|
||||
var resource;
|
||||
var i, j;
|
||||
for (i = 0; i < ANDROID_RESOURCES.length; i++) {
|
||||
resource = ANDROID_RESOURCES[i];
|
||||
tags = resource.tags || [];
|
||||
var hasTag = false;
|
||||
for (j = 0; j < tags.length; j++)
|
||||
if (tags[j] == tag) {
|
||||
hasTag = true;
|
||||
break;
|
||||
}
|
||||
if (!hasTag)
|
||||
continue;
|
||||
resources.push(resource);
|
||||
}
|
||||
//resources.sort(function(x,y){ return (x.title.en < y.title.en) ? -1 : 1; });
|
||||
for (i = 0; i < resources.length; i++) {
|
||||
resource = resources[i];
|
||||
var listItemNode = $('<li>').append(
|
||||
$('<a>')
|
||||
.attr('href', toRoot + "resources/" + resource.path)
|
||||
.append($('<span>')
|
||||
.addClass('en')
|
||||
.html(resource.title.en)
|
||||
)
|
||||
);
|
||||
tags = resource.tags || [];
|
||||
for (j = 0; j < tags.length; j++) {
|
||||
if (tags[j] == 'new') {
|
||||
listItemNode.get(0).innerHTML += ' <span class="new">new!</span>';
|
||||
break;
|
||||
} else if (tags[j] == 'updated') {
|
||||
listItemNode.get(0).innerHTML += ' <span class="new">updated!</span>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
listNode.append(listItemNode);
|
||||
}
|
||||
};
|
||||
|
||||
_renderResourceList('sample', sampleList);
|
||||
_renderResourceList('article', articleList);
|
||||
_renderResourceList('tutorial', tutorialList);
|
||||
}
|
||||
|
||||
function highlightNav(fullPageName) {
|
||||
var lastSlashPos = fullPageName.lastIndexOf("/");
|
||||
var firstSlashPos;
|
||||
if (fullPageName.indexOf("/guide/") != -1) {
|
||||
firstSlashPos = fullPageName.indexOf("/guide/");
|
||||
} else if (fullPageName.indexOf("/sdk/") != -1) {
|
||||
firstSlashPos = fullPageName.indexOf("/sdk/");
|
||||
} else if (fullPageName.indexOf("/resources/") != -1) {
|
||||
firstSlashPos = fullPageName.indexOf("/resources/");
|
||||
} else if (fullPageName.indexOf("/training/") != -1) {
|
||||
firstSlashPos = fullPageName.indexOf("/training/");
|
||||
}
|
||||
if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (add 'index.html')
|
||||
fullPageName = fullPageName + "index.html";
|
||||
}
|
||||
|
||||
// get the path and page name from the URL (such as 'guide/topics/graphics/index.html')
|
||||
var htmlPos = fullPageName.indexOf(".html");
|
||||
var pathPageName = fullPageName.slice(firstSlashPos, htmlPos + 5); // +5 advances past ".html"
|
||||
// find instances of the page name in the side nav
|
||||
var link = $("#devdoc-nav a[href$='"+ pathPageName+"']");
|
||||
// if there's no match, then let's backstep through the directory until we find an index.html
|
||||
// page that matches our ancestor directories (only for dev guide and resources)
|
||||
if ((link.length == 0) && ((fullPageName.indexOf("/guide/") != -1) ||
|
||||
(fullPageName.indexOf("/resources/") != -1))) {
|
||||
lastBackstep = pathPageName.lastIndexOf("/");
|
||||
while (link.length == 0) {
|
||||
backstepDirectory = pathPageName.lastIndexOf("/", lastBackstep);
|
||||
link = $("#devdoc-nav a[href$='"+ pathPageName.slice(0, backstepDirectory +
|
||||
1)+"index.html']");
|
||||
lastBackstep = pathPageName.lastIndexOf("/", lastBackstep - 1);
|
||||
if (lastBackstep == 0) break;
|
||||
}
|
||||
}
|
||||
|
||||
// add 'selected' to the <li> or <div> that wraps this <a>
|
||||
link.parent().addClass('selected');
|
||||
|
||||
// if we're in a toggleable root link (<li class=toggle-list><div><a>)
|
||||
if (link.parent().parent().hasClass('toggle-list')) {
|
||||
toggle(link.parent().parent(), false); // open our own list
|
||||
// then also check if we're in a third-level nested list that's toggleable
|
||||
if (link.parent().parent().parent().is(':hidden')) {
|
||||
toggle(link.parent().parent().parent().parent(), false); // open the super parent list
|
||||
}
|
||||
}
|
||||
// if we're in a normal nav link (<li><a>) and the parent <ul> is hidden
|
||||
else if (link.parent().parent().is(':hidden')) {
|
||||
toggle(link.parent().parent().parent(), false); // open the parent list
|
||||
// then also check if the parent list is also nested in a hidden list
|
||||
if (link.parent().parent().parent().parent().is(':hidden')) {
|
||||
toggle(link.parent().parent().parent().parent().parent(), false); // open the super parent list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Resize the height of the nav panels in the reference,
|
||||
* and save the new size to a cookie */
|
||||
function resizePackagesHeight() {
|
||||
var windowHeight = ($(window).height() - HEADER_HEIGHT);
|
||||
var swapperHeight = windowHeight - 13; // move 13px for swapper link at the bottom
|
||||
resizePackagesNav.css({maxHeight:swapperHeight + "px"});
|
||||
classesNav.css({height:swapperHeight - parseInt(resizePackagesNav.css("height")) + "px"});
|
||||
|
||||
$("#swapper").css({height:swapperHeight + "px"});
|
||||
$("#packages-nav").css({height:parseInt(resizePackagesNav.css("height")) - 6 + "px"}); //move 6px for handle
|
||||
|
||||
var basePath = getBaseUri(location.pathname);
|
||||
var section = basePath.substring(1,basePath.indexOf("/",1));
|
||||
writeCookie("height", resizePackagesNav.css("height"), section, null);
|
||||
}
|
||||
|
||||
/* Resize the height of the side-nav and doc-content divs,
|
||||
* which creates the frame effect */
|
||||
function resizeHeight() {
|
||||
var docContent = $("#doc-content");
|
||||
|
||||
// Get the window height and always resize the doc-content and side-nav divs
|
||||
var windowHeight = ($(window).height() - HEADER_HEIGHT);
|
||||
docContent.css({height:windowHeight + "px"});
|
||||
$("#side-nav").css({height:windowHeight + "px"});
|
||||
|
||||
var href = location.href;
|
||||
// If in the reference docs, also resize the "swapper", "classes-nav", and "nav-tree" divs
|
||||
if (href.indexOf("/reference/") != -1) {
|
||||
var swapperHeight = windowHeight - 13;
|
||||
$("#swapper").css({height:swapperHeight + "px"});
|
||||
$("#classes-nav").css({height:swapperHeight - parseInt(resizePackagesNav.css("height")) + "px"});
|
||||
$("#nav-tree").css({height:swapperHeight + "px"});
|
||||
|
||||
// Also resize the "devdoc-nav" div
|
||||
} else if ($("#devdoc-nav").length) {
|
||||
$("#devdoc-nav").css({height:sidenav.css("height")});
|
||||
}
|
||||
|
||||
// Hide the "Go to top" link if there's no vertical scroll
|
||||
if ( parseInt($("#jd-content").css("height")) <= parseInt(docContent.css("height")) ) {
|
||||
$("a[href='#top']").css({'display':'none'});
|
||||
} else {
|
||||
$("a[href='#top']").css({'display':'inline'});
|
||||
}
|
||||
}
|
||||
|
||||
/* Resize the width of the "side-nav" and the left margin of the "doc-content" div,
|
||||
* which creates the resizable side bar */
|
||||
function resizeWidth() {
|
||||
var windowWidth = $(window).width() + "px";
|
||||
var sidenav = $("#side-nav");
|
||||
if (sidenav.length) {
|
||||
var sidenavWidth = sidenav.css("width");
|
||||
} else {
|
||||
var sidenavWidth = 0;
|
||||
}
|
||||
content.css({marginLeft:parseInt(sidenavWidth) + 6 + "px"}); //account for 6px-wide handle-bar
|
||||
|
||||
if (isIE6) {
|
||||
content.css({width:parseInt(windowWidth) - parseInt(sidenavWidth) - 6 + "px"}); // necessary in order to for scrollbars to be visible
|
||||
}
|
||||
|
||||
resizePackagesNav.css({width:sidenavWidth});
|
||||
classesNav.css({width:sidenavWidth});
|
||||
$("#packages-nav").css({width:sidenavWidth});
|
||||
|
||||
if (sidenav.length) { // Must check if the nav exists because IE6 calls resizeWidth() from resizeAll() for all pages
|
||||
var basePath = getBaseUri(location.pathname);
|
||||
var section = basePath.substring(1,basePath.indexOf("/",1));
|
||||
section = section.indexOf("training") != -1 ? "resources" : section;
|
||||
writeCookie("width", sidenavWidth, section, null);
|
||||
}
|
||||
}
|
||||
|
||||
/* For IE6 only,
|
||||
* because it can't properly perform auto width for "doc-content" div,
|
||||
* avoiding this for all browsers provides better performance */
|
||||
function resizeAll() {
|
||||
resizeHeight();
|
||||
resizeWidth();
|
||||
}
|
||||
|
||||
function getBaseUri(uri) {
|
||||
var intlUrl = (uri.substring(0,6) == "/intl/");
|
||||
if (intlUrl) {
|
||||
base = uri.substring(uri.indexOf('intl/')+5,uri.length);
|
||||
base = base.substring(base.indexOf('/')+1, base.length);
|
||||
//alert("intl, returning base url: /" + base);
|
||||
return ("/" + base);
|
||||
} else {
|
||||
//alert("not intl, returning uri as found.");
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
|
||||
function requestAppendHL(uri) {
|
||||
//append "?hl=<lang> to an outgoing request (such as to blog)
|
||||
var lang = getLangPref();
|
||||
if (lang) {
|
||||
var q = 'hl=' + lang;
|
||||
uri += '?' + q;
|
||||
window.location = uri;
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function loadLast(cookiePath) {
|
||||
var location = window.location.href;
|
||||
if (location.indexOf("/"+cookiePath+"/") != -1) {
|
||||
return true;
|
||||
}
|
||||
var lastPage = readCookie(cookiePath + "_lastpage");
|
||||
if (lastPage) {
|
||||
window.location = lastPage;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$(window).unload(function(){
|
||||
var path = getBaseUri(location.pathname);
|
||||
if (path.indexOf("/reference/") != -1) {
|
||||
writeCookie("lastpage", path, "reference", null);
|
||||
} else if (path.indexOf("/guide/") != -1) {
|
||||
writeCookie("lastpage", path, "guide", null);
|
||||
} else if ((path.indexOf("/resources/") != -1) || (path.indexOf("/training/") != -1)) {
|
||||
writeCookie("lastpage", path, "resources", null);
|
||||
}
|
||||
});
|
||||
|
||||
function toggle(obj, slide) {
|
||||
var ul = $("ul:first", 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:first", 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 = readCookie('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_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());
|
||||
|
||||
$("#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;
|
||||
if (selected.is("div")) selected = selected.parent(); // when the selected item is a parent
|
||||
|
||||
var scrolling = document.getElementById(nav);
|
||||
var navHeight = navObj.height();
|
||||
var offsetTop = selected.position().top;
|
||||
|
||||
// handle nested items
|
||||
if (selected.parent().parent().is(".toggle-list")) {
|
||||
selected = selected.parent().parent();
|
||||
// handle second level nested items
|
||||
if (selected.parent().parent().is(".toggle-list")) {
|
||||
selected = selected.parent().parent();
|
||||
}
|
||||
offsetTop += selected.position().top;
|
||||
}
|
||||
|
||||
// 180px from the bottom of the list is the threshold
|
||||
if(offsetTop > navHeight - 180) {
|
||||
scrolling.scrollTop = offsetTop - navHeight + 180;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeTabLang(lang) {
|
||||
var nodes = $("#header-tabs").find("."+lang);
|
||||
for (i=0; i < nodes.length; i++) { // for each node in this language
|
||||
var node = $(nodes[i]);
|
||||
node.siblings().css("display","none"); // hide all siblings
|
||||
if (node.not(":empty").length != 0) { //if this languages node has a translation, show it
|
||||
node.css("display","inline");
|
||||
} else { //otherwise, show English instead
|
||||
node.css("display","none");
|
||||
node.siblings().filter(".en").css("display","inline");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeNavLang(lang) {
|
||||
var nodes = $("#side-nav").find("."+lang);
|
||||
for (i=0; i < nodes.length; i++) { // for each node in this language
|
||||
var node = $(nodes[i]);
|
||||
node.siblings().css("display","none"); // hide all siblings
|
||||
if (node.not(":empty").length != 0) { // if this languages node has a translation, show it
|
||||
node.css("display","inline");
|
||||
} else { // otherwise, show English instead
|
||||
node.css("display","none");
|
||||
node.siblings().filter(".en").css("display","inline");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeDocLang(lang) {
|
||||
changeTabLang(lang);
|
||||
changeNavLang(lang);
|
||||
}
|
||||
|
||||
function changeLangPref(lang, refresh) {
|
||||
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);
|
||||
//changeDocLang(lang);
|
||||
if (refresh) {
|
||||
l = getBaseUri(location.pathname);
|
||||
window.location = l;
|
||||
}
|
||||
}
|
||||
|
||||
function loadLangPref() {
|
||||
var lang = readCookie("pref_lang");
|
||||
if (lang != 0) {
|
||||
$("#language").find("option[value='"+lang+"']").attr("selected",true);
|
||||
}
|
||||
}
|
||||
|
||||
function getLangPref() {
|
||||
var lang = $("#language").find(":selected").attr("value");
|
||||
if (!lang) {
|
||||
lang = readCookie("pref_lang");
|
||||
}
|
||||
return (lang != 0) ? lang : 'en';
|
||||
}
|
||||
|
||||
|
||||
/* Used to hide and reveal supplemental content, such as long code samples.
|
||||
See the companion CSS in android-developer-docs.css */
|
||||
function toggleContent(obj) {
|
||||
var div = $(obj.parentNode.parentNode);
|
||||
var toggleMe = $(".toggle-content-toggleme",div);
|
||||
if (div.hasClass("closed")) { // if it's closed, open it
|
||||
toggleMe.slideDown();
|
||||
$(".toggle-content-text", obj).toggle();
|
||||
div.removeClass("closed").addClass("open");
|
||||
$(".toggle-content-img", div).attr("title", "hide").attr("src", toRoot + "assets/images/triangle-opened.png");
|
||||
} else { // if it's open, close it
|
||||
toggleMe.slideUp('fast', function() { // Wait until the animation is done before closing arrow
|
||||
$(".toggle-content-text", obj).toggle();
|
||||
div.removeClass("open").addClass("closed");
|
||||
$(".toggle-content-img", div).attr("title", "show").attr("src", toRoot + "assets/images/triangle-closed.png");
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
/* Resource Browser */
|
||||
|
||||
#resource-browser-results .no-results {
|
||||
font-style: italic;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#resource-browser-results .result {
|
||||
position: relative;
|
||||
padding-left: 84px;
|
||||
background: transparent none no-repeat scroll 4px 12px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
#resource-browser-results .tagged-article {
|
||||
background-image: url(images/resource-article.png);
|
||||
}
|
||||
|
||||
#resource-browser-results .tagged-sample {
|
||||
background-image: url(images/resource-sample.png);
|
||||
}
|
||||
|
||||
#resource-browser-results .tagged-tutorial {
|
||||
background-image: url(images/resource-tutorial.png);
|
||||
}
|
||||
|
||||
#resource-browser-results .resource-meta {
|
||||
margin-top: -1em;
|
||||
font-size: 0.85em;
|
||||
font-weight: normal;
|
||||
}
|
|
@ -1,235 +0,0 @@
|
|||
(function() { // anonymize
|
||||
|
||||
var allTags = {};
|
||||
var loadedResults = [];
|
||||
|
||||
/**
|
||||
* Initialization code run upon the DOM being ready.
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
// Parse page query parameters.
|
||||
var params = parseParams(document.location.search);
|
||||
params.tag = params.tag ? makeArray(params.tag) : null;
|
||||
|
||||
// Load tag and resource dataset.
|
||||
loadTags();
|
||||
loadResources();
|
||||
|
||||
showResults(params);
|
||||
|
||||
// Watch for keypresses in the keyword filter textbox, and update
|
||||
// search results to reflect the keyword filter.
|
||||
$('#resource-browser-keyword-filter').keyup(function() {
|
||||
// Filter results on screen by keyword.
|
||||
var keywords = $(this).val().split(/\s+/g);
|
||||
for (var i = 0; i < loadedResults.length; i++) {
|
||||
var hide = false;
|
||||
for (var j = 0; j < keywords.length; j++) {
|
||||
if (!resultMatchesKeyword(loadedResults[i].result, keywords[j])) {
|
||||
hide = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
loadedResults[i].node[hide ? 'hide' : 'show']();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns whether or not the given search result contains the given keyword.
|
||||
*/
|
||||
function resultMatchesKeyword(result, keyword) {
|
||||
keyword = keyword.toLowerCase();
|
||||
if (result.title &&
|
||||
result.title.en.toLowerCase().indexOf(keyword) >= 0)
|
||||
return true;
|
||||
else if (result.description &&
|
||||
result.description.en.toLowerCase().indexOf(keyword) >= 0)
|
||||
return true;
|
||||
else if (result.topicsHtml &&
|
||||
result.topicsHtml.replace(/\<.*?\>/g,'').toLowerCase().indexOf(keyword) >= 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the allTags array with tag data from the ANDROID_TAGS
|
||||
* variable in the resource data JS file.
|
||||
*/
|
||||
function loadTags() {
|
||||
for (var tagClass in ANDROID_TAGS) {
|
||||
for (var tag in ANDROID_TAGS[tagClass]) {
|
||||
allTags[tag] = {
|
||||
displayTag: ANDROID_TAGS[tagClass][tag],
|
||||
tagClass: tagClass
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Massage the ANDROID_RESOURCES resource list in the resource data JS file.
|
||||
*/
|
||||
function loadResources() {
|
||||
for (var i = 0; i < ANDROID_RESOURCES.length; i++) {
|
||||
var resource = ANDROID_RESOURCES[i];
|
||||
|
||||
// Convert the tags array to a tags hash for easier querying.
|
||||
resource.tagsHash = {};
|
||||
for (var j = 0; j < resource.tags.length; j++)
|
||||
resource.tagsHash[resource.tags[j]] = true;
|
||||
|
||||
// Determine the type and topics of the resource by inspecting its tags.
|
||||
resource.topics = [];
|
||||
for (tag in resource.tagsHash)
|
||||
if (tag in allTags) {
|
||||
if (allTags[tag].tagClass == 'type') {
|
||||
resource.type = tag;
|
||||
} else if (allTags[tag].tagClass == 'topic') {
|
||||
resource.topics.push(tag);
|
||||
}
|
||||
}
|
||||
|
||||
// Add a humanized topics list string.
|
||||
resource.topicsHtml = humanizeList(resource.topics, function(item) {
|
||||
return '<strong>' + allTags[item].displayTag + '</strong>';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads resources for the given query parameters.
|
||||
*/
|
||||
function showResults(params) {
|
||||
loadedResults = [];
|
||||
$('#resource-browser-search-params').empty();
|
||||
$('#resource-browser-results').empty();
|
||||
|
||||
var i, j;
|
||||
var searchTags = [];
|
||||
if (params.tag) {
|
||||
for (i = 0; i < params.tag.length; i++) {
|
||||
var tag = params.tag[i];
|
||||
if (tag.toLowerCase() in allTags) {
|
||||
searchTags.push(tag.toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (searchTags.length) {
|
||||
// Show query params.
|
||||
var taggedWithHtml = ['Showing technical resources tagged with '];
|
||||
taggedWithHtml.push(humanizeList(searchTags, function(item) {
|
||||
return '<strong>' + allTags[item].displayTag + '</strong>';
|
||||
}));
|
||||
$('#resource-browser-search-params').html(taggedWithHtml.join('') + ':');
|
||||
} else {
|
||||
$('#resource-browser-search-params').html('Showing all technical resources:');
|
||||
}
|
||||
|
||||
var results = [];
|
||||
|
||||
// Create the list of resources to show.
|
||||
for (i = 0; i < ANDROID_RESOURCES.length; i++) {
|
||||
var resource = ANDROID_RESOURCES[i];
|
||||
var skip = false;
|
||||
|
||||
if (searchTags.length) {
|
||||
for (j = 0; j < searchTags.length; j++)
|
||||
if (!(searchTags[j] in resource.tagsHash)) {
|
||||
skip = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (skip)
|
||||
continue;
|
||||
|
||||
results.push(resource);
|
||||
continue;
|
||||
}
|
||||
|
||||
results.push(resource);
|
||||
}
|
||||
|
||||
// Format and show the list of resource results.
|
||||
if (results.length) {
|
||||
$('#resource-browser-results .no-results').hide();
|
||||
for (i = 0; i < results.length; i++) {
|
||||
var result = results[i];
|
||||
var resultJqNode = $(tmpl('tmpl_resource_browser_result', result));
|
||||
for (tag in result.tagsHash)
|
||||
resultJqNode.addClass('tagged-' + tag);
|
||||
$('#resource-browser-results').append(resultJqNode);
|
||||
|
||||
loadedResults.push({ node: resultJqNode, result: result });
|
||||
}
|
||||
} else {
|
||||
$('#resource-browser-results .no-results').show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the given array into a human readable, English string, ala
|
||||
* 'a, b and c', with an optional item formatter/wrapper function.
|
||||
*/
|
||||
function humanizeList(arr, itemFormatter) {
|
||||
itemFormatter = itemFormatter || function(o){ return o; };
|
||||
arr = arr || [];
|
||||
|
||||
var out = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
out.push(itemFormatter(arr[i]) +
|
||||
((i < arr.length - 2) ? ', ' : '') +
|
||||
((i == arr.length - 2) ? ' and ' : ''));
|
||||
}
|
||||
|
||||
return out.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a parameter string, i.e. foo=1&bar=2 into
|
||||
* a dictionary object.
|
||||
*/
|
||||
function parseParams(paramStr) {
|
||||
var params = {};
|
||||
paramStr = paramStr.replace(/^[?#]/, '');
|
||||
|
||||
var pairs = paramStr.split('&');
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
var p = pairs[i].split('=');
|
||||
var key = p[0] ? decodeURIComponent(p[0]) : p[0];
|
||||
var val = p[1] ? decodeURIComponent(p[1]) : p[1];
|
||||
if (val === '0')
|
||||
val = 0;
|
||||
if (val === '1')
|
||||
val = 1;
|
||||
|
||||
if (key in params) {
|
||||
// Handle array values.
|
||||
params[key] = makeArray(params[key]);
|
||||
params[key].push(val);
|
||||
} else {
|
||||
params[key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the argument as a single-element array, or the argument itself
|
||||
* if it's already an array.
|
||||
*/
|
||||
function makeArray(o) {
|
||||
if (!o)
|
||||
return [];
|
||||
|
||||
if (typeof o === 'object' && 'splice' in o) {
|
||||
return o;
|
||||
} else {
|
||||
return [o];
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
|
@ -1,311 +0,0 @@
|
|||
/* 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];
|
||||
|
||||
$("#"+appName).show().siblings().hide();
|
||||
|
||||
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 span = document.createElement("span");
|
||||
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", toRoot + assetsRoot + "images/home/" + droid.icon);
|
||||
img.setAttribute("alt", "");
|
||||
|
||||
span.appendChild(text);
|
||||
a.appendChild(img);
|
||||
a.appendChild(br);
|
||||
a.appendChild(span);
|
||||
appList.appendChild(a);
|
||||
|
||||
|
||||
/* add the bulletins */
|
||||
var layout = droid.layout;
|
||||
var div = document.createElement("div");
|
||||
var imgDiv = document.createElement("div");
|
||||
var descDiv = document.createElement("div");
|
||||
|
||||
div.setAttribute("id", x);
|
||||
div.setAttribute("style", "display:none");
|
||||
imgDiv.setAttribute("class", "bulletinImg");
|
||||
descDiv.setAttribute("class", "bulletinDesc");
|
||||
|
||||
if (layout == "imgLeft") {
|
||||
$(imgDiv).addClass("img-left");
|
||||
$(descDiv).addClass("desc-right");
|
||||
} else if (layout == "imgTop") {
|
||||
$(imgDiv).addClass("img-top");
|
||||
$(descDiv).addClass("desc-bottom");
|
||||
} else if (layout == "imgRight") {
|
||||
$(imgDiv).addClass("img-right");
|
||||
$(descDiv).addClass("desc-left");
|
||||
}
|
||||
|
||||
imgDiv.innerHTML = "<img src='" + toRoot + assetsRoot + "images/home/" + droid.img + "'>";
|
||||
descDiv.innerHTML = (droid.title != "") ? "<h3>" + droid.title + "</h3>" + droid.desc : droid.desc;
|
||||
$(div).append(imgDiv);
|
||||
$(div).append(descDiv);
|
||||
|
||||
$("#carouselMain").append(div);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// -- * 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();
|
||||
}
|
|
@ -0,0 +1,198 @@
|
|||
|
||||
/* =============================================================================
|
||||
Columns
|
||||
========================================================================== */
|
||||
.grid {
|
||||
width:100%;
|
||||
height:100%;
|
||||
background:url(../images/grid.png) center repeat-y;
|
||||
top:0px;
|
||||
margin:auto;
|
||||
position:absolute;
|
||||
}
|
||||
|
||||
@media screen, projection, print {
|
||||
.full {
|
||||
padding: 2.5em 0;
|
||||
border-top: solid 1px #ddd;
|
||||
border-bottom: solid 1px #ddd;
|
||||
background: #f7f7f7;
|
||||
}
|
||||
.wrap {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
min-width:600px;
|
||||
clear: both;
|
||||
}
|
||||
.cols {
|
||||
height: 1%;
|
||||
margin: 0 -1.533742331288343558282%;
|
||||
width: 103.06748466257669%}
|
||||
*+html .cols {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.cols:after {
|
||||
clear: both;
|
||||
content: ' ';
|
||||
display: block;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
|
||||
.col-13, .col-14, .col-15, .col-16 {
|
||||
float: left;
|
||||
margin: 0 1.063829787234% 20px 1.063829787234%;
|
||||
}
|
||||
* html .col-1, * html .col-2, * html .col-3, * html .col-4, * html .col-5, * html .col-6, * html
|
||||
.col-7, * html .col-8, * html .col-9, * html .col-10, * html .col-11, * html .col-12, * html
|
||||
.col-13, * html .col-14, * html .col-15, * html .col-16 {
|
||||
margin: 0;
|
||||
margin: 0 1.063829787234% 20px 1.063829787234%;
|
||||
}
|
||||
[dir='rtl'] .col-1, [dir='rtl'] .col-2, [dir='rtl'] .col-3, [dir='rtl'] .col-4, [dir='rtl'] .col-5,
|
||||
[dir='rtl'] .col-6, [dir='rtl'] .col-7, [dir='rtl'] .col-8, [dir='rtl'] .col-9, [dir='rtl'] .col-10,
|
||||
[dir='rtl'] .col-11, [dir='rtl'] .col-12 {
|
||||
float: right;
|
||||
}
|
||||
.col-1 {
|
||||
width: 4.16666666666667%;
|
||||
}
|
||||
.col-2 {
|
||||
width: 10.4166666666667%;
|
||||
}
|
||||
.col-3 {
|
||||
width: 16.6666666666667%;
|
||||
}
|
||||
.col-4 {
|
||||
width: 22.9166666666667%;
|
||||
}
|
||||
.col-5 {
|
||||
width: 29.1666666666667%;
|
||||
}
|
||||
.col-6 {
|
||||
width: 35.4166666666667%;
|
||||
}
|
||||
.col-7 {
|
||||
width: 41.6666666666667%;
|
||||
}
|
||||
.col-8 {
|
||||
width: 47.9166666666667%;
|
||||
}
|
||||
.col-9 {
|
||||
width: 55.3333333333333%;
|
||||
}
|
||||
.col-10 {
|
||||
width: 60.4166666666667%;
|
||||
}
|
||||
.col-11 {
|
||||
width: 66.6666666666667%;
|
||||
}
|
||||
.col-12 {
|
||||
width: 72.9166666666667%;
|
||||
}
|
||||
.col-13 {
|
||||
width: 79.1666666666667%;
|
||||
}
|
||||
.col-14 {
|
||||
width: 85.4166666666667%;
|
||||
}
|
||||
.col-15 {
|
||||
width: 91.6666666666667%;
|
||||
}
|
||||
.col-16 {
|
||||
width: 97.9166666666667%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#header .col-1,
|
||||
#nav-x .col-1 { width: 40px }
|
||||
#header .col-2,
|
||||
#nav-x .col-2 { width: 100px }
|
||||
#header .col-3,
|
||||
#nav-x .col-3 { width: 160px }
|
||||
#header .col-4,
|
||||
#nav-x .col-4 { width: 220px }
|
||||
#header .col-5,
|
||||
#nav-x .col-5 { width: 280px }
|
||||
#header .col-6,
|
||||
#nav-x .col-6 { width: 340px }
|
||||
#header .col-7,
|
||||
#nav-x .col-7 { width: 400px }
|
||||
#header .col-8,
|
||||
#nav-x .col-8 { width: 460px }
|
||||
#header .col-9,
|
||||
#nav-x .col-9 { width: 520px }
|
||||
#header .col-10,
|
||||
#nav-x .col-10 { width: 580px }
|
||||
#header .col-11,
|
||||
#nav-x .col-11 { width: 640px }
|
||||
#header .col-12,
|
||||
#nav-x .col-12 { width: 700px }
|
||||
#header .col-13,
|
||||
#nav-x .col-13 { width: 760px }
|
||||
#header .col-14,
|
||||
#nav-x .col-14 { width: 820px }
|
||||
#header .col-15,
|
||||
#nav-x .col-15 { width: 880px }
|
||||
#header .col-16,
|
||||
#nav-x .col-16 { width: 940px }
|
||||
|
||||
|
||||
|
||||
body {
|
||||
padding:0 20px;
|
||||
}
|
||||
#header,
|
||||
#searchResults,
|
||||
#nav-x {
|
||||
margin:0;
|
||||
}
|
||||
#body-content {
|
||||
margin:0;
|
||||
}
|
||||
#body-content > .col-12 {
|
||||
width:77.9804965%;
|
||||
margin:0 0 0 0.97%; /* this percentage chosen to make IE9 happy */
|
||||
}
|
||||
#side-nav {
|
||||
width: 19.9804965%;
|
||||
margin:0 1.063829787234% 0 0;
|
||||
}
|
||||
|
||||
#header .wrap {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
#nav-x .wrap,
|
||||
#searchResults.wrap {
|
||||
max-width:100%;
|
||||
}
|
||||
|
||||
.nav-x {
|
||||
margin:-2px 0 0 0;
|
||||
}
|
||||
|
||||
#devdoc-nav.fixed,
|
||||
#devdoc-nav.fixed a.totop {
|
||||
left:20px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.col-right {
|
||||
margin-right:0px;
|
||||
}
|
||||
|
||||
@media screen and (max-width:772px) {
|
||||
.col-5, .col-6, .col-7 {
|
||||
clear: both;
|
||||
width: 97.0238096%}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
.slideshow-home {
|
||||
height: 500px;
|
||||
width: 940px;
|
||||
border-bottom: 1px solid #CCC;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
}
|
||||
.slideshow-home .frame {
|
||||
width: 940px;
|
||||
height: 500px;
|
||||
}
|
||||
.slideshow-home .content-left {
|
||||
float: left;
|
||||
text-align: center;
|
||||
vertical-align: center;
|
||||
margin: 0 0 0 25px;
|
||||
}
|
||||
.slideshow-home .content-right {
|
||||
width: 290px;
|
||||
float: left;
|
||||
margin: 100px 0 0 0;
|
||||
}
|
||||
.slideshow-home .content-right p {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.slideshow-home .item {
|
||||
height: 500px;
|
||||
width: 940px;
|
||||
}
|
||||
.home-sections {
|
||||
padding: 30px 20px 20px;
|
||||
margin: 20px 0;
|
||||
background: -webkit-linear-gradient(top, #F6F6F6,#F9F9F9);
|
||||
}
|
||||
.home-sections ul {
|
||||
margin: 0;
|
||||
}
|
||||
.home-sections ul li {
|
||||
float: left;
|
||||
display: block;
|
||||
list-style: none;
|
||||
width: 170px;
|
||||
height: 35px;
|
||||
border: 1px solid #ccc;
|
||||
background: white;
|
||||
margin-right: 10px;
|
||||
border-radius: 1px;
|
||||
-webkit-border-radius: 1px;
|
||||
-moz-border-radius: 1px;
|
||||
box-shadow: 1px 1px 5px #EEE;
|
||||
-webkit-box-shadow: 1px 1px 5px #EEE;
|
||||
-moz-box-shadow: 1px 1px 5px #EEE;
|
||||
background: white;
|
||||
}
|
||||
.home-sections ul li:hover {
|
||||
background: #F9F9F9;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
.home-sections ul li a,
|
||||
.home-sections ul li a:hover {
|
||||
font-weight: bold;
|
||||
margin-top: 8px;
|
||||
line-height: 18px;
|
||||
float: left;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #09c !important;
|
||||
}
|
||||
.home-sections ul li a {
|
||||
font-weight: bold;
|
||||
margin-top: 8px;
|
||||
line-height: 18px;
|
||||
float: left;
|
||||
width:100%;
|
||||
text-align:center;
|
||||
}
|
||||
.home-sections ul li img {
|
||||
float: left;
|
||||
margin: -8px 0 0 10px;
|
||||
}
|
||||
.home-sections ul li.last {
|
||||
margin-right: 0px;
|
||||
}
|
||||
#footer {
|
||||
margin-top: -40px;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
.slideshow-home {
|
||||
height: 500px;
|
||||
width: 940px;
|
||||
border-bottom: 1px solid #CCC;
|
||||
position: relative;
|
||||
}
|
||||
.slideshow-home .frame {
|
||||
width: 940px;
|
||||
height: 500px;
|
||||
}
|
||||
.slideshow-home img {
|
||||
max-width: 530px;
|
||||
float: left;
|
||||
}
|
||||
.slideshow-home .content-right {
|
||||
float: left;
|
||||
margin-top: 80px;
|
||||
}
|
||||
.slideshow-home .item {
|
||||
height: 500px;
|
||||
width: 940px;
|
||||
}
|
||||
.home-sections ul li {
|
||||
float: left;
|
||||
display: block;
|
||||
list-style: none;
|
||||
width: 220px;
|
||||
height: 35px;
|
||||
border: 1px solid #F3F3F3;
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
.slideshow-home {
|
||||
height:500px;
|
||||
width:940px;
|
||||
border-bottom:1px solid #CCC;
|
||||
position:relative;
|
||||
margin: 0 10px 0 10px;
|
||||
|
||||
.frame {
|
||||
width:940px;
|
||||
height:500px;
|
||||
}
|
||||
.content-left {
|
||||
float:left;
|
||||
text-align:center;
|
||||
vertical-align:center;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.content-right {
|
||||
float:left;
|
||||
margin:70px 0 0 0;
|
||||
|
||||
p {
|
||||
margin-bottom:30px;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
height:500px;
|
||||
width:940px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.home-sections {
|
||||
padding:40px 0 40px 0;
|
||||
margin: 20px 10px;
|
||||
ul {
|
||||
margin:0;
|
||||
li {
|
||||
float:left;
|
||||
display:block;
|
||||
list-style:none;
|
||||
width:218px;
|
||||
height:35px;
|
||||
border:1px solid #DCDCDC;
|
||||
background-color:#f3f3f3;
|
||||
margin-right:20px;
|
||||
|
||||
a {
|
||||
font-weight:bold;
|
||||
margin-left:20px;
|
||||
margin-top:8px;
|
||||
line-height:18px;
|
||||
float:left;
|
||||
color:#444;
|
||||
}
|
||||
|
||||
img {
|
||||
float:left;
|
||||
margin:-8px 0 0 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
li.last {
|
||||
margin-right:0px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
function showApiWarning(thing, selectedLevel, minLevel) {
|
||||
if (selectedLevel < minLevel) {
|
||||
$("#naMessage").show().html("<div><p><strong>This " + thing + " is not available with API Level " + selectedLevel + ".</strong></p>"
|
||||
+ "<p>To use this " + thing + ", your application must specify API Level " + minLevel + " or higher in its manifest "
|
||||
+ "and be compiled against a version of the Android library that supports an equal or higher API Level. To reveal this "
|
||||
+ "document, change the value of the API Level filter above.</p>"
|
||||
+ "<p><a href='" +toRoot+ "guide/appendix/api-levels.html'>What is the API Level?</a></p></div>");
|
||||
} else {
|
||||
$("#naMessage").hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Direct searches to search.html
|
||||
HAS_SEARCH_PAGE = true;
|
|
@ -1,676 +0,0 @@
|
|||
/* color definitions */
|
||||
/* 16 column layout */
|
||||
/* clearfix idiom */
|
||||
/* common mixins */
|
||||
/* page layout + top-level styles */
|
||||
::-webkit-selection,
|
||||
::-moz-selection,
|
||||
::selection {
|
||||
background-color: #0099cc;
|
||||
color: #fff; }
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #eee none no-repeat fixed top left;
|
||||
background-image: -webkit-gradient(linear, 100% 0%, 100% 100%, from(#dddddd), color-stop(25%, #f2f2f2), color-stop(75%, #f2f2f2), to(#dddddd));
|
||||
background-image: -moz-linear-gradient(top, #dddddd, #f2f2f2, #f2f2f2, #dddddd);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
/* prevent subpixel antialiasing, which thickens the text */
|
||||
/* text-rendering: optimizeLegibility; */
|
||||
/* turned off ligatures due to bug 5945455 */ }
|
||||
|
||||
body {
|
||||
color: #555555;
|
||||
font: 14px/20px Roboto, sans-serif;
|
||||
font-weight: 400; }
|
||||
|
||||
#page-container {
|
||||
width: 940px;
|
||||
margin: 0 40px; }
|
||||
|
||||
#page-header {
|
||||
height: 80px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 48px;
|
||||
line-height: 48px;
|
||||
font-weight: 100;
|
||||
padding-left: 10px; }
|
||||
#page-header a {
|
||||
display: block;
|
||||
position: relative;
|
||||
top: 20px;
|
||||
text-decoration: none;
|
||||
color: #555555 !important; }
|
||||
|
||||
#main-row {
|
||||
display: inline-block; }
|
||||
#main-row:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden; }
|
||||
* html #main-row {
|
||||
height: 1px; }
|
||||
|
||||
#page-footer {
|
||||
margin-left: 190px;
|
||||
margin-top: 80px;
|
||||
color: #999999;
|
||||
padding-bottom: 40px;
|
||||
font-size: 12px;
|
||||
line-height: 15px; }
|
||||
#page-footer a {
|
||||
color: #777777; }
|
||||
#page-footer #copyright {
|
||||
margin-bottom: 10px; }
|
||||
|
||||
#nav-container {
|
||||
width: 160px;
|
||||
min-height: 10px;
|
||||
margin-right: 20px;
|
||||
float: left; }
|
||||
|
||||
#nav {
|
||||
width: 160px; }
|
||||
|
||||
#nav.fixed {
|
||||
position: fixed;
|
||||
top: 40px; }
|
||||
|
||||
#content {
|
||||
width: 760px;
|
||||
float: left; }
|
||||
|
||||
a,
|
||||
a:visited {
|
||||
color: #333333; }
|
||||
|
||||
a:hover,
|
||||
acronym:hover {
|
||||
color: #7aa1b0 !important; }
|
||||
|
||||
a:focus,
|
||||
a:active {
|
||||
color: #33b5e5 !important; }
|
||||
|
||||
img {
|
||||
border: none; }
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
|
||||
strong {
|
||||
font-weight: 500; }
|
||||
|
||||
em {
|
||||
font-style: italic; }
|
||||
|
||||
code {
|
||||
font-family: Courier New, monospace; }
|
||||
|
||||
acronym {
|
||||
border-bottom: 1px dotted #555555;
|
||||
cursor: help; }
|
||||
|
||||
acronym:hover {
|
||||
border-bottom-color: #7aa1b0; }
|
||||
|
||||
img.with-shadow,
|
||||
video.with-shadow {
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); }
|
||||
|
||||
/* disclosures mixin */
|
||||
/* content layout */
|
||||
.layout-content-row {
|
||||
display: inline-block;
|
||||
margin-bottom: 10px; }
|
||||
.layout-content-row:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden; }
|
||||
* html .layout-content-row {
|
||||
height: 1px; }
|
||||
|
||||
.layout-content-col {
|
||||
float: left;
|
||||
margin-left: 20px; }
|
||||
.layout-content-col:first-child {
|
||||
margin-left: 0; }
|
||||
|
||||
.layout-content-col.span-1 {
|
||||
width: 40px; }
|
||||
|
||||
.layout-content-col.span-2 {
|
||||
width: 100px; }
|
||||
|
||||
.layout-content-col.span-3 {
|
||||
width: 160px; }
|
||||
|
||||
.layout-content-col.span-4 {
|
||||
width: 220px; }
|
||||
|
||||
.layout-content-col.span-5 {
|
||||
width: 280px; }
|
||||
|
||||
.layout-content-col.span-6 {
|
||||
width: 340px; }
|
||||
|
||||
.layout-content-col.span-7 {
|
||||
width: 400px; }
|
||||
|
||||
.layout-content-col.span-8 {
|
||||
width: 460px; }
|
||||
|
||||
.layout-content-col.span-9 {
|
||||
width: 520px; }
|
||||
|
||||
.layout-content-col.span-10 {
|
||||
width: 580px; }
|
||||
|
||||
.layout-content-col.span-11 {
|
||||
width: 640px; }
|
||||
|
||||
.layout-content-col.span-12 {
|
||||
width: 700px; }
|
||||
|
||||
.layout-content-col.span-13 {
|
||||
width: 760px; }
|
||||
|
||||
.vspace.size-1 {
|
||||
height: 10px; }
|
||||
|
||||
.vspace.size-2 {
|
||||
height: 20px; }
|
||||
|
||||
.vspace.size-3 {
|
||||
height: 30px; }
|
||||
|
||||
.vspace.size-4 {
|
||||
height: 40px; }
|
||||
|
||||
.vspace.size-5 {
|
||||
height: 50px; }
|
||||
|
||||
.vspace.size-6 {
|
||||
height: 60px; }
|
||||
|
||||
.vspace.size-7 {
|
||||
height: 70px; }
|
||||
|
||||
.vspace.size-8 {
|
||||
height: 80px; }
|
||||
|
||||
.vspace.size-9 {
|
||||
height: 90px; }
|
||||
|
||||
.vspace.size-10 {
|
||||
height: 100px; }
|
||||
|
||||
.vspace.size-11 {
|
||||
height: 110px; }
|
||||
|
||||
.vspace.size-12 {
|
||||
height: 120px; }
|
||||
|
||||
.vspace.size-13 {
|
||||
height: 130px; }
|
||||
|
||||
.vspace.size-14 {
|
||||
height: 140px; }
|
||||
|
||||
.vspace.size-15 {
|
||||
height: 150px; }
|
||||
|
||||
.vspace.size-16 {
|
||||
height: 160px; }
|
||||
|
||||
/* nav */
|
||||
#nav {
|
||||
/* section header divs */
|
||||
/* expanded section header divs */
|
||||
/* sublinks */ }
|
||||
#nav li {
|
||||
list-style-type: none;
|
||||
font-size: 14px;
|
||||
line-height: 10px; }
|
||||
#nav a {
|
||||
color: #555555;
|
||||
text-decoration: none; }
|
||||
#nav li.selected > a,
|
||||
#nav li.selected .nav-section-header a {
|
||||
font-weight: 500;
|
||||
color: #0099cc !important; }
|
||||
#nav .nav-section-header {
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
margin-bottom: 1px;
|
||||
/* section header links */ }
|
||||
#nav .nav-section-header a {
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
text-transform: uppercase; }
|
||||
#nav .nav-section-header:after {
|
||||
content: '';
|
||||
background: transparent url(disclosure_down.png) no-repeat scroll top left;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px; }
|
||||
#nav .nav-section-header.empty:after {
|
||||
display: none; }
|
||||
#nav li.expanded .nav-section-header {
|
||||
background: rgba(0, 0, 0, 0.05); }
|
||||
#nav li.expanded .nav-section-header:after {
|
||||
content: '';
|
||||
background: transparent url(disclosure_up.png) no-repeat scroll top left;
|
||||
width: 10px;
|
||||
height: 10px; }
|
||||
#nav > li > ul {
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
margin-bottom: 0; }
|
||||
#nav > li > ul.animate-height {
|
||||
-webkit-transition: height 0.25s ease-in;
|
||||
-moz-transition: height 0.25s ease-in;
|
||||
transition: height 0.25s ease-in; }
|
||||
#nav > li > ul li {
|
||||
padding: 10px 10px 11px 10px; }
|
||||
#nav > li.expanded > ul {
|
||||
height: auto; }
|
||||
#nav > li.expanded > ul li {
|
||||
background: rgba(0, 0, 0, 0.03); }
|
||||
#nav #back-dac-section {
|
||||
padding: 10px;
|
||||
border-top: 1px solid #ddd; }
|
||||
#nav #back-dac-section a {
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
text-transform: uppercase; }
|
||||
|
||||
/* content header */
|
||||
.content-header {
|
||||
border-bottom: 1px solid #33b5e5;
|
||||
height: 30px; }
|
||||
.content-header h2 {
|
||||
border-bottom: 0; }
|
||||
.content-header.just-links {
|
||||
border-bottom: 0; }
|
||||
|
||||
.content-footer {
|
||||
border-top: 1px solid #33b5e5;
|
||||
margin-top: 10px;
|
||||
height: 30px; }
|
||||
|
||||
.paging-links {
|
||||
position: relative; }
|
||||
.paging-links a {
|
||||
position: absolute;
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
color: #555555;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase; }
|
||||
.paging-links .prev-page-link {
|
||||
display: none;
|
||||
left: -5px; }
|
||||
.paging-links .prev-page-link:before {
|
||||
content: '';
|
||||
background: transparent url(disclosure_left.png) no-repeat scroll top left;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
display: inline-block;
|
||||
margin-right: 5px; }
|
||||
.paging-links .next-page-link {
|
||||
display: none;
|
||||
right: 10px; }
|
||||
.paging-links .next-page-link:after {
|
||||
content: '';
|
||||
background: transparent url(disclosure_right.png) no-repeat scroll top left;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
display: inline-block;
|
||||
margin-left: 5px; }
|
||||
|
||||
/* content body */
|
||||
@-webkit-keyframes glowheader {
|
||||
from {
|
||||
background-color: #33b5e5;
|
||||
color: #000;
|
||||
border-bottom-color: #000; }
|
||||
|
||||
to {
|
||||
background-color: transparent;
|
||||
color: #33b5e5;
|
||||
border-bottom-color: #33b5e5; } }
|
||||
|
||||
@-moz-keyframes glowheader {
|
||||
from {
|
||||
background-color: #33b5e5;
|
||||
color: #000;
|
||||
border-bottom-color: #000; }
|
||||
|
||||
to {
|
||||
background-color: transparent;
|
||||
color: #33b5e5;
|
||||
border-bottom-color: #33b5e5; } }
|
||||
|
||||
@keyframes glowheader {
|
||||
from {
|
||||
background-color: #33b5e5;
|
||||
color: #000;
|
||||
border-bottom-color: #000; }
|
||||
|
||||
to {
|
||||
background-color: transparent;
|
||||
color: #33b5e5;
|
||||
border-bottom-color: #33b5e5; } }
|
||||
|
||||
#content p,
|
||||
#content ul,
|
||||
#content ol,
|
||||
#content h3 {
|
||||
margin: 0 10px 10px 10px; }
|
||||
#content h2 {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 16px;
|
||||
line-height: 30px;
|
||||
font-weight: 500;
|
||||
color: #33b5e5;
|
||||
border-bottom: 1px solid #33b5e5;
|
||||
height: 30px; }
|
||||
#content h2:target {
|
||||
-webkit-animation-name: glowheader;
|
||||
-moz-animation-name: glowheader;
|
||||
animation-name: glowheader;
|
||||
-webkit-animation-duration: 0.7s;
|
||||
-moz-animation-duration: 0.7s;
|
||||
animation-duration: 0.7s;
|
||||
-webkit-animation-timing-function: ease-out;
|
||||
-moz-animation-timing-function: ease-out;
|
||||
animation-timing-function: ease-out; }
|
||||
#content hr {
|
||||
border: 0;
|
||||
border-bottom: 1px solid #33b5e5;
|
||||
margin-bottom: 20px; }
|
||||
#content h3 {
|
||||
color: #33b5e5;
|
||||
text-transform: uppercase;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-weight: 500; }
|
||||
#content h4 {
|
||||
margin: 0 10px;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
line-height: 20px; }
|
||||
#content strong {
|
||||
color: #333333; }
|
||||
#content ul li,
|
||||
#content ol li {
|
||||
margin-left: 20px; }
|
||||
#content ul li h4,
|
||||
#content ol li h4 {
|
||||
margin: 0; }
|
||||
#content ul li p,
|
||||
#content ol li p {
|
||||
margin-left: 0; }
|
||||
#content ul li {
|
||||
list-style-type: square;
|
||||
list-style-type: none;
|
||||
position: relative; }
|
||||
#content ul li:before {
|
||||
content: '\2022';
|
||||
font-family: verdana;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
top: -1px; }
|
||||
#content ol {
|
||||
counter-reset: item; }
|
||||
#content ol li {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
list-style-type: none;
|
||||
position: relative; }
|
||||
#content ol li:before {
|
||||
content: counter(item) ". ";
|
||||
counter-increment: item;
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
top: 0; }
|
||||
#content ol li.value-1:before {
|
||||
content: "1. "; }
|
||||
#content ol li.value-2:before {
|
||||
content: "2. "; }
|
||||
#content ol li.value-3:before {
|
||||
content: "3. "; }
|
||||
#content ol li.value-4:before {
|
||||
content: "4. "; }
|
||||
#content ol li.value-5:before {
|
||||
content: "5. "; }
|
||||
#content ol li.value-6:before {
|
||||
content: "6. "; }
|
||||
#content ol li.value-7:before {
|
||||
content: "7. "; }
|
||||
#content ol li.value-8:before {
|
||||
content: "8. "; }
|
||||
#content ol li.value-9:before {
|
||||
content: "9. "; }
|
||||
#content ol li.value-10:before {
|
||||
content: "10. "; }
|
||||
#content .with-callouts ol li {
|
||||
list-style-position: inside;
|
||||
margin-left: 0; }
|
||||
#content .with-callouts ol li:before {
|
||||
position: static;
|
||||
display: inline;
|
||||
left: 0;
|
||||
float: left;
|
||||
width: 17px;
|
||||
color: #33b5e5;
|
||||
font-weight: 500; }
|
||||
|
||||
/* special list items */
|
||||
li.no-bullet {
|
||||
list-style-type: none !important; }
|
||||
|
||||
#content li.with-icon {
|
||||
position: relative;
|
||||
margin-left: 40px;
|
||||
min-height: 30px; }
|
||||
#content li.with-icon p {
|
||||
margin-left: 0 !important; }
|
||||
#content li.with-icon:before {
|
||||
position: absolute;
|
||||
left: -40px;
|
||||
top: 0;
|
||||
content: '';
|
||||
width: 30px;
|
||||
height: 30px; }
|
||||
#content li.with-icon.tablet:before {
|
||||
background-image: url(ico_phone_tablet.png); }
|
||||
#content li.with-icon.web:before {
|
||||
background-image: url(ico_web.png); }
|
||||
#content li.with-icon.checklist:before {
|
||||
background-image: url(ico_checklist.png); }
|
||||
#content li.with-icon.action:before {
|
||||
background-image: url(ico_action.png); }
|
||||
#content li.with-icon.use:before {
|
||||
background-image: url(ico_use.png); }
|
||||
|
||||
/* figures and callouts */
|
||||
.figure {
|
||||
position: relative; }
|
||||
.figure.pad-below {
|
||||
margin-bottom: 20px; }
|
||||
.figure .figure-callout {
|
||||
position: absolute;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
line-height: 23px;
|
||||
text-align: center;
|
||||
background: transparent url(callout.png) no-repeat scroll 50% 50%;
|
||||
padding-right: 2px;
|
||||
width: 30px;
|
||||
height: 29px;
|
||||
z-index: 1000; }
|
||||
.figure .figure-callout.top {
|
||||
top: -9px; }
|
||||
.figure .figure-callout.right {
|
||||
right: -5px; }
|
||||
|
||||
.figure-caption {
|
||||
margin: 0 10px 20px 10px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-style: italic; }
|
||||
|
||||
/* rows of figures */
|
||||
.figure-row {
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
/* to prevent space between figures */ }
|
||||
.figure-row .figure {
|
||||
display: inline-block;
|
||||
vertical-align: top; }
|
||||
.figure-row .figure + .figure {
|
||||
margin-left: 10px;
|
||||
/* reintroduce space between figures */ }
|
||||
|
||||
/* video containers */
|
||||
.framed-galaxynexus-land-span-13 {
|
||||
background: transparent url(device_galaxynexus_blank_land_span13.png) no-repeat scroll top left;
|
||||
padding: 42px 122px 62px 126px;
|
||||
overflow: hidden; }
|
||||
.framed-galaxynexus-land-span-13, .framed-galaxynexus-land-span-13 video, .framed-galaxynexus-land-span-13 img {
|
||||
width: 512px;
|
||||
height: 286px; }
|
||||
|
||||
.framed-galaxynexus-port-span-9 {
|
||||
background: transparent url(device_galaxynexus_blank_port_span9.png) no-repeat scroll top left;
|
||||
padding: 95px 122px 107px 124px;
|
||||
overflow: hidden; }
|
||||
.framed-galaxynexus-port-span-9, .framed-galaxynexus-port-span-9 video, .framed-galaxynexus-port-span-9 img {
|
||||
width: 274px;
|
||||
height: 488px; }
|
||||
|
||||
.framed-galaxynexus-port-span-5 {
|
||||
background: transparent url(device_galaxynexus_blank_port_span5.png) no-repeat scroll top left;
|
||||
padding: 75px 31px 76px 33px;
|
||||
overflow: hidden; }
|
||||
.framed-galaxynexus-port-span-5, .framed-galaxynexus-port-span-5 video, .framed-galaxynexus-port-span-5 img {
|
||||
width: 216px;
|
||||
height: 384px; }
|
||||
|
||||
/* landing page disclosures */
|
||||
.landing-page-link {
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
color: #333333; }
|
||||
.landing-page-link:after {
|
||||
content: '';
|
||||
background: transparent url(disclosure_right.png) no-repeat scroll top left;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
display: inline-block;
|
||||
margin-left: 5px; }
|
||||
|
||||
/* tooltips */
|
||||
.tooltip-box {
|
||||
position: absolute;
|
||||
background-color: rgba(0, 0, 0, 0.9);
|
||||
border-radius: 2px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
padding: 6px 10px;
|
||||
max-width: 250px;
|
||||
z-index: 10000; }
|
||||
.tooltip-box.below:after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
line-height: 0;
|
||||
display: block;
|
||||
top: -10px;
|
||||
left: 5px;
|
||||
border: 5px solid transparent;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.9); }
|
||||
|
||||
/* video note */
|
||||
.video-instructions {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px; }
|
||||
.video-instructions:before {
|
||||
content: '';
|
||||
background: transparent url(ico_movie_inline.png) no-repeat scroll top left;
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-right: 8px; }
|
||||
.video-instructions:after {
|
||||
content: 'Click to replay movie.'; }
|
||||
|
||||
/* download buttons */
|
||||
.download-button {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
text-decoration: none;
|
||||
background-color: #33b5e5;
|
||||
color: #fff !important;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
|
||||
padding: 6px 12px;
|
||||
border-radius: 2px; }
|
||||
.download-button:hover, .download-button:focus {
|
||||
background-color: #0099cc;
|
||||
color: #fff !important; }
|
||||
.download-button:active {
|
||||
background-color: #006699; }
|
||||
|
||||
/* UI tables and other things found in Writing style and Settings pattern */
|
||||
.ui-table {
|
||||
width: 100%;
|
||||
background: #282828;
|
||||
color: #fff;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
|
||||
border-collapse: separate; }
|
||||
.ui-table th,
|
||||
.ui-table td {
|
||||
padding: 5px 10px; }
|
||||
.ui-table thead th {
|
||||
font-weight: 600; }
|
||||
.ui-table tfoot td {
|
||||
border-top: 1px solid #494949;
|
||||
border-right: 1px solid #494949;
|
||||
text-align: center; }
|
||||
.ui-table tfoot td:last-child {
|
||||
border-right: 0; }
|
||||
|
||||
.layout-with-list-item-margins {
|
||||
margin-left: 30px !important; }
|
||||
|
||||
.emulate-content-left-padding {
|
||||
margin-left: 10px; }
|
||||
|
||||
.do-dont-label {
|
||||
margin-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
background: transparent none no-repeat scroll 0px 3px; }
|
||||
.do-dont-label.bad {
|
||||
background-image: url(ico_wrong.png); }
|
||||
.do-dont-label.good {
|
||||
background-image: url(ico_good.png); }
|
|
@ -29,12 +29,12 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
// select current page in sidenav and set up prev/next links if they exist
|
||||
var $selNavLink = $('#nav').find('a[href="' + pagePath + '"]');
|
||||
var $selNavLink = $('.nav-y').find('a[href="' + pagePath + '"]');
|
||||
if ($selNavLink.length) {
|
||||
$selListItem = $selNavLink.closest('li');
|
||||
|
||||
$selListItem.addClass('selected');
|
||||
$selListItem.closest('li.nav-section').addClass('expanded');
|
||||
$selListItem.closest('li>ul').addClass('expanded');
|
||||
|
||||
// set up prev links
|
||||
var $prevLink = [];
|
||||
|
@ -85,13 +85,13 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
// Set up expand/collapse behavior
|
||||
$('#nav li.nav-section').click(function() {
|
||||
$('.nav-y li').has('ul').click(function() {
|
||||
if ($(this).hasClass('expanded')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// hide other
|
||||
var $old = $('#nav li.nav-section.expanded');
|
||||
var $old = $('.nav-y li.expanded');
|
||||
if ($old.length) {
|
||||
var $oldUl = $old.children('ul');
|
||||
$oldUl.css('height', $oldUl.height() + 'px');
|
||||
|
@ -119,7 +119,7 @@ $(document).ready(function() {
|
|||
|
||||
// Stop expand/collapse behavior when clicking on nav section links (since we're navigating away
|
||||
// from the page)
|
||||
$('.nav-section-header').find('a:eq(0)').click(function(evt) {
|
||||
$('.nav-y li').has('ul').find('a:eq(0)').click(function(evt) {
|
||||
window.location.href = $(this).attr('href');
|
||||
return false;
|
||||
});
|
||||
|
|
Before Width: | Height: | Size: 990 B |
Before Width: | Height: | Size: 989 B |
Before Width: | Height: | Size: 992 B |
Before Width: | Height: | Size: 977 B |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 162 B |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 312 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1014 B |
After Width: | Height: | Size: 958 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 966 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 238 B |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 221 B |
After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 415 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 302 B After Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 437 B After Width: | Height: | Size: 437 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 980 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
* jQuery dacSlideshow 1.0
|
||||
*
|
||||
* Sample usage:
|
||||
* HTML -
|
||||
* <div class="slideshow-container">
|
||||
* <a href="" class="slideshow-prev">Prev</a>
|
||||
* <a href="" class="slideshow-next">Next</a>
|
||||
* <ul>
|
||||
* <li class="item"><img src="images/marquee1.jpg"></li>
|
||||
* <li class="item"><img src="images/marquee2.jpg"></li>
|
||||
* <li class="item"><img src="images/marquee3.jpg"></li>
|
||||
* <li class="item"><img src="images/marquee4.jpg"></li>
|
||||
* </ul>
|
||||
* </div>
|
||||
*
|
||||
* <script type="text/javascript">
|
||||
* $('.slideshow-container').dacSlideshow({
|
||||
* auto: true,
|
||||
* btnPrev: '.slideshow-prev',
|
||||
* btnNext: '.slideshow-next'
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* Options:
|
||||
* btnPrev: optional identifier for previous button
|
||||
* btnNext: optional identifier for next button
|
||||
* auto: whether or not to auto-proceed
|
||||
* speed: animation speed
|
||||
* autoTime: time between auto-rotation
|
||||
* easing: easing function for transition
|
||||
* start: item to select by default
|
||||
* scroll: direction to scroll in
|
||||
* pagination: whether or not to include dotted pagination
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.fn.dacSlideshow = function(o) {
|
||||
|
||||
//Options - see above
|
||||
o = $.extend({
|
||||
btnPrev: null,
|
||||
btnNext: null,
|
||||
auto: true,
|
||||
speed: 500,
|
||||
autoTime: 12000,
|
||||
easing: null,
|
||||
start: 0,
|
||||
scroll: 1,
|
||||
pagination: true
|
||||
|
||||
}, o || {});
|
||||
|
||||
//Set up a carousel for each
|
||||
return this.each(function() {
|
||||
|
||||
var running = false;
|
||||
var animCss = o.vertical ? "top" : "left";
|
||||
var sizeCss = o.vertical ? "height" : "width";
|
||||
var div = $(this);
|
||||
var ul = $("ul", div);
|
||||
var tLi = $("li", ul);
|
||||
var tl = tLi.size();
|
||||
var timer = null;
|
||||
|
||||
var li = $("li", ul);
|
||||
var itemLength = li.size();
|
||||
var curr = o.start;
|
||||
|
||||
li.css({float: o.vertical ? "none" : "left"});
|
||||
ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
|
||||
div.css({position: "relative", "z-index": "2", left: "0px"});
|
||||
|
||||
var liSize = o.vertical ? height(li) : width(li);
|
||||
var ulSize = liSize * itemLength;
|
||||
var divSize = liSize;
|
||||
|
||||
li.css({width: li.width(), height: li.height()});
|
||||
ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));
|
||||
|
||||
div.css(sizeCss, divSize+"px");
|
||||
|
||||
//Pagination
|
||||
if (o.pagination) {
|
||||
var pagination = $("<div class='pagination'></div>");
|
||||
var pag_ul = $("<ul></ul>");
|
||||
if (tl > 1) {
|
||||
for (var i=0;i<tl;i++) {
|
||||
var li = $("<li>"+i+"</li>");
|
||||
pag_ul.append(li);
|
||||
if (i==o.start) li.addClass('active');
|
||||
li.click(function() {
|
||||
go(parseInt($(this).text()));
|
||||
})
|
||||
}
|
||||
pagination.append(pag_ul);
|
||||
div.append(pagination);
|
||||
}
|
||||
}
|
||||
|
||||
//Previous button
|
||||
if(o.btnPrev)
|
||||
$(o.btnPrev).click(function(e) {
|
||||
e.preventDefault();
|
||||
return go(curr-o.scroll);
|
||||
});
|
||||
|
||||
//Next button
|
||||
if(o.btnNext)
|
||||
$(o.btnNext).click(function(e) {
|
||||
e.preventDefault();
|
||||
return go(curr+o.scroll);
|
||||
});
|
||||
|
||||
//Auto rotation
|
||||
if(o.auto) startRotateTimer();
|
||||
|
||||
function startRotateTimer() {
|
||||
clearInterval(timer);
|
||||
timer = setInterval(function() {
|
||||
if (curr == tl-1) {
|
||||
go(0);
|
||||
} else {
|
||||
go(curr+o.scroll);
|
||||
}
|
||||
}, o.autoTime);
|
||||
}
|
||||
|
||||
//Go to an item
|
||||
function go(to) {
|
||||
if(!running) {
|
||||
|
||||
if(to<0) {
|
||||
to = itemLength-1;
|
||||
} else if (to>itemLength-1) {
|
||||
to = 0;
|
||||
}
|
||||
curr = to;
|
||||
|
||||
running = true;
|
||||
|
||||
ul.animate(
|
||||
animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
|
||||
function() {
|
||||
running = false;
|
||||
}
|
||||
);
|
||||
|
||||
$(o.btnPrev + "," + o.btnNext).removeClass("disabled");
|
||||
$( (curr-o.scroll<0 && o.btnPrev)
|
||||
||
|
||||
(curr+o.scroll > itemLength && o.btnNext)
|
||||
||
|
||||
[]
|
||||
).addClass("disabled");
|
||||
|
||||
|
||||
var nav_items = $('li', pagination);
|
||||
nav_items.removeClass('active');
|
||||
nav_items.eq(to).addClass('active');
|
||||
|
||||
|
||||
}
|
||||
if(o.auto) startRotateTimer();
|
||||
return false;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
function css(el, prop) {
|
||||
return parseInt($.css(el[0], prop)) || 0;
|
||||
};
|
||||
function width(el) {
|
||||
return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
|
||||
};
|
||||
function height(el) {
|
||||
return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
|
||||
};
|
||||
|
||||
})(jQuery);
|
|
@ -0,0 +1,459 @@
|
|||
var navBarIsFixed = false;
|
||||
$(document).ready(function() {
|
||||
// init the fullscreen toggle click event
|
||||
$('#nav-swap .fullscreen').click(function(){
|
||||
if ($(this).hasClass('disabled')) {
|
||||
toggleFullscreen(true);
|
||||
} else {
|
||||
toggleFullscreen(false);
|
||||
}
|
||||
});
|
||||
|
||||
// initialize the divs with custom scrollbars
|
||||
$('.scroll-pane').jScrollPane( {verticalGutter:0} );
|
||||
|
||||
// add HRs below all H2s (except for a few other h2 variants)
|
||||
$('h2').not('#qv h2').not('#tb h2').not('#devdoc-nav h2').css({marginBottom:0}).after('<hr/>');
|
||||
|
||||
// set search's onkeyup handler here so we can show suggestions even while search results are visible
|
||||
$("#search_autocomplete").keyup(function() {return search_changed(event, false, '/')});
|
||||
|
||||
// set up the search close button
|
||||
$('.search .close').click(function() {
|
||||
$searchInput = $('#search_autocomplete');
|
||||
$searchInput.attr('value', '');
|
||||
$(this).addClass("hide");
|
||||
$("#search-container").removeClass('active');
|
||||
$("#search_autocomplete").blur();
|
||||
search_focus_changed($searchInput.get(), false); // see search_autocomplete.js
|
||||
hideResults(); // see search_autocomplete.js
|
||||
});
|
||||
$('.search').click(function() {
|
||||
if (!$('#search_autocomplete').is(":focused")) {
|
||||
$('#search_autocomplete').focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Set up quicknav
|
||||
var quicknav_open = false;
|
||||
$("#btn-quicknav").click(function() {
|
||||
if (quicknav_open) {
|
||||
$(this).removeClass('active');
|
||||
quicknav_open = false;
|
||||
collapse();
|
||||
} else {
|
||||
$(this).addClass('active');
|
||||
quicknav_open = true;
|
||||
expand();
|
||||
}
|
||||
})
|
||||
|
||||
var expand = function() {
|
||||
$('#header-wrap').addClass('quicknav');
|
||||
$('#quicknav').stop().show().animate({opacity:'1'});
|
||||
}
|
||||
|
||||
var collapse = function() {
|
||||
$('#quicknav').stop().animate({opacity:'0'}, 100, function() {
|
||||
$(this).hide();
|
||||
$('#header-wrap').removeClass('quicknav');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//Set up search
|
||||
$("#search_autocomplete").focus(function() {
|
||||
$("#search-container").addClass('active');
|
||||
})
|
||||
$("#search-container").mouseover(function() {
|
||||
$("#search-container").addClass('active');
|
||||
$("#search_autocomplete").focus();
|
||||
})
|
||||
$("#search-container").mouseout(function() {
|
||||
if ($("#search_autocomplete").is(":focus")) return;
|
||||
if ($("#search_autocomplete").val() == '') {
|
||||
setTimeout(function(){
|
||||
$("#search-container").removeClass('active');
|
||||
$("#search_autocomplete").blur();
|
||||
},250);
|
||||
}
|
||||
})
|
||||
$("#search_autocomplete").blur(function() {
|
||||
if ($("#search_autocomplete").val() == '') {
|
||||
$("#search-container").removeClass('active');
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// prep nav expandos
|
||||
var pagePath = document.location.pathname;
|
||||
// account for intl docs by removing the intl/*/ path
|
||||
if (pagePath.indexOf("/intl/") == 0) {
|
||||
pagePath = pagePath.substr(pagePath.indexOf("/",6)); // start after intl/ to get last /
|
||||
}
|
||||
|
||||
if (pagePath.indexOf(SITE_ROOT) == 0) {
|
||||
if (pagePath == '' || pagePath.charAt(pagePath.length - 1) == '/') {
|
||||
pagePath += 'index.html';
|
||||
}
|
||||
}
|
||||
|
||||
if (SITE_ROOT.match(/\.\.\//) || SITE_ROOT == '') {
|
||||
// If running locally, SITE_ROOT will be a relative path, so account for that by
|
||||
// finding the relative URL to this page. This will allow us to find links on the page
|
||||
// leading back to this page.
|
||||
var pathParts = pagePath.split('/');
|
||||
var relativePagePathParts = [];
|
||||
var upDirs = (SITE_ROOT.match(/(\.\.\/)+/) || [''])[0].length / 3;
|
||||
for (var i = 0; i < upDirs; i++) {
|
||||
relativePagePathParts.push('..');
|
||||
}
|
||||
for (var i = 0; i < upDirs; i++) {
|
||||
relativePagePathParts.push(pathParts[pathParts.length - (upDirs - i) - 1]);
|
||||
}
|
||||
relativePagePathParts.push(pathParts[pathParts.length - 1]);
|
||||
pagePath = relativePagePathParts.join('/');
|
||||
} else {
|
||||
// Otherwise the page path is already an absolute URL
|
||||
}
|
||||
|
||||
// select current page in sidenav and set up prev/next links if they exist
|
||||
var $selNavLink = $('#nav').find('a[href="' + pagePath + '"]');
|
||||
if ($selNavLink.length) {
|
||||
$selListItem = $selNavLink.closest('li');
|
||||
|
||||
$selListItem.addClass('selected');
|
||||
$selListItem.closest('li.nav-section').addClass('expanded');
|
||||
$selListItem.closest('li.nav-section').children('ul').show();
|
||||
$selListItem.closest('li.nav-section').parent().closest('li.nav-section').addClass('expanded');
|
||||
$selListItem.closest('li.nav-section').parent().closest('ul').show();
|
||||
|
||||
|
||||
// $selListItem.closest('li.nav-section').closest('li.nav-section').addClass('expanded');
|
||||
// $selListItem.closest('li.nav-section').closest('li.nav-section').children('ul').show();
|
||||
|
||||
// set up prev links
|
||||
var $prevLink = [];
|
||||
var $prevListItem = $selListItem.prev('li');
|
||||
|
||||
var crossBoundaries = ($("body.design").length > 0) || ($("body.guide").length > 0) ? true : false; // navigate across topic boundaries only in design docs
|
||||
if ($prevListItem.length) {
|
||||
if ($prevListItem.hasClass('nav-section')) {
|
||||
if (crossBoundaries) {
|
||||
// jump to last topic of previous section
|
||||
$prevLink = $prevListItem.find('a:last');
|
||||
}
|
||||
} else {
|
||||
// jump to previous topic in this section
|
||||
$prevLink = $prevListItem.find('a:eq(0)');
|
||||
}
|
||||
} else {
|
||||
// jump to this section's index page (if it exists)
|
||||
var $parentListItem = $selListItem.parents('li');
|
||||
$prevLink = $selListItem.parents('li').find('a');
|
||||
|
||||
// except if cross boundaries aren't allowed, and we're at the top of a section already (and there's another parent)
|
||||
if (!crossBoundaries && $parentListItem.hasClass('nav-section') && $selListItem.hasClass('nav-section')) {
|
||||
$prevLink = [];
|
||||
}
|
||||
}
|
||||
|
||||
if ($prevLink.length) {
|
||||
var prevHref = $prevLink.attr('href');
|
||||
if (prevHref == SITE_ROOT + 'index.html') {
|
||||
// Don't show Previous when it leads to the homepage
|
||||
} else {
|
||||
$('.prev-page-link').attr('href', $prevLink.attr('href')).removeClass("hide");
|
||||
}
|
||||
}
|
||||
|
||||
// set up next links
|
||||
var $nextLink = [];
|
||||
var startCourse = false;
|
||||
var startClass = false;
|
||||
var training = $(".next-class-link").length; // decides whether to provide "next class" link
|
||||
var isCrossingBoundary = false;
|
||||
|
||||
if ($selListItem.hasClass('nav-section')) {
|
||||
// we're on an index page, jump to the first topic
|
||||
$nextLink = $selListItem.find('ul').find('a:eq(0)');
|
||||
|
||||
// if there aren't any children, go to the next section (required for About pages)
|
||||
if($nextLink.length == 0) {
|
||||
$nextLink = $selListItem.next('li').find('a');
|
||||
}
|
||||
|
||||
// Handle some Training specialties
|
||||
if ($selListItem.parent().is("#nav") && $(".start-course-link").length) {
|
||||
// this means we're at the very top of the TOC hierarchy
|
||||
startCourse = true;
|
||||
} else if ($(".start-class-link").length) {
|
||||
// this means this page has children but is not at the top (it's a class, not a course)
|
||||
startClass = true;
|
||||
}
|
||||
} else {
|
||||
// jump to the next topic in this section (if it exists)
|
||||
$nextLink = $selListItem.next('li').find('a:eq(0)');
|
||||
if (!$nextLink.length) {
|
||||
if (crossBoundaries || training) {
|
||||
// no more topics in this section, jump to the first topic in the next section
|
||||
$nextLink = $selListItem.parents('li:eq(0)').next('li.nav-section').find('a:eq(0)');
|
||||
isCrossingBoundary = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nextLink.length) {
|
||||
if (startCourse || startClass) {
|
||||
if (startCourse) {
|
||||
$('.start-course-link').attr('href', $nextLink.attr('href')).removeClass("hide");
|
||||
} else {
|
||||
$('.start-class-link').attr('href', $nextLink.attr('href')).removeClass("hide");
|
||||
}
|
||||
// if there's no training bar (below the start button), then we need to add a bottom border to button
|
||||
if (!$("#tb").length) {
|
||||
$('.start-course-link').css({'border-bottom':'1px solid #DADADA'});
|
||||
$('.start-class-link').css({'border-bottom':'1px solid #DADADA'});
|
||||
}
|
||||
} else if (training && isCrossingBoundary) {
|
||||
$('.content-footer.next-class').show();
|
||||
$('.next-page-link').attr('href','').removeClass("hide").addClass("disabled").click(function() {
|
||||
return false;
|
||||
});
|
||||
$('.next-class-link').attr('href',$nextLink.attr('href')).removeClass("hide").append($nextLink.html());
|
||||
$('.next-class-link').find('.new').empty();
|
||||
} else {
|
||||
$('.next-page-link').attr('href', $nextLink.attr('href')).removeClass("hide");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Set up expand/collapse behavior
|
||||
$('#nav li.nav-section .nav-section-header').click(function() {
|
||||
var section = $(this).closest('li.nav-section');
|
||||
if (section.hasClass('expanded')) {
|
||||
/* hide me */
|
||||
// if (section.hasClass('selected') || section.find('li').hasClass('selected')) {
|
||||
// /* but not if myself or my descendents are selected */
|
||||
// return;
|
||||
// }
|
||||
section.children('ul').slideUp(250, function() {
|
||||
section.closest('li').removeClass('expanded');
|
||||
resizeNav();
|
||||
});
|
||||
} else {
|
||||
/* show me */
|
||||
// first hide all other siblings
|
||||
var $others = $('li.nav-section.expanded', $(this).closest('ul'));
|
||||
$others.removeClass('expanded').children('ul').slideUp(250);
|
||||
|
||||
// now expand me
|
||||
section.closest('li').addClass('expanded');
|
||||
section.children('ul').slideDown(250, function() {
|
||||
resizeNav();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(".scroll-pane").scroll(function(event) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Resize nav height when window height changes */
|
||||
$(window).resize(function() {
|
||||
var stylesheet = $('link[rel="stylesheet"][title="fullscreen"]');
|
||||
setNavBarLeftPos(); // do this even if sidenav isn't fixed because it could become fixed
|
||||
// make sidenav behave when resizing the window and side-scolling is a concern
|
||||
if (navBarIsFixed) {
|
||||
if ((stylesheet.attr("disabled") == "disabled") || stylesheet.length == 0) {
|
||||
updateSideNavPosition();
|
||||
} else {
|
||||
updateSidenavFullscreenWidth();
|
||||
}
|
||||
}
|
||||
resizeNav();
|
||||
});
|
||||
|
||||
|
||||
// Set up fixed navbar
|
||||
var prevScrollLeft = 0; // used to compare current position to previous position of horiz scroll
|
||||
$(window).scroll(function(event) {
|
||||
if (event.target.nodeName == "DIV") {
|
||||
// Dump scroll event if the target is a DIV, because that means the event is coming
|
||||
// from a scrollable div and so there's no need to make adjustments to our layout
|
||||
return;
|
||||
}
|
||||
var scrollTop = $(window).scrollTop();
|
||||
var headerHeight = $('#header').outerHeight();
|
||||
var subheaderHeight = $('#nav-x').outerHeight();
|
||||
var searchResultHeight = $('#searchResults').is(":visible") ? $('#searchResults').outerHeight() : 0;
|
||||
var totalHeaderHeight = headerHeight + subheaderHeight + searchResultHeight;
|
||||
var navBarShouldBeFixed = scrollTop > totalHeaderHeight;
|
||||
|
||||
var scrollLeft = $(window).scrollLeft();
|
||||
// When the sidenav is fixed and user scrolls horizontally, reposition the sidenav to match
|
||||
if (navBarIsFixed && (scrollLeft != prevScrollLeft)) {
|
||||
updateSideNavPosition();
|
||||
prevScrollLeft = scrollLeft;
|
||||
}
|
||||
|
||||
// Don't continue if the header is sufficently far away (to avoid intensive resizing that slows scrolling)
|
||||
if (navBarIsFixed && navBarShouldBeFixed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (navBarIsFixed != navBarShouldBeFixed) {
|
||||
if (navBarShouldBeFixed) {
|
||||
// make it fixed
|
||||
var width = $('#devdoc-nav').width();
|
||||
var margin = $('#devdoc-nav').parent().css('margin');
|
||||
$('#devdoc-nav')
|
||||
.addClass('fixed')
|
||||
.css({'width':width+'px','margin':margin})
|
||||
.prependTo('#body-content');
|
||||
// add neato "back to top" button
|
||||
$('#devdoc-nav a.totop').css({'display':'block','width':$("#nav").innerWidth()+'px'});
|
||||
|
||||
// update the sidenaav position for side scrolling
|
||||
updateSideNavPosition();
|
||||
} else {
|
||||
// make it static again
|
||||
$('#devdoc-nav')
|
||||
.removeClass('fixed')
|
||||
.css({'width':'auto','margin':''})
|
||||
.prependTo('#side-nav');
|
||||
$('#devdoc-nav a.totop').hide();
|
||||
}
|
||||
navBarIsFixed = navBarShouldBeFixed;
|
||||
}
|
||||
|
||||
resizeNav(250); // pass true in order to delay the scrollbar re-initialization for performance reasons
|
||||
});
|
||||
|
||||
|
||||
var navBarLeftPos;
|
||||
if ($('#devdoc-nav').length) {
|
||||
setNavBarLeftPos();
|
||||
}
|
||||
|
||||
|
||||
// Stop expand/collapse behavior when clicking on nav section links (since we're navigating away
|
||||
// from the page)
|
||||
$('.nav-section-header').find('a:eq(0)').click(function(evt) {
|
||||
window.location.href = $(this).attr('href');
|
||||
return false;
|
||||
});
|
||||
|
||||
// Set up play-on-hover <video> tags.
|
||||
$('video.play-on-hover').bind('click', function(){
|
||||
$(this).get(0).load(); // in case the video isn't seekable
|
||||
$(this).get(0).play();
|
||||
});
|
||||
|
||||
// Set up tooltips
|
||||
var TOOLTIP_MARGIN = 10;
|
||||
$('acronym').each(function() {
|
||||
var $target = $(this);
|
||||
var $tooltip = $('<div>')
|
||||
.addClass('tooltip-box')
|
||||
.text($target.attr('title'))
|
||||
.hide()
|
||||
.appendTo('body');
|
||||
$target.removeAttr('title');
|
||||
|
||||
$target.hover(function() {
|
||||
// in
|
||||
var targetRect = $target.offset();
|
||||
targetRect.width = $target.width();
|
||||
targetRect.height = $target.height();
|
||||
|
||||
$tooltip.css({
|
||||
left: targetRect.left,
|
||||
top: targetRect.top + targetRect.height + TOOLTIP_MARGIN
|
||||
});
|
||||
$tooltip.addClass('below');
|
||||
$tooltip.show();
|
||||
}, function() {
|
||||
// out
|
||||
$tooltip.hide();
|
||||
});
|
||||
});
|
||||
|
||||
// Set up <h2> deeplinks
|
||||
$('h2').click(function() {
|
||||
var id = $(this).attr('id');
|
||||
if (id) {
|
||||
document.location.hash = id;
|
||||
}
|
||||
});
|
||||
|
||||
//Loads the +1 button
|
||||
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
||||
po.src = 'https://apis.google.com/js/plusone.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
||||
|
||||
|
||||
// Revise the sidenav widths to make room for the scrollbar
|
||||
// which avoids the visible width from changing each time the bar appears
|
||||
var $sidenav = $("#side-nav");
|
||||
var sidenav_width = parseInt($sidenav.innerWidth());
|
||||
|
||||
$("#devdoc-nav #nav").css("width", sidenav_width - 4 + "px"); // 4px is scrollbar width
|
||||
|
||||
|
||||
$(".scroll-pane").removeAttr("tabindex"); // get rid of tabindex added by jscroller
|
||||
|
||||
if ($(".scroll-pane").length > 1) {
|
||||
// Check if there's a user preference for the panel heights
|
||||
var cookieHeight = readCookie("reference_height");
|
||||
if (cookieHeight) {
|
||||
restoreHeight(cookieHeight);
|
||||
}
|
||||
}
|
||||
|
||||
resizeNav();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
function toggleFullscreen(enable) {
|
||||
var delay = 20;
|
||||
var enabled = false;
|
||||
var stylesheet = $('link[rel="stylesheet"][title="fullscreen"]');
|
||||
if (enable) {
|
||||
// Currently NOT USING fullscreen; enable fullscreen
|
||||
stylesheet.removeAttr('disabled');
|
||||
$('#nav-swap .fullscreen').removeClass('disabled');
|
||||
$('#devdoc-nav').css({left:''});
|
||||
setTimeout(updateSidenavFullscreenWidth,delay); // need to wait a moment for css to switch
|
||||
enabled = true;
|
||||
} else {
|
||||
// Currently USING fullscreen; disable fullscreen
|
||||
stylesheet.attr('disabled', 'disabled');
|
||||
$('#nav-swap .fullscreen').addClass('disabled');
|
||||
setTimeout(updateSidenavFixedWidth,delay); // need to wait a moment for css to switch
|
||||
enabled = false;
|
||||
}
|
||||
writeCookie("fullscreen", enabled, null, null);
|
||||
setNavBarLeftPos();
|
||||
resizeNav(delay);
|
||||
setTimeout(initSidenavHeightResize,delay);
|
||||
}
|
||||
|
||||
|
||||
function setNavBarLeftPos() {
|
||||
navBarLeftPos = $('#body-content').offset().left;
|
||||
}
|
||||
|
||||
|
||||
function updateSideNavPosition() {
|
||||
var newLeft = $(window).scrollLeft() - navBarLeftPos;
|
||||
$('#devdoc-nav').css({left: -newLeft});
|
||||
$('#devdoc-nav .totop').css({left: -(newLeft - parseInt($('#side-nav').css('margin-left')))});
|
||||
}
|
||||
|
|
@ -1,42 +1,62 @@
|
|||
|
||||
/* API LEVEL TOGGLE */
|
||||
addLoadEvent(changeApiLevel);
|
||||
/* Initialize some droiddoc stuff */
|
||||
$(document).ready(function() {
|
||||
|
||||
// init available apis based on user pref
|
||||
changeApiLevel();
|
||||
initSidenavHeightResize()
|
||||
});
|
||||
|
||||
var API_LEVEL_ENABLED_COOKIE = "api_level_enabled";
|
||||
var API_LEVEL_COOKIE = "api_level";
|
||||
var minLevel = 1;
|
||||
var maxLevel = 1;
|
||||
|
||||
function toggleApiLevelSelector(checkbox) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
|
||||
var expiration = date.toGMTString();
|
||||
if (checkbox.checked) {
|
||||
$("#apiLevelSelector").removeAttr("disabled");
|
||||
$("#api-level-toggle label").removeClass("disabled");
|
||||
writeCookie(API_LEVEL_ENABLED_COOKIE, 1, null, expiration);
|
||||
} else {
|
||||
$("#apiLevelSelector").attr("disabled","disabled");
|
||||
$("#api-level-toggle label").addClass("disabled");
|
||||
writeCookie(API_LEVEL_ENABLED_COOKIE, 0, null, expiration);
|
||||
/******* SIDENAV DIMENSIONS ************/
|
||||
|
||||
|
||||
function initSidenavHeightResize() {
|
||||
// Change the drag bar size to nicely fit the scrollbar positions
|
||||
var $dragBar = $(".ui-resizable-s");
|
||||
$dragBar.css({'width': $dragBar.parent().width() - 5 + "px"});
|
||||
|
||||
$( "#resize-packages-nav" ).resizable({
|
||||
containment: "#nav-panels",
|
||||
handles: "s",
|
||||
alsoResize: "#packages-nav",
|
||||
resize: function(event, ui) { resizeNav(); }, /* resize the nav while dragging */
|
||||
stop: function(event, ui) { saveNavPanels(); } /* once stopped, save the sizes to cookie */
|
||||
});
|
||||
|
||||
}
|
||||
changeApiLevel();
|
||||
|
||||
function updateSidenavFixedWidth() {
|
||||
if (!navBarIsFixed) return;
|
||||
$('#devdoc-nav').css({
|
||||
'width' : $('#side-nav').css('width'),
|
||||
'margin' : $('#side-nav').css('margin')
|
||||
});
|
||||
$('#devdoc-nav a.totop').css({'display':'block','width':$("#nav").innerWidth()+'px'});
|
||||
|
||||
initSidenavHeightResize();
|
||||
}
|
||||
|
||||
function updateSidenavFullscreenWidth() {
|
||||
if (!navBarIsFixed) return;
|
||||
$('#devdoc-nav').css({
|
||||
'width' : $('#side-nav').css('width'),
|
||||
'margin' : $('#side-nav').css('margin')
|
||||
});
|
||||
$('#devdoc-nav .totop').css({'left': 'inherit'});
|
||||
|
||||
initSidenavHeightResize();
|
||||
}
|
||||
|
||||
function buildApiLevelSelector() {
|
||||
maxLevel = SINCE_DATA.length;
|
||||
var userApiLevelEnabled = readCookie(API_LEVEL_ENABLED_COOKIE);
|
||||
var userApiLevel = parseInt(readCookie(API_LEVEL_COOKIE));
|
||||
userApiLevel = userApiLevel == 0 ? maxLevel : userApiLevel; // If there's no cookie (zero), use the max by default
|
||||
|
||||
if (userApiLevelEnabled == 0) {
|
||||
$("#apiLevelSelector").attr("disabled","disabled");
|
||||
} else {
|
||||
$("#apiLevelCheckbox").attr("checked","checked");
|
||||
$("#api-level-toggle label").removeClass("disabled");
|
||||
}
|
||||
|
||||
minLevel = parseInt($("body").attr("class"));
|
||||
minLevel = parseInt($("#doc-api-level").attr("class"));
|
||||
// Handle provisional api levels; the provisional level will always be the highest possible level
|
||||
// Provisional api levels will also have a length; other stuff that's just missing a level won't,
|
||||
// so leave those kinds of entities at the default level of 1 (for example, the R.styleable class)
|
||||
|
@ -57,28 +77,23 @@ function buildApiLevelSelector() {
|
|||
|
||||
function changeApiLevel() {
|
||||
maxLevel = SINCE_DATA.length;
|
||||
var userApiLevelEnabled = readCookie(API_LEVEL_ENABLED_COOKIE);
|
||||
var selectedLevel = maxLevel;
|
||||
|
||||
if (userApiLevelEnabled == 0) {
|
||||
toggleVisisbleApis(selectedLevel, "body");
|
||||
} else {
|
||||
selectedLevel = parseInt($("#apiLevelSelector option:selected").val());
|
||||
toggleVisisbleApis(selectedLevel, "body");
|
||||
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);
|
||||
}
|
||||
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);
|
||||
|
||||
if (selectedLevel < minLevel) {
|
||||
var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class";
|
||||
$("#naMessage").show().html("<div><p><strong>This " + thing + " is not available with API Level " + selectedLevel + ".</strong></p>"
|
||||
+ "<p>To use this " + thing + ", your application must specify API Level \"" + $("body").attr("class") + "\" or higher in its manifest "
|
||||
+ "and be compiled against a version of the Android library that supports an equal or higher API Level. To reveal this "
|
||||
+ "document, change the value of the API Level filter above.</p>"
|
||||
+ "<p><a href='" +toRoot+ "guide/appendix/api-levels.html'>What is the API Level?</a></p></div>");
|
||||
$("#naMessage").show().html("<div><p><strong>This " + thing + " is not available with API level " + selectedLevel + ".</strong></p>"
|
||||
+ "<p>To use this " + thing + ", you must develop your app using a build target "
|
||||
+ "that supports API level " + $("#doc-api-level").attr("class") + " or higher. To read these "
|
||||
+ "APIs, change the value of the API level filter above.</p>"
|
||||
+ "<p><a href='" +toRoot+ "guide/appendix/api-levels.html'>What is the API level?</a></p></div>");
|
||||
} else {
|
||||
$("#naMessage").hide();
|
||||
}
|
||||
|
@ -106,12 +121,23 @@ function toggleVisisbleApis(selectedLevel, context) {
|
|||
}
|
||||
|
||||
// Grey things out that aren't available and give a tooltip title
|
||||
if (apiLevelNum > selectedLevelNum) obj.addClass("absent").attr("title","Requires API Level \""
|
||||
if (apiLevelNum > selectedLevelNum) {
|
||||
obj.addClass("absent").attr("title","Requires API Level \""
|
||||
+ apiLevel + "\" or higher");
|
||||
}
|
||||
else obj.removeClass("absent").removeAttr("title");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* NAVTREE */
|
||||
|
||||
function new_node(me, mom, text, link, children_data, api_level)
|
||||
|
@ -131,13 +157,8 @@ function new_node(me, mom, text, link, children_data, api_level)
|
|||
$(node.label_div).addClass("api-level-"+api_level);
|
||||
}
|
||||
node.li.appendChild(node.label_div);
|
||||
node.label_div.style.paddingLeft = 10*node.depth + "px";
|
||||
|
||||
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";
|
||||
if (children_data != null) {
|
||||
node.expand_toggle = document.createElement("a");
|
||||
node.expand_toggle.href = "javascript:void(0)";
|
||||
node.expand_toggle.onclick = function() {
|
||||
|
@ -154,6 +175,7 @@ function new_node(me, mom, text, link, children_data, api_level)
|
|||
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.width = "8";
|
||||
node.plus_img.border = "0";
|
||||
node.expand_toggle.appendChild(node.plus_img);
|
||||
|
||||
|
@ -200,7 +222,9 @@ function expand_node(me, node)
|
|||
$(node.get_children_ul()).slideDown("fast");
|
||||
} else {
|
||||
get_node(me, node);
|
||||
if ($(node.label_div).hasClass("absent")) $(node.get_children_ul()).addClass("absent");
|
||||
if ($(node.label_div).hasClass("absent")) {
|
||||
$(node.get_children_ul()).addClass("absent");
|
||||
}
|
||||
$(node.get_children_ul()).slideDown("fast");
|
||||
}
|
||||
node.plus_img.src = me.toroot + "assets/images/triangle-opened-small.png";
|
||||
|
@ -276,7 +300,7 @@ function load_navtree_data(toroot) {
|
|||
}
|
||||
|
||||
function init_default_navtree(toroot) {
|
||||
init_navtree("nav-tree", toroot, NAVTREE_DATA);
|
||||
init_navtree("tree-list", toroot, NAVTREE_DATA);
|
||||
|
||||
// perform api level toggling because because the whole tree is new to the DOM
|
||||
var selectedLevel = $("#apiLevelSelector option:selected").val();
|
||||
|
@ -372,7 +396,7 @@ function toggleAllInherited(linkObj, expand) {
|
|||
*/
|
||||
function toggleAllClassInherited() {
|
||||
var a = $("#toggleAllClassInherited"); // get toggle link from class title
|
||||
var toggles = $(".toggle-all", $("#doc-content"));
|
||||
var toggles = $(".toggle-all", $("#body-content"));
|
||||
if (a.text() == "[Expand All]") {
|
||||
toggles.each(function(i) {
|
||||
toggleAllInherited(this, true);
|
||||
|
@ -389,7 +413,7 @@ function toggleAllClassInherited() {
|
|||
|
||||
/* Expand all inherited members in the class. Used when initiating page search */
|
||||
function ensureAllInheritedExpanded() {
|
||||
var toggles = $(".toggle-all", $("#doc-content"));
|
||||
var toggles = $(".toggle-all", $("#body-content"));
|
||||
toggles.each(function(i) {
|
||||
toggleAllInherited(this, true);
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
#g-setup{position:absolute;top:150px;left:-310px;padding:6px;margin:0;list-style:none;width:320px!important;background-color:#d1cfe6;border:2px solid #a19bd1;z-index:2100;}#g-setup *{background:transparent!important;border:0!important;color:#58517c!important;font-family:Verdana,Geneva,sans-serif!important;font-size:10px!important;font-weight:normal!important;letter-spacing:normal!important;line-height:1!important;list-style-type:none!important;margin:0!important;padding:0!important;text-decoration:none!important;text-indent:0!important;text-transform:none!important;word-spacing:0!important;z-index:2100!important;}#g-setup .head{font-weight:bold!important;text-align:center;border-bottom:1px solid #7cb267!important;}#g-setup ul{width:150px;float:left!important;}#g-setup li{clear:left;padding:5px!important;}* html #g-setup li{clear:none!important;padding:4px!important;}#g-setup span{float:left!important;width:50px;padding:1px 4px 0 0!important;text-align:right!important;line-height:1.5!important;}#g-setup input,#g-setup select{float:left!important;width:70px;border:1px solid #a19bd1!important;background-color:#e7e6ee!important;padding:2px!important;}#g-setup select{width:77px;padding:0!important;}#g-setup-misc{margin-top:5px!important;clear:left;float:none!important;width:300px!important;border-top:1px solid #7cb267!important;}#g-setup-misc span{line-height:1.1!important;width:200px;}#g-setup-misc input{width:15px;padding:0!important;height:15px;}#g-setup-tab{width:26px;overflow:hidden;position:absolute;top:0;left:100%;margin-left:-26px!important;z-index:2100!important;}#g-setup-tab img{left:0;position:relative;}#g-grid{left:0;position:absolute;z-index:500;top:0;}#g-grid .g-vertical,#g-grid .g-horizontal{position:absolute;z-index:1000;}*:first-child+html #g-grid .g-horizontal,*:first-child+html #g-grid .g-vertical{margin-left:-1px;}#g-grid .g-horizontal{min-height:1px;height:1px;font-size:0;line-height:0;}
|
|
@ -0,0 +1,271 @@
|
|||
/*
|
||||
* Release: 1.3.1 2009-04-26
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Andr?e Hansson (peolanha AT gmail DOT com)
|
||||
* MIT License - http://www.opensource.org/licenses/mit-license.php
|
||||
* Idea loosely based on JASH, http://billyreisinger.com/jash/
|
||||
*
|
||||
* Website: http://gridder.andreehansson.se/
|
||||
*
|
||||
* Changelog:
|
||||
* - New GUI! The new GUI should be less obtrusive and has been repositioned.
|
||||
* It is also featuring a slight delay on inputs so that you'll have a chance
|
||||
* to change the settings before it is re-rendering the grid
|
||||
* - Due to a lot of inquries regarding affiliation with jQuery the filenames has
|
||||
* been changed, I'm very sorry for the inconvenience!
|
||||
* - CSS issues with the GUI should also be fixed in more websites, please report
|
||||
* in any issue you stumble upon
|
||||
* - A small bug in IE that made the paragraph lines not position correctly has been
|
||||
* fixed
|
||||
* - A dropdown box has replaced the columns input box, 960 Gridder calculates the
|
||||
* proper number of columns that can be used with the specified grid width
|
||||
* - The 960 Gridder is now displaying perfectly (into the very pixels) in all
|
||||
* A-grade browsers (according to browsershots.org)
|
||||
* - An option to invert the gutters has been added, set this to 'true' if
|
||||
* you want to use it, OR use the shortcut CTRL+ALT+A
|
||||
* - Some other minor changes...
|
||||
*/
|
||||
function Grid() {
|
||||
var c = this;
|
||||
c.settingsDef = {
|
||||
urlBase: "http://gridder.andreehansson.se/releases/1.3.1/",
|
||||
gColor: "#EEEEEE",
|
||||
gColumns: 12,
|
||||
gOpacity: 0.45,
|
||||
gWidth: 10,
|
||||
pColor: "#C0C0C0",
|
||||
pHeight: 15,
|
||||
pOffset: 0,
|
||||
pOpacity: 0.55,
|
||||
center: true,
|
||||
invert: false,
|
||||
gEnabled: true,
|
||||
pEnabled: true,
|
||||
size: 960,
|
||||
fixFlash: true,
|
||||
setupEnabled: true,
|
||||
pressedKeys: [],
|
||||
delayTimer: ""
|
||||
};
|
||||
c.settings = (typeof (window.gOverride) === "undefined") ? {} : window.gOverride;
|
||||
for (var a in c.settingsDef) {
|
||||
if (typeof (c.settings[a]) === "undefined") {
|
||||
c.settings[a] = c.settingsDef[a];
|
||||
}
|
||||
}
|
||||
if (typeof (window.jQuery) === "undefined" || jQuery().jquery.match(/^1\.3/) === null) {
|
||||
window.jQuery = undefined;
|
||||
var b = document.createElement("script");
|
||||
b.type = "text/javascript";
|
||||
b.src = c.settings.urlBase + "jquery.js";
|
||||
document.body.appendChild(b);
|
||||
}
|
||||
c._createEntity = function (e, d) {
|
||||
jQuery('<div class="g-' + e + '"> </div>').appendTo("#g-grid").css(d);
|
||||
};
|
||||
c._setVariable = function (d, e) {
|
||||
d = d.replace(/g-setup-/, "");
|
||||
if (isNaN(parseInt(e, 10)) || parseInt(e, 10) === 0) {
|
||||
c.settings[d] = e;
|
||||
} else {
|
||||
c.settings[d] = parseInt(e, 10);
|
||||
}
|
||||
if (e === true) {
|
||||
jQuery("#g-setup-" + d).attr("checked", "checked");
|
||||
} else {
|
||||
if (e === false) {
|
||||
jQuery("#g-setup-" + d).removeAttr("checked");
|
||||
} else {
|
||||
jQuery("#g-setup-" + d).val(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
c.setupWindow = function () {
|
||||
jQuery('<style type"text/css">#g-setup{position:absolute;top:150px;left:-310px;padding:6px;margin:0;list-style:none;width:320px!important;background-color:#d1cfe6;border:2px solid #a19bd1;z-index:2100; display:none;}#g-setup *{background:transparent!important;border:0!important;color:#58517c!important;font-family:Verdana,Geneva,sans-serif!important;font-size:10px!important;font-weight:normal!important;letter-spacing:normal!important;line-height:1!important;list-style-type:none!important;margin:0!important;padding:0!important;text-decoration:none!important;text-indent:0!important;text-transform:none!important;word-spacing:0!important;z-index:2100!important;}#g-setup .head{font-weight:bold!important;text-align:center;border-bottom:1px solid #7cb267!important;}#g-setup ul{width:150px;float:left!important;}#g-setup li{clear:left;padding:5px!important;}* html #g-setup li{clear:none!important;padding:4px!important;}#g-setup span{float:left!important;width:50px;padding:1px 4px 0 0!important;text-align:right!important;line-height:1.5!important;}#g-setup input,#g-setup select{float:left!important;width:70px;border:1px solid #a19bd1!important;background-color:#e7e6ee!important;padding:2px!important;}#g-setup select{width:77px;padding:0!important;}#g-setup-misc{margin-top:5px!important;clear:left;float:none!important;width:300px!important;border-top:1px solid #7cb267!important;}#g-setup-misc span{line-height:1.1!important;width:200px;}#g-setup-misc input{width:15px;padding:0!important;height:15px;}#g-setup-tab{width:26px;overflow:hidden;position:absolute;top:0;left:100%;margin-left:-26px!important;z-index:2100!important;}#g-setup-tab img{left:0;position:relative;}#g-grid{left:0;position:absolute;z-index:500;top:0;}#g-grid .g-vertical,#g-grid .g-horizontal{position:absolute;z-index:1000;}*:first-child+html #g-grid .g-horizontal,*:first-child+html #g-grid .g-vertical{margin-left:-1px;}#g-grid .g-horizontal{min-height:1px;height:1px;font-size:0;line-height:0;}</style>').appendTo("head");
|
||||
c.settings.height = jQuery(document).height();
|
||||
if (c.settings.setupEnabled) {
|
||||
jQuery('<div id="g-setup"><ul><li class="head">Vertical</li><li><span>Color</span><input id="g-setup-gColor" /></li><li><span>Opacity</span><input id="g-setup-gOpacity" /></li><li><span>Width</span><input id="g-setup-gWidth" /></li><li><span>Columns</span><select id="g-setup-gColumns"></select></li></ul><ul><li class="head">Horizontal</li><li><span>Color</span><input id="g-setup-pColor" /></li><li><span>Opacity</span><input id="g-setup-pOpacity" /></li><li><span>Height</span><input id="g-setup-pHeight" /></li><li><span>Offset</span><input id="g-setup-pOffset" /></li></ul><ul id="g-setup-misc"><li><span>Enable vertical (gutters)</span><input id="g-setup-gEnabled" type="checkbox" /></li><li><span>Enable horizontal (paragraphs)</span><input id="g-setup-pEnabled" type="checkbox" /></li><li><span>Invert vertical</span><input id="g-setup-invert" type="checkbox" /></li><li><span>Center grid</span><input id="g-setup-center" type="checkbox" /></li></ul><div style="clear: left;"></div><div id="g-setup-tab"><a href="javascript:;"><img src="http://gridder.andreehansson.se/releases/1.3.1/logo-sprite.png" alt="" /></a></div></div>').appendTo("body");
|
||||
for (var d = 2; d < 48; d++) {
|
||||
if (Math.round((c.settings.size / d)) === (c.settings.size / d)) {
|
||||
jQuery('<option value="' + d + '">' + d + "</option>").appendTo("#g-setup-gColumns");
|
||||
}
|
||||
}
|
||||
for (var d in c.settings) {
|
||||
if (jQuery("#g-setup-" + d).length !== 0) {
|
||||
if (jQuery("#g-setup-" + d).parent().parent().is("#g-setup-misc") && c.settings[d]) {
|
||||
jQuery("#g-setup-" + d).attr("checked", "checked");
|
||||
} else {
|
||||
jQuery("#g-setup-" + d).val(c.settings[d]);
|
||||
}
|
||||
}
|
||||
}
|
||||
jQuery("#g-setup").css("top", jQuery(window).scrollTop() + 150);
|
||||
jQuery("#g-setup-tab a").click(function () {
|
||||
c.toggleSetupWindow();
|
||||
});
|
||||
jQuery("#g-setup input").keyup(function () {
|
||||
var e = this;
|
||||
clearTimeout(c.settings.delayTimer);
|
||||
c.settings.delayTimer = setTimeout(function () {
|
||||
c.setVariable(jQuery(e).attr("id"), jQuery(e).val());
|
||||
}, 700);
|
||||
});
|
||||
jQuery("#g-setup-gColumns").change(function () {
|
||||
c.setVariable("gColumns", $(this).val());
|
||||
});
|
||||
jQuery("#g-setup-misc input").click(function () {
|
||||
c.setVariable(jQuery(this).attr("id"), jQuery(this).attr("checked"));
|
||||
});
|
||||
jQuery().keydown(function (f) {
|
||||
if (jQuery.inArray(f.which, c.settings.pressedKeys) === -1) {
|
||||
c.settings.pressedKeys.push(f.which);
|
||||
}
|
||||
});
|
||||
jQuery(window).scroll(function () {
|
||||
jQuery("#g-setup").css("top", jQuery().scrollTop() + 150);
|
||||
});
|
||||
}
|
||||
jQuery().keyup(function (g) {
|
||||
if (jQuery.inArray(17, c.settings.pressedKeys) !== -1 && jQuery.inArray(18, c.settings.pressedKeys) !== -1) {
|
||||
if (jQuery.inArray(90, c.settings.pressedKeys) !== -1) {
|
||||
c.setVariable("gEnabled", !c.settings.gEnabled);
|
||||
} else {
|
||||
if (jQuery.inArray(88, c.settings.pressedKeys) !== -1) {
|
||||
c.setVariable("pEnabled", !c.settings.pEnabled);
|
||||
} else {
|
||||
if (jQuery.inArray(65, c.settings.pressedKeys) !== -1) {
|
||||
c.setVariable("invert", !c.settings.invert);
|
||||
} else {
|
||||
if (jQuery.inArray(67, c.settings.pressedKeys) !== -1) {
|
||||
c.setVariable({
|
||||
gEnabled: !c.settings.gEnabled,
|
||||
pEnabled: !c.settings.pEnabled
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var f = jQuery.inArray(g.which, c.settings.pressedKeys);
|
||||
c.settings.pressedKeys.splice(f, f);
|
||||
});
|
||||
};
|
||||
c.setVariable = function () {
|
||||
if (typeof (arguments[0]) === "object") {
|
||||
for (var d in arguments[0]) {
|
||||
c._setVariable(d, arguments[0][d]);
|
||||
}
|
||||
} else {
|
||||
c._setVariable(arguments[0], arguments[1]);
|
||||
}
|
||||
c.createGrid();
|
||||
};
|
||||
c.toggleSetupWindow = function () {
|
||||
var d = jQuery("#g-setup-tab img");
|
||||
d.css("left", d.position().left === 0 ? -26 : 0);
|
||||
if (parseInt(jQuery("#g-setup").css("left"), 10) === 0) {
|
||||
jQuery("#g-setup").animate({
|
||||
left: -310
|
||||
}, 200);
|
||||
} else {
|
||||
jQuery("#g-setup").animate({
|
||||
left: 0
|
||||
}, 200);
|
||||
}
|
||||
};
|
||||
c.createGrid = function () {
|
||||
jQuery("embed").each(function () {
|
||||
if (c.settings.fixFlash) {
|
||||
jQuery(this).attr("wmode", "transparent");
|
||||
} else {
|
||||
jQuery(this).removeAttr("wmode");
|
||||
}
|
||||
var i = jQuery(this).wrap("<div></div>").parent().html();
|
||||
jQuery(this).parent().replaceWith(i);
|
||||
jQuery(this).remove();
|
||||
});
|
||||
jQuery("#g-grid").remove();
|
||||
jQuery('<div id="g-grid"></div>').appendTo("body").css("width", c.settings.size);
|
||||
if (c.settings.center) {
|
||||
jQuery("#g-grid").css({
|
||||
left: "50%",
|
||||
marginLeft: -((c.settings.size / 2) + c.settings.gWidth)
|
||||
});
|
||||
}
|
||||
if (c.settings.gEnabled && c.settings.gColumns > 0) {
|
||||
if (c.settings.invert) {
|
||||
jQuery().css("overflow-x", "hidden");
|
||||
var e = (jQuery(window).width() - c.settings.size) / 2;
|
||||
c._createEntity("vertical", {
|
||||
left: -e,
|
||||
width: e,
|
||||
height: c.settings.height,
|
||||
backgroundColor: c.settings.gColor,
|
||||
opacity: c.settings.gOpacity
|
||||
});
|
||||
for (var g = 0; g < c.settings.gColumns; g++) {
|
||||
var f = (c.settings.size / c.settings.gColumns) - (c.settings.gWidth * 2);
|
||||
var h = (c.settings.gWidth * 2);
|
||||
c._createEntity("vertical", {
|
||||
left: ((f + h) * g) + h,
|
||||
width: f + "px",
|
||||
height: c.settings.height,
|
||||
backgroundColor: c.settings.gColor,
|
||||
opacity: c.settings.gOpacity
|
||||
});
|
||||
}
|
||||
if ((c.settings.height + 10) > jQuery(window).height()) {
|
||||
e -= 10;
|
||||
}
|
||||
c._createEntity("vertical", {
|
||||
left: "100%",
|
||||
marginLeft: 20,
|
||||
width: e,
|
||||
height: c.settings.height,
|
||||
backgroundColor: c.settings.gColor,
|
||||
opacity: c.settings.gOpacity
|
||||
});
|
||||
} else {
|
||||
for (var g = 0; g <= c.settings.gColumns; g++) {
|
||||
c._createEntity("vertical", {
|
||||
left: ((c.settings.size / c.settings.gColumns) * g),
|
||||
width: (c.settings.gWidth * 2),
|
||||
height: c.settings.height,
|
||||
backgroundColor: c.settings.gColor,
|
||||
opacity: c.settings.gOpacity
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (c.settings.pEnabled && c.settings.pHeight > 1) {
|
||||
var d = ((c.settings.height - c.settings.pOffset) / c.settings.pHeight);
|
||||
for (g = 0; g <= d; g++) {
|
||||
c._createEntity("horizontal", {
|
||||
top: ((c.settings.height / d) * g) + c.settings.pOffset,
|
||||
left: "50%",
|
||||
marginLeft: -(c.settings.size / 2),
|
||||
width: (c.settings.size + (c.settings.gWidth * 2)),
|
||||
backgroundColor: c.settings.pColor,
|
||||
opacity: c.settings.pOpacity
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
var checkJQuery = function () {
|
||||
if (typeof (window.jQuery) === "undefined") {
|
||||
setTimeout(function () {
|
||||
checkJQuery();
|
||||
}, 10);
|
||||
} else {
|
||||
window.grid.setupWindow();
|
||||
window.grid.createGrid();
|
||||
}
|
||||
};
|
||||
if (typeof (window.grid) === "undefined") {
|
||||
window.grid = new Grid();
|
||||
checkJQuery();
|
||||
} else {
|
||||
window.grid.toggleSetupWindow();
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
||||
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
|
||||
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
|
||||
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
|
||||
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
|
||||
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
|
||||
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
|
||||
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
|
||||
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
||||
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
|
||||
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
|
||||
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
|
||||
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
|
||||
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
|
||||
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
|
||||
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
|
||||
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
||||
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
|
||||
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
||||
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
|
||||
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
|
||||
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
|
||||
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
|
||||
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
||||
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
|
||||
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
|
||||
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
|
||||
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
|
@ -0,0 +1,515 @@
|
|||
/**
|
||||
* jQuery history event v0.1
|
||||
* Copyright (c) 2008 Tom Rodenberg <tarodenberg gmail com>
|
||||
* Licensed under the GPL (http://www.gnu.org/licenses/gpl.html) license.
|
||||
*/
|
||||
(function($) {
|
||||
var currentHash, previousNav, timer, hashTrim = /^.*#/;
|
||||
|
||||
var msie = {
|
||||
iframe: null,
|
||||
getDoc: function() {
|
||||
return msie.iframe.contentWindow.document;
|
||||
},
|
||||
getHash: function() {
|
||||
return msie.getDoc().location.hash;
|
||||
},
|
||||
setHash: function(hash) {
|
||||
var d = msie.getDoc();
|
||||
d.open();
|
||||
d.close();
|
||||
d.location.hash = hash;
|
||||
}
|
||||
};
|
||||
|
||||
var historycheck = function() {
|
||||
var hash = msie.iframe ? msie.getHash() : location.hash;
|
||||
if (hash != currentHash) {
|
||||
currentHash = hash;
|
||||
if (msie.iframe) {
|
||||
location.hash = currentHash;
|
||||
}
|
||||
var current = $.history.getCurrent();
|
||||
$.event.trigger('history', [current, previousNav]);
|
||||
previousNav = current;
|
||||
}
|
||||
};
|
||||
|
||||
$.history = {
|
||||
add: function(hash) {
|
||||
hash = '#' + hash.replace(hashTrim, '');
|
||||
if (currentHash != hash) {
|
||||
var previous = $.history.getCurrent();
|
||||
location.hash = currentHash = hash;
|
||||
if (msie.iframe) {
|
||||
msie.setHash(currentHash);
|
||||
}
|
||||
$.event.trigger('historyadd', [$.history.getCurrent(), previous]);
|
||||
}
|
||||
if (!timer) {
|
||||
timer = setInterval(historycheck, 100);
|
||||
}
|
||||
},
|
||||
getCurrent: function() {
|
||||
if (currentHash) {
|
||||
return currentHash.replace(hashTrim, '');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.history = function(fn) {
|
||||
$(this).bind('history', fn);
|
||||
};
|
||||
|
||||
$.fn.historyadd = function(fn) {
|
||||
$(this).bind('historyadd', fn);
|
||||
};
|
||||
|
||||
$(function() {
|
||||
currentHash = location.hash;
|
||||
if ($.browser.msie) {
|
||||
msie.iframe = $('<iframe style="display:none"src="javascript:false;"></iframe>')
|
||||
.prependTo('body')[0];
|
||||
msie.setHash(currentHash);
|
||||
currentHash = msie.getHash();
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var gSelectedIndex = -1;
|
||||
var gSelectedID = -1;
|
||||
var gMatches = new Array();
|
||||
var gLastText = "";
|
||||
var ROW_COUNT = 20;
|
||||
var gInitialized = false;
|
||||
|
||||
function set_item_selected($li, selected)
|
||||
{
|
||||
if (selected) {
|
||||
$li.attr('class','jd-autocomplete jd-selected');
|
||||
} else {
|
||||
$li.attr('class','jd-autocomplete');
|
||||
}
|
||||
}
|
||||
|
||||
function set_item_values(toroot, $li, match)
|
||||
{
|
||||
var $link = $('a',$li);
|
||||
$link.html(match.__hilabel || match.label);
|
||||
$link.attr('href',toroot + match.link);
|
||||
}
|
||||
|
||||
function sync_selection_table(toroot)
|
||||
{
|
||||
var $list = $("#search_filtered");
|
||||
var $li; //list item jquery object
|
||||
var i; //list item iterator
|
||||
gSelectedID = -1;
|
||||
|
||||
//initialize the table; draw it for the first time (but not visible).
|
||||
if (!gInitialized) {
|
||||
for (i=0; i<ROW_COUNT; i++) {
|
||||
var $li = $("<li class='jd-autocomplete'></li>");
|
||||
$list.append($li);
|
||||
|
||||
$li.mousedown(function() {
|
||||
window.location = this.firstChild.getAttribute("href");
|
||||
});
|
||||
$li.mouseover(function() {
|
||||
$('#search_filtered li').removeClass('jd-selected');
|
||||
$(this).addClass('jd-selected');
|
||||
gSelectedIndex = $('#search_filtered li').index(this);
|
||||
});
|
||||
$li.append('<a></a>');
|
||||
}
|
||||
gInitialized = true;
|
||||
}
|
||||
|
||||
//if we have results, make the table visible and initialize result info
|
||||
if (gMatches.length > 0) {
|
||||
$('#search_filtered_div').removeClass('no-display');
|
||||
var N = gMatches.length < ROW_COUNT ? gMatches.length : ROW_COUNT;
|
||||
for (i=0; i<N; i++) {
|
||||
$li = $('#search_filtered li:nth-child('+(i+1)+')');
|
||||
$li.attr('class','show-item');
|
||||
set_item_values(toroot, $li, gMatches[i]);
|
||||
set_item_selected($li, i == gSelectedIndex);
|
||||
if (i == gSelectedIndex) {
|
||||
gSelectedID = gMatches[i].id;
|
||||
}
|
||||
}
|
||||
//start hiding rows that are no longer matches
|
||||
for (; i<ROW_COUNT; i++) {
|
||||
$li = $('#search_filtered li:nth-child('+(i+1)+')');
|
||||
$li.attr('class','no-display');
|
||||
}
|
||||
//if there are more results we're not showing, so say so.
|
||||
/* if (gMatches.length > ROW_COUNT) {
|
||||
li = list.rows[ROW_COUNT];
|
||||
li.className = "show-item";
|
||||
c1 = li.cells[0];
|
||||
c1.innerHTML = "plus " + (gMatches.length-ROW_COUNT) + " more";
|
||||
} else {
|
||||
list.rows[ROW_COUNT].className = "hide-item";
|
||||
}*/
|
||||
//if we have no results, hide the table
|
||||
} else {
|
||||
$('#search_filtered_div').addClass('no-display');
|
||||
}
|
||||
}
|
||||
|
||||
function search_changed(e, kd, toroot)
|
||||
{
|
||||
var search = document.getElementById("search_autocomplete");
|
||||
var text = search.value.replace(/(^ +)|( +$)/g, '');
|
||||
|
||||
// show/hide the close button
|
||||
if (text != '') {
|
||||
$(".search .close").removeClass("hide");
|
||||
} else {
|
||||
$(".search .close").addClass("hide");
|
||||
}
|
||||
|
||||
// 13 = enter
|
||||
if (e.keyCode == 13) {
|
||||
$('#search_filtered_div').addClass('no-display');
|
||||
if (!$('#search_filtered_div').hasClass('no-display') || (gSelectedIndex < 0)) {
|
||||
return true;
|
||||
} else if (kd && gSelectedIndex >= 0) {
|
||||
window.location = toroot + gMatches[gSelectedIndex].link;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 38 -- arrow up
|
||||
else if (kd && (e.keyCode == 38)) {
|
||||
if (gSelectedIndex >= 0) {
|
||||
$('#search_filtered li').removeClass('jd-selected');
|
||||
gSelectedIndex--;
|
||||
$('#search_filtered li:nth-child('+(gSelectedIndex+1)+')').addClass('jd-selected');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// 40 -- arrow down
|
||||
else if (kd && (e.keyCode == 40)) {
|
||||
if (gSelectedIndex < gMatches.length-1
|
||||
&& gSelectedIndex < ROW_COUNT-1) {
|
||||
$('#search_filtered li').removeClass('jd-selected');
|
||||
gSelectedIndex++;
|
||||
$('#search_filtered li:nth-child('+(gSelectedIndex+1)+')').addClass('jd-selected');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (!kd && (e.keyCode != 40) && (e.keyCode != 38)) {
|
||||
gMatches = new Array();
|
||||
matchedCount = 0;
|
||||
gSelectedIndex = -1;
|
||||
for (var i=0; i<DATA.length; i++) {
|
||||
var s = DATA[i];
|
||||
if (text.length != 0 &&
|
||||
s.label.toLowerCase().indexOf(text.toLowerCase()) != -1) {
|
||||
gMatches[matchedCount] = s;
|
||||
matchedCount++;
|
||||
}
|
||||
}
|
||||
rank_autocomplete_results(text);
|
||||
for (var i=0; i<gMatches.length; i++) {
|
||||
var s = gMatches[i];
|
||||
if (gSelectedID == s.id) {
|
||||
gSelectedIndex = i;
|
||||
}
|
||||
}
|
||||
highlight_autocomplete_result_labels(text);
|
||||
sync_selection_table(toroot);
|
||||
return true; // allow the event to bubble up to the search api
|
||||
}
|
||||
}
|
||||
|
||||
function rank_autocomplete_results(query) {
|
||||
query = query || '';
|
||||
if (!gMatches || !gMatches.length)
|
||||
return;
|
||||
|
||||
// helper function that gets the last occurence index of the given regex
|
||||
// in the given string, or -1 if not found
|
||||
var _lastSearch = function(s, re) {
|
||||
if (s == '')
|
||||
return -1;
|
||||
var l = -1;
|
||||
var tmp;
|
||||
while ((tmp = s.search(re)) >= 0) {
|
||||
if (l < 0) l = 0;
|
||||
l += tmp;
|
||||
s = s.substr(tmp + 1);
|
||||
}
|
||||
return l;
|
||||
};
|
||||
|
||||
// helper function that counts the occurrences of a given character in
|
||||
// a given string
|
||||
var _countChar = function(s, c) {
|
||||
var n = 0;
|
||||
for (var i=0; i<s.length; i++)
|
||||
if (s.charAt(i) == c) ++n;
|
||||
return n;
|
||||
};
|
||||
|
||||
var queryLower = query.toLowerCase();
|
||||
var queryAlnum = (queryLower.match(/\w+/) || [''])[0];
|
||||
var partPrefixAlnumRE = new RegExp('\\b' + queryAlnum);
|
||||
var partExactAlnumRE = new RegExp('\\b' + queryAlnum + '\\b');
|
||||
|
||||
var _resultScoreFn = function(result) {
|
||||
// scores are calculated based on exact and prefix matches,
|
||||
// and then number of path separators (dots) from the last
|
||||
// match (i.e. favoring classes and deep package names)
|
||||
var score = 1.0;
|
||||
var labelLower = result.label.toLowerCase();
|
||||
var t;
|
||||
t = _lastSearch(labelLower, partExactAlnumRE);
|
||||
if (t >= 0) {
|
||||
// exact part match
|
||||
var partsAfter = _countChar(labelLower.substr(t + 1), '.');
|
||||
score *= 200 / (partsAfter + 1);
|
||||
} else {
|
||||
t = _lastSearch(labelLower, partPrefixAlnumRE);
|
||||
if (t >= 0) {
|
||||
// part prefix match
|
||||
var partsAfter = _countChar(labelLower.substr(t + 1), '.');
|
||||
score *= 20 / (partsAfter + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return score;
|
||||
};
|
||||
|
||||
for (var i=0; i<gMatches.length; i++) {
|
||||
gMatches[i].__resultScore = _resultScoreFn(gMatches[i]);
|
||||
}
|
||||
|
||||
gMatches.sort(function(a,b){
|
||||
var n = b.__resultScore - a.__resultScore;
|
||||
if (n == 0) // lexicographical sort if scores are the same
|
||||
n = (a.label < b.label) ? -1 : 1;
|
||||
return n;
|
||||
});
|
||||
}
|
||||
|
||||
function highlight_autocomplete_result_labels(query) {
|
||||
query = query || '';
|
||||
if (!gMatches || !gMatches.length)
|
||||
return;
|
||||
|
||||
var queryLower = query.toLowerCase();
|
||||
var queryAlnumDot = (queryLower.match(/[\w\.]+/) || [''])[0];
|
||||
var queryRE = new RegExp(
|
||||
'(' + queryAlnumDot.replace(/\./g, '\\.') + ')', 'ig');
|
||||
for (var i=0; i<gMatches.length; i++) {
|
||||
gMatches[i].__hilabel = gMatches[i].label.replace(
|
||||
queryRE, '<b>$1</b>');
|
||||
}
|
||||
}
|
||||
|
||||
function search_focus_changed(obj, focused)
|
||||
{
|
||||
if (!focused) {
|
||||
if(obj.value == ""){
|
||||
$(".search .close").addClass("hide");
|
||||
}
|
||||
document.getElementById("search_filtered_div").className = "no-display";
|
||||
}
|
||||
}
|
||||
|
||||
function submit_search() {
|
||||
var query = document.getElementById('search_autocomplete').value;
|
||||
location.hash = 'q=' + query;
|
||||
$.history.add('q=' + query);
|
||||
loadSearchResults();
|
||||
$("#searchResults").slideDown();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function hideResults() {
|
||||
$("#searchResults").slideUp();
|
||||
$(".search .close").addClass("hide");
|
||||
location.hash = '';
|
||||
drawOptions.setInput(document.getElementById("searchResults"));
|
||||
|
||||
$("#search_autocomplete").blur();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/************ SEARCH ENGINE ***************/
|
||||
|
||||
|
||||
google.load('search', '1');
|
||||
|
||||
function loadSearchResults() {
|
||||
if (location.hash.indexOf("q=") == -1) {
|
||||
// if there's no query in the url, don't search and make sure results are hidden
|
||||
$('#searchResults').hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var $results = $("#searchResults");
|
||||
if ($results.is(":hidden")) {
|
||||
$results.slideDown();
|
||||
}
|
||||
|
||||
document.getElementById("search_autocomplete").style.color = "#000";
|
||||
|
||||
// create search control
|
||||
searchControl = new google.search.SearchControl();
|
||||
|
||||
// use our existing search form and use tabs when multiple searchers are used
|
||||
drawOptions = new google.search.DrawOptions();
|
||||
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
|
||||
drawOptions.setInput(document.getElementById("search_autocomplete"));
|
||||
|
||||
// configure search result options
|
||||
searchOptions = new google.search.SearcherOptions();
|
||||
searchOptions.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
|
||||
|
||||
// configure each of the searchers, for each tab
|
||||
devSiteSearcher = new google.search.WebSearch();
|
||||
devSiteSearcher.setUserDefinedLabel("All");
|
||||
devSiteSearcher.setSiteRestriction("001482626316274216503:zu90b7s047u");
|
||||
|
||||
designSearcher = new google.search.WebSearch();
|
||||
designSearcher.setUserDefinedLabel("Design");
|
||||
designSearcher.setSiteRestriction("http://developer.android.com/design/");
|
||||
|
||||
trainingSearcher = new google.search.WebSearch();
|
||||
trainingSearcher.setUserDefinedLabel("Training");
|
||||
trainingSearcher.setSiteRestriction("http://developer.android.com/training/");
|
||||
|
||||
guidesSearcher = new google.search.WebSearch();
|
||||
guidesSearcher.setUserDefinedLabel("Guides");
|
||||
guidesSearcher.setSiteRestriction("http://developer.android.com/guide/");
|
||||
|
||||
referenceSearcher = new google.search.WebSearch();
|
||||
referenceSearcher.setUserDefinedLabel("Reference");
|
||||
referenceSearcher.setSiteRestriction("http://developer.android.com/reference/");
|
||||
|
||||
blogSearcher = new google.search.WebSearch();
|
||||
blogSearcher.setUserDefinedLabel("Blog");
|
||||
blogSearcher.setSiteRestriction("http://android-developers.blogspot.com");
|
||||
|
||||
// add each searcher to the search control
|
||||
searchControl.addSearcher(devSiteSearcher, searchOptions);
|
||||
searchControl.addSearcher(designSearcher, searchOptions);
|
||||
searchControl.addSearcher(trainingSearcher, searchOptions);
|
||||
searchControl.addSearcher(guidesSearcher, searchOptions);
|
||||
searchControl.addSearcher(referenceSearcher, searchOptions);
|
||||
searchControl.addSearcher(blogSearcher, searchOptions);
|
||||
|
||||
// configure result options
|
||||
searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
|
||||
searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);
|
||||
searchControl.setTimeoutInterval(google.search.SearchControl.TIMEOUT_LONG);
|
||||
searchControl.setNoResultsString(google.search.SearchControl.NO_RESULTS_DEFAULT_STRING);
|
||||
|
||||
// upon ajax search, refresh the url and search title
|
||||
searchControl.setSearchStartingCallback(this, function(control, searcher, query) {
|
||||
updateResultTitle(query);
|
||||
var query = document.getElementById('search_autocomplete').value;
|
||||
location.hash = 'q=' + query;
|
||||
$.history.add('q=' + query);
|
||||
});
|
||||
|
||||
// draw the search results box
|
||||
searchControl.draw(document.getElementById("leftSearchControl"), drawOptions);
|
||||
|
||||
// get query and execute the search
|
||||
searchControl.execute(decodeURI(getQuery(location.hash)));
|
||||
|
||||
document.getElementById("search_autocomplete").focus();
|
||||
addTabListeners();
|
||||
}
|
||||
// End of loadSearchResults
|
||||
|
||||
|
||||
google.setOnLoadCallback(loadSearchResults, true);
|
||||
|
||||
// when an event on the browser history occurs (back, forward, load) perform a search
|
||||
$(window).history(function(e, hash) {
|
||||
var query = decodeURI(getQuery(hash));
|
||||
if (query == "undefined") {
|
||||
hideResults();
|
||||
return;
|
||||
}
|
||||
searchControl.execute(query);
|
||||
|
||||
updateResultTitle(query);
|
||||
});
|
||||
|
||||
function updateResultTitle(query) {
|
||||
$("#searchTitle").html("Results for <em>" + escapeHTML(query) + "</em>");
|
||||
}
|
||||
|
||||
// forcefully regain key-up event control (previously jacked by search api)
|
||||
$("#search_autocomplete").keyup(function(event) {
|
||||
return search_changed(event, false, '/');
|
||||
});
|
||||
|
||||
// add event listeners to each tab so we can track the browser history
|
||||
function addTabListeners() {
|
||||
var tabHeaders = $(".gsc-tabHeader");
|
||||
for (var i = 0; i < tabHeaders.length; i++) {
|
||||
$(tabHeaders[i]).attr("id",i).click(function() {
|
||||
/*
|
||||
// make a copy of the page numbers for the search left pane
|
||||
setTimeout(function() {
|
||||
// remove any residual page numbers
|
||||
$('#searchResults .gsc-tabsArea .gsc-cursor-box.gs-bidi-start-align').remove();
|
||||
// move the page numbers to the left position; make a clone,
|
||||
// because the element is drawn to the DOM only once
|
||||
// and because we're going to remove it (previous line),
|
||||
// we need it to be available to move again as the user navigates
|
||||
$('#searchResults .gsc-webResult .gsc-cursor-box.gs-bidi-start-align:visible')
|
||||
.clone().appendTo('#searchResults .gsc-tabsArea');
|
||||
}, 200);
|
||||
*/
|
||||
});
|
||||
}
|
||||
setTimeout(function(){$(tabHeaders[0]).click()},200);
|
||||
}
|
||||
|
||||
|
||||
function getQuery(hash) {
|
||||
var queryParts = hash.split('=');
|
||||
return queryParts[1];
|
||||
}
|
||||
|
||||
/* returns the given string with all HTML brackets converted to entities
|
||||
TODO: move this to the site's JS library */
|
||||
function escapeHTML(string) {
|
||||
return string.replace(/</g,"<")
|
||||
.replace(/>/g,">");
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* jQuery dacSlideshow 1.0
|
||||
*
|
||||
* Sample usage:
|
||||
* HTML -
|
||||
* <div class="slideshow-container">
|
||||
* <a href="" class="slideshow-prev">Prev</a>
|
||||
* <a href="" class="slideshow-next">Next</a>
|
||||
* <ul>
|
||||
* <li class="item"><img src="images/marquee1.jpg"></li>
|
||||
* <li class="item"><img src="images/marquee2.jpg"></li>
|
||||
* <li class="item"><img src="images/marquee3.jpg"></li>
|
||||
* <li class="item"><img src="images/marquee4.jpg"></li>
|
||||
* </ul>
|
||||
* </div>
|
||||
*
|
||||
* <script type="text/javascript">
|
||||
* $('.slideshow-container').dacSlideshow({
|
||||
* auto: true,
|
||||
* btnPrev: '.slideshow-prev',
|
||||
* btnNext: '.slideshow-next'
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* Options:
|
||||
* btnPrev: optional identifier for previous button
|
||||
* btnNext: optional identifier for next button
|
||||
* auto: whether or not to auto-proceed
|
||||
* speed: animation speed
|
||||
* autoTime: time between auto-rotation
|
||||
* easing: easing function for transition
|
||||
* start: item to select by default
|
||||
* scroll: direction to scroll in
|
||||
* pagination: whether or not to include dotted pagination
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.fn.dacTabbedList = function(o) {
|
||||
|
||||
//Options - see above
|
||||
o = $.extend({
|
||||
speed : 250,
|
||||
easing: null,
|
||||
nav_id: null,
|
||||
frame_id: null
|
||||
}, o || {});
|
||||
|
||||
//Set up a carousel for each
|
||||
return this.each(function() {
|
||||
|
||||
var curr = 0;
|
||||
var running = false;
|
||||
var animCss = "margin-left";
|
||||
var sizeCss = "width";
|
||||
var div = $(this);
|
||||
|
||||
var nav = $(o.nav_id, div);
|
||||
var nav_li = $("li", nav);
|
||||
var nav_size = nav_li.size();
|
||||
var frame = div.find(o.frame_id);
|
||||
var content_width = $(frame).find('ul').width();
|
||||
//Buttons
|
||||
$(nav_li).click(function(e) {
|
||||
go($(nav_li).index($(this)));
|
||||
})
|
||||
|
||||
//Go to an item
|
||||
function go(to) {
|
||||
if(!running) {
|
||||
curr = to;
|
||||
running = true;
|
||||
|
||||
frame.animate({ 'margin-left' : -(curr*content_width) }, o.speed, o.easing,
|
||||
function() {
|
||||
running = false;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
nav_li.removeClass('active');
|
||||
nav_li.eq(to).addClass('active');
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
function css(el, prop) {
|
||||
return parseInt($.css(el[0], prop)) || 0;
|
||||
};
|
||||
function width(el) {
|
||||
return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
|
||||
};
|
||||
function height(el) {
|
||||
return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
|
||||
};
|
||||
|
||||
})(jQuery);
|
|
@ -1,35 +0,0 @@
|
|||
// Simple JavaScript Templating
|
||||
// John Resig - http://ejohn.org/ - MIT Licensed
|
||||
(function(){
|
||||
var cache = {};
|
||||
|
||||
this.tmpl = function tmpl(str, data){
|
||||
// Figure out if we're getting a template, or if we need to
|
||||
// load the template - and be sure to cache the result.
|
||||
var fn = !/\W/.test(str) ?
|
||||
cache[str] = cache[str] ||
|
||||
tmpl(document.getElementById(str).innerHTML) :
|
||||
|
||||
// Generate a reusable function that will serve as a template
|
||||
// generator (and which will be cached).
|
||||
new Function("obj",
|
||||
"var p=[],print=function(){p.push.apply(p,arguments);};" +
|
||||
|
||||
// Introduce the data as local variables using with(){}
|
||||
"with(obj){p.push('" +
|
||||
|
||||
// Convert the template into pure JavaScript
|
||||
str
|
||||
.replace(/[\r\t\n]/g, " ")
|
||||
.split("<%").join("\t")
|
||||
.replace(/((^|%>)[^\t]*)'/g, "$1\r")
|
||||
.replace(/\t=(.*?)%>/g, "',$1,'")
|
||||
.split("\t").join("');")
|
||||
.split("%>").join("p.push('")
|
||||
.split("\r").join("\\'")
|
||||
+ "');}return p.join('');");
|
||||
|
||||
// Provide some basic currying to the user
|
||||
return data ? fn( data ) : fn;
|
||||
};
|
||||
})();
|
|
@ -1,33 +0,0 @@
|
|||
(function(){
|
||||
var o=true,r=null,z=false;window.PR_SHOULD_USE_CONTINUATION=o;window.PR_TAB_WIDTH=8;window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void 0;window._pr_isIE6=function(){var N=navigator&&navigator.userAgent&&/\bMSIE 6\./.test(navigator.userAgent);window._pr_isIE6=function(){return N};return N};
|
||||
var aa="!",ba="!=",ca="!==",F="#",da="%",ea="%=",G="&",fa="&&",ja="&&=",ka="&=",H="(",la="*",ma="*=",na="+=",oa=",",pa="-=",qa="->",ra="/",sa="/=",ta=":",ua="::",va=";",I="<",wa="<<",xa="<<=",ya="<=",za="=",Aa="==",Ba="===",J=">",Ca=">=",Da=">>",Ea=">>=",Fa=">>>",Ga=">>>=",Ha="?",Ia="@",L="[",M="^",Ta="^=",Ua="^^",Va="^^=",Wa="{",O="|",Xa="|=",Ya="||",Za="||=",$a="~",ab="break",bb="case",cb="continue",db="delete",eb="do",fb="else",gb="finally",hb="instanceof",ib="return",jb="throw",kb="try",lb="typeof",
|
||||
mb="(?:^^|[+-]",nb="\\$1",ob=")\\s*",pb="&",qb="<",rb=">",sb=""",tb="&#",ub="x",vb="'",wb='"',xb=" ",yb="XMP",zb="</",Ab='="',P="",Q="\\",Bb="b",Cb="t",Db="n",Eb="v",Fb="f",Gb="r",Hb="u",Ib="0",Jb="1",Kb="2",Lb="3",Mb="4",Nb="5",Ob="6",Pb="7",Qb="\\x0",Rb="\\x",Sb="-",Tb="]",Ub="\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]",R="g",Vb="\\B",Wb="\\b",Xb="\\D",Yb="\\d",Zb="\\S",$b="\\s",ac="\\W",bc="\\w",cc="(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)",
|
||||
dc="(?:",ec=")",fc="gi",gc="PRE",hc='<!DOCTYPE foo PUBLIC "foo bar">\n<foo />',ic="\t",jc="\n",kc="[^<]+|<!--[\\s\\S]*?--\>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z][^>]*>|<",lc="nocode",mc=' $1="$2$3$4"',S="pln",nc="string",T="lang-",oc="src",U="str",pc="'\"",qc="'\"`",rc="\"'",V="com",sc="lang-regex",tc="(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)",uc="kwd",vc="^(?:",wc=")\\b",xc=" \r\n\t\u00a0",yc="lit",zc="typ",Ac="0123456789",Y="pun",Bc="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try debugger eval export function get null set undefined var with Infinity NaN caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
||||
Cc="</span>",Dc='<span class="',Ec='">',Fc="$1 ",Gc=" <br />",Hc="<br />",Ic="console",Jc="cannot override language handler %s",Kc="default-markup",Lc="default-code",Mc="dec",Z="lang-js",$="lang-css",Nc="lang-in.tag",Oc="htm",Pc="html",Qc="mxml",Rc="xhtml",Sc="xml",Tc="xsl",Uc=" \t\r\n",Vc="atv",Wc="tag",Xc="atn",Yc="lang-uq.val",Zc="in.tag",$c="uq.val",ad="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where ",
|
||||
bd="c",cd="cc",dd="cpp",ed="cxx",fd="cyc",gd="m",hd="null true false",id="json",jd="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",
|
||||
kd="cs",ld="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",md="java",nd="break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
||||
od="bsh",pd="csh",qd="sh",rd="break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",sd="cv",td="py",ud="caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",vd="perl",wd="pl",xd="pm",yd="break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",
|
||||
zd="rb",Ad="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try debugger eval export function get null set undefined var with Infinity NaN ",Bd="js",Cd="regex",Dd="pre",Ed="code",Fd="xmp",Gd="prettyprint",Hd="class",Id="br",Jd="\r";
|
||||
(function(){var N=function(){for(var a=[aa,ba,ca,F,da,ea,G,fa,ja,ka,H,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,I,wa,xa,ya,za,Aa,Ba,J,Ca,Da,Ea,Fa,Ga,Ha,Ia,L,M,Ta,Ua,Va,Wa,O,Xa,Ya,Za,$a,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb],b=mb,c=0;c<a.length;++c)b+=O+a[c].replace(/([^=<>:&a-z])/g,nb);b+=ob;return b}(),Ja=/&/g,Ka=/</g,La=/>/g,Kd=/\"/g;function Ld(a){return a.replace(Ja,pb).replace(Ka,qb).replace(La,rb).replace(Kd,sb)}function ga(a){return a.replace(Ja,pb).replace(Ka,qb).replace(La,rb)}var Md=/</g,Nd=/>/g,
|
||||
Od=/'/g,Pd=/"/g,Qd=/&/g,Rd=/ /g;function Sd(a){var b=a.indexOf(G);if(b<0)return a;for(--b;(b=a.indexOf(tb,b+1))>=0;){var c=a.indexOf(va,b);if(c>=0){var d=a.substring(b+3,c),g=10;if(d&&d.charAt(0)===ub){d=d.substring(1);g=16}var i=parseInt(d,g);isNaN(i)||(a=a.substring(0,b)+String.fromCharCode(i)+a.substring(c+1))}}return a.replace(Md,I).replace(Nd,J).replace(Od,vb).replace(Pd,wb).replace(Qd,G).replace(Rd,xb)}function Ma(a){return yb===a.tagName}function W(a,b){switch(a.nodeType){case 1:var c=
|
||||
a.tagName.toLowerCase();b.push(I,c);for(var d=0;d<a.attributes.length;++d){var g=a.attributes[d];if(g.specified){b.push(xb);W(g,b)}}b.push(J);for(var i=a.firstChild;i;i=i.nextSibling)W(i,b);if(a.firstChild||!/^(?:br|link|img)$/.test(c))b.push(zb,c,J);break;case 2:b.push(a.name.toLowerCase(),Ab,Ld(a.value),wb);break;case 3:case 4:b.push(ga(a.nodeValue));break}}function Na(a){for(var b=0,c=z,d=z,g=0,i=a.length;g<i;++g){var m=a[g];if(m.ignoreCase)d=o;else if(/[a-z]/i.test(m.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,
|
||||
P))){c=o;d=z;break}}function l(j){if(j.charAt(0)!==Q)return j.charCodeAt(0);switch(j.charAt(1)){case Bb:return 8;case Cb:return 9;case Db:return 10;case Eb:return 11;case Fb:return 12;case Gb:return 13;case Hb:case ub:return parseInt(j.substring(2),16)||j.charCodeAt(1);case Ib:case Jb:case Kb:case Lb:case Mb:case Nb:case Ob:case Pb:return parseInt(j.substring(1),8);default:return j.charCodeAt(1)}}function n(j){if(j<32)return(j<16?Qb:Rb)+j.toString(16);var f=String.fromCharCode(j);if(f===Q||f===Sb||
|
||||
f===L||f===Tb)f=Q+f;return f}function q(j){for(var f=j.substring(1,j.length-1).match(new RegExp(Ub,R)),s=[],k=[],h=f[0]===M,e=h?1:0,p=f.length;e<p;++e){var t=f[e];switch(t){case Vb:case Wb:case Xb:case Yb:case Zb:case $b:case ac:case bc:s.push(t);continue}var u=l(t),x;if(e+2<p&&Sb===f[e+1]){x=l(f[e+2]);e+=2}else x=u;k.push([u,x]);if(!(x<65||u>122)){x<65||u>90||k.push([Math.max(65,u)|32,Math.min(x,90)|32]);x<97||u>122||k.push([Math.max(97,u)&-33,Math.min(x,122)&-33])}}k.sort(function(Oa,Pa){return Oa[0]-
|
||||
Pa[0]||Pa[1]-Oa[1]});var B=[],E=[NaN,NaN];for(e=0;e<k.length;++e){var A=k[e];if(A[0]<=E[1]+1)E[1]=Math.max(E[1],A[1]);else B.push(E=A)}var D=[L];h&&D.push(M);D.push.apply(D,s);for(e=0;e<B.length;++e){A=B[e];D.push(n(A[0]));if(A[1]>A[0]){A[1]+1>A[0]&&D.push(Sb);D.push(n(A[1]))}}D.push(Tb);return D.join(P)}function v(j){var f=j.source.match(new RegExp(cc,R)),s=f.length,k=[],h,e=0;for(h=0;e<s;++e){var p=f[e];if(p===H)++h;else if(Q===p.charAt(0)){var t=+p.substring(1);if(t&&t<=h)k[t]=-1}}for(e=1;e<k.length;++e)if(-1===
|
||||
k[e])k[e]=++b;for(h=e=0;e<s;++e){p=f[e];if(p===H){++h;if(k[h]===undefined)f[e]=dc}else if(Q===p.charAt(0))if((t=+p.substring(1))&&t<=h)f[e]=Q+k[h]}for(h=e=0;e<s;++e)if(M===f[e]&&M!==f[e+1])f[e]=P;if(j.ignoreCase&&c)for(e=0;e<s;++e){p=f[e];var u=p.charAt(0);if(p.length>=2&&u===L)f[e]=q(p);else if(u!==Q)f[e]=p.replace(/[a-zA-Z]/g,function(x){var B=x.charCodeAt(0);return L+String.fromCharCode(B&-33,B|32)+Tb})}return f.join(P)}var w=[];g=0;for(i=a.length;g<i;++g){m=a[g];if(m.global||m.multiline)throw new Error(P+
|
||||
m);w.push(dc+v(m)+ec)}return new RegExp(w.join(O),d?fc:R)}var ha=r;function Td(a){if(r===ha){var b=document.createElement(gc);b.appendChild(document.createTextNode(hc));ha=!/</.test(b.innerHTML)}if(ha){var c=a.innerHTML;if(Ma(a))c=ga(c);return c}for(var d=[],g=a.firstChild;g;g=g.nextSibling)W(g,d);return d.join(P)}function Ud(a){var b=0;return function(c){for(var d=r,g=0,i=0,m=c.length;i<m;++i){var l=c.charAt(i);switch(l){case ic:d||(d=[]);d.push(c.substring(g,i));var n=a-b%a;for(b+=n;n>=0;n-=" ".length)d.push(" ".substring(0,
|
||||
n));g=i+1;break;case jc:b=0;break;default:++b}}if(!d)return c;d.push(c.substring(g));return d.join(P)}}var Vd=new RegExp(kc,R),Wd=/^<\!--/,Xd=/^<\[CDATA\[/,Yd=/^<br\b/i,Qa=/^<(\/?)([a-zA-Z]+)/;function Zd(a){var b=a.match(Vd),c=[],d=0,g=[];if(b)for(var i=0,m=b.length;i<m;++i){var l=b[i];if(l.length>1&&l.charAt(0)===I){if(!Wd.test(l))if(Xd.test(l)){c.push(l.substring(9,l.length-3));d+=l.length-12}else if(Yd.test(l)){c.push(jc);++d}else if(l.indexOf(lc)>=0&&$d(l)){var n=l.match(Qa)[2],q=1,v;v=i+1;a:for(;v<
|
||||
m;++v){var w=b[v].match(Qa);if(w&&w[2]===n)if(w[1]===ra){if(--q===0)break a}else++q}if(v<m){g.push(d,b.slice(i,v+1).join(P));i=v}else g.push(d,l)}else g.push(d,l)}else{var j=Sd(l);c.push(j);d+=j.length}}return{source:c.join(P),tags:g}}function $d(a){return!!a.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,mc).match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)}function ia(a,b,c,d){if(b){var g={source:b,b:a};c(g);d.push.apply(d,g.c)}}function K(a,b){var c={},d;(function(){for(var m=a.concat(b),
|
||||
l=[],n={},q=0,v=m.length;q<v;++q){var w=m[q],j=w[3];if(j)for(var f=j.length;--f>=0;)c[j.charAt(f)]=w;var s=w[1],k=P+s;if(!n.hasOwnProperty(k)){l.push(s);n[k]=r}}l.push(/[\0-\uffff]/);d=Na(l)})();var g=b.length,i=function(m){for(var l=m.source,n=m.b,q=[n,S],v=0,w=l.match(d)||[],j={},f=0,s=w.length;f<s;++f){var k=w[f],h=j[k],e,p;if(typeof h===nc)p=z;else{var t=c[k.charAt(0)];if(t){e=k.match(t[1]);h=t[0]}else{for(var u=0;u<g;++u){t=b[u];if(e=k.match(t[1])){h=t[0];break}}e||(h=S)}if((p=h.length>=5&&T===
|
||||
h.substring(0,5))&&!(e&&e[1])){p=z;h=oc}p||(j[k]=h)}var x=v;v+=k.length;if(p){var B=e[1],E=k.indexOf(B),A=E+B.length,D=h.substring(5);ia(n+x,k.substring(0,E),i,q);ia(n+x+E,B,Ra(D,B),q);ia(n+x+A,k.substring(A),i,q)}else q.push(n+x,h)}m.c=q};return i}function C(a){var b=[],c=[];if(a.tripleQuotedStrings)b.push([U,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,r,pc]);
|
||||
else a.multiLineStrings?b.push([U,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,r,qc]):b.push([U,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,r,rc]);if(a.hashComments)a.cStyleComments?b.push([V,/^#(?:[^\r\n\/]|\/(?!\*)|\/\*[^\r\n]*?\*\/)*/,r,F]):b.push([V,/^#[^\r\n]*/,r,F]);if(a.cStyleComments){c.push([V,/^\/\/[^\r\n]*/,r]);c.push([V,/^\/\*[\s\S]*?(?:\*\/|$)/,r])}a.regexLiterals&&c.push([sc,new RegExp(M+N+tc)]);var d=
|
||||
a.keywords.replace(/^\s+|\s+$/g,P);d.length&&c.push([uc,new RegExp(vc+d.replace(/\s+/g,O)+wc),r]);b.push([S,/^\s+/,r,xc]);c.push([yc,/^@[a-z_$][a-z_$@0-9]*/i,r,Ia],[zc,/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/,r],[S,/^[a-z_$][a-z_$@0-9]*/i,r],[yc,/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,r,Ac],[Y,/^.[^\s\w\.$@\'\"\`\/\#]*/,r]);return K(b,c)}var ae=C({keywords:Bc,hashComments:o,cStyleComments:o,multiLineStrings:o,regexLiterals:o});function be(a){var b=a.source,c=a.f,d=a.c,
|
||||
g=[],i=0,m=r,l=r,n=0,q=0,v=Ud(window.PR_TAB_WIDTH),w=/([\r\n ]) /g,j=/(^| ) /gm,f=/\r\n?|\n/g,s=/[ \r\n]$/,k=o;function h(p){if(p>i){if(m&&m!==l){g.push(Cc);m=r}if(!m&&l){m=l;g.push(Dc,m,Ec)}var t=ga(v(b.substring(i,p))).replace(k?j:w,Fc);k=s.test(t);var u=window._pr_isIE6()?Gc:Hc;g.push(t.replace(f,u));i=p}}for(;1;){var e;if(e=n<c.length?q<d.length?c[n]<=d[q]:o:z){h(c[n]);if(m){g.push(Cc);m=r}g.push(c[n+1]);n+=2}else if(q<d.length){h(d[q]);l=d[q+1];q+=2}else break}h(b.length);m&&g.push(Cc);a.a=g.join(P)}
|
||||
var X={};function y(a,b){for(var c=b.length;--c>=0;){var d=b[c];if(X.hasOwnProperty(d))Ic in window&&console.i(Jc,d);else X[d]=a}}function Ra(a,b){a&&X.hasOwnProperty(a)||(a=/^\s*</.test(b)?Kc:Lc);return X[a]}y(ae,[Lc]);y(K([],[[S,/^[^<?]+/],[Mc,/^<!\w[^>]*(?:>|$)/],[V,/^<\!--[\s\S]*?(?:-\->|$)/],[T,/^<\?([\s\S]+?)(?:\?>|$)/],[T,/^<%([\s\S]+?)(?:%>|$)/],[Y,/^(?:<[%?]|[%?]>)/],[T,/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],[Z,/^<script\b[^>]*>([\s\S]+?)<\/script\b[^>]*>/i],[$,/^<style\b[^>]*>([\s\S]+?)<\/style\b[^>]*>/i],
|
||||
[Nc,/^(<\/?[a-z][^<>]*>)/i]]),[Kc,Oc,Pc,Qc,Rc,Sc,Tc]);y(K([[S,/^[\s]+/,r,Uc],[Vc,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,r,rc]],[[Wc,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[Xc,/^(?!style\b|on)[a-z](?:[\w:-]*\w)?/],[Yc,/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Y,/^[=<>\/]+/],[Z,/^on\w+\s*=\s*\"([^\"]+)\"/i],[Z,/^on\w+\s*=\s*\'([^\']+)\'/i],[Z,/^on\w+\s*=\s*([^\"\'>\s]+)/i],[$,/^sty\w+\s*=\s*\"([^\"]+)\"/i],[$,/^sty\w+\s*=\s*\'([^\']+)\'/i],[$,/^sty\w+\s*=\s*([^\"\'>\s]+)/i]]),[Zc]);y(K([],[[Vc,/^[\s\S]+/]]),
|
||||
[$c]);y(C({keywords:ad,hashComments:o,cStyleComments:o}),[bd,cd,dd,ed,fd,gd]);y(C({keywords:hd}),[id]);y(C({keywords:jd,hashComments:o,cStyleComments:o}),[kd]);y(C({keywords:ld,cStyleComments:o}),[md]);y(C({keywords:nd,hashComments:o,multiLineStrings:o}),[od,pd,qd]);y(C({keywords:rd,hashComments:o,multiLineStrings:o,tripleQuotedStrings:o}),[sd,td]);y(C({keywords:ud,hashComments:o,multiLineStrings:o,regexLiterals:o}),[vd,wd,xd]);y(C({keywords:yd,hashComments:o,multiLineStrings:o,regexLiterals:o}),
|
||||
[zd]);y(C({keywords:Ad,cStyleComments:o,regexLiterals:o}),[Bd]);y(K([],[[U,/^[\s\S]+/]]),[Cd]);function Sa(a){var b=a.e,c=a.d;a.a=b;try{var d=Zd(b),g=d.source;a.source=g;a.b=0;a.f=d.tags;Ra(c,g)(a);be(a)}catch(i){if(Ic in window){console.log(i);console.h()}}}function ce(a,b){var c={e:a,d:b};Sa(c);return c.a}function de(a){for(var b=window._pr_isIE6(),c=[document.getElementsByTagName(Dd),document.getElementsByTagName(Ed),document.getElementsByTagName(Fd)],d=[],g=0;g<c.length;++g)for(var i=0,m=c[g].length;i<
|
||||
m;++i)d.push(c[g][i]);c=r;var l=Date;l.now||(l={now:function(){return(new Date).getTime()}});var n=0,q;function v(){for(var j=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;n<d.length&&l.now()<j;n++){var f=d[n];if(f.className&&f.className.indexOf(Gd)>=0){var s=f.className.match(/\blang-(\w+)\b/);if(s)s=s[1];for(var k=z,h=f.parentNode;h;h=h.parentNode)if((h.tagName===Dd||h.tagName===Ed||h.tagName===Fd)&&h.className&&h.className.indexOf(Gd)>=0){k=o;break}if(!k){var e=Td(f);e=e.replace(/(?:\r\n?|\n)$/,
|
||||
P);q={e:e,d:s,g:f};Sa(q);w()}}}if(n<d.length)setTimeout(v,250);else a&&a()}function w(){var j=q.a;if(j){var f=q.g;if(Ma(f)){for(var s=document.createElement(gc),k=0;k<f.attributes.length;++k){var h=f.attributes[k];if(h.specified){var e=h.name.toLowerCase();if(e===Hd)s.className=h.value;else s.setAttribute(h.name,h.value)}}s.innerHTML=j;f.parentNode.replaceChild(s,f);f=s}else f.innerHTML=j;if(b&&f.tagName===gc)for(var p=f.getElementsByTagName(Id),t=p.length;--t>=0;){var u=p[t];u.parentNode.replaceChild(document.createTextNode(Jd),
|
||||
u)}}}v()}window.PR_normalizedHtml=W;window.prettyPrintOne=ce;window.prettyPrint=de;window.PR={combinePrefixPatterns:Na,createSimpleLexer:K,registerLangHandler:y,sourceDecorator:C,PR_ATTRIB_NAME:Xc,PR_ATTRIB_VALUE:Vc,PR_COMMENT:V,PR_DECLARATION:Mc,PR_KEYWORD:uc,PR_LITERAL:yc,PR_NOCODE:lc,PR_PLAIN:S,PR_PUNCTUATION:Y,PR_SOURCE:oc,PR_STRING:U,PR_TAG:Wc,PR_TYPE:zc}})();
|
||||
})()
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* jScrollPane - v2.0.0beta11 - 2012-04-23
|
||||
* http://jscrollpane.kelvinluck.com/
|
||||
*
|
||||
* Copyright (c) 2010 Kelvin Luck
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
*/
|
||||
(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var ay,Q=this,Y,aj,v,al,T,Z,y,q,az,aE,au,i,I,h,j,aa,U,ap,X,t,A,aq,af,am,G,l,at,ax,x,av,aH,f,L,ai=true,P=true,aG=false,k=false,ao=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aH=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function ar(aQ){var aL,aN,aM,aJ,aI,aP,aO=false,aK=false;ay=aQ;if(Y===c){aI=D.scrollTop();aP=D.scrollLeft();D.css({overflow:"hidden",padding:0});aj=D.innerWidth()+f;v=D.innerHeight();D.width(aj);Y=b('<div class="jspPane" />').css("padding",aH).append(D.children());al=b('<div class="jspContainer" />').css({width:aj+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aO=ay.stickToBottom&&K();aK=ay.stickToRight&&B();aJ=D.innerWidth()+f!=aj||D.outerHeight()!=v;if(aJ){aj=D.innerWidth()+f;v=D.innerHeight();al.css({width:aj+"px",height:v+"px"})}if(!aJ&&L==T&&Y.outerHeight()==Z){D.width(aj);return}L=T;Y.css("width","");D.width(aj);al.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aQ.contentWidth){T=aQ.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/aj;q=Z/v;az=q>1;aE=y>1;if(!(aE||az)){D.removeClass("jspScrollable");Y.css({top:0,width:al.width()-f});n();E();R();w()}else{D.addClass("jspScrollable");aL=ay.maintainPosition&&(I||aa);if(aL){aN=aC();aM=aA()}aF();z();F();if(aL){N(aK?(T-aj):aN,false);M(aO?(Z-v):aM,false)}J();ag();an();if(ay.enableKeyboardNavigation){S()}if(ay.clickOnTrack){p()}C();if(ay.hijackInternalLinks){m()}}if(ay.autoReinitialise&&!av){av=setInterval(function(){ar(ay)},ay.autoReinitialiseDelay)}else{if(!ay.autoReinitialise&&av){clearInterval(av)}}aI&&D.scrollTop(0)&&M(aI,false);aP&&D.scrollLeft(0)&&N(aP,false);D.trigger("jsp-initialised",[aE||az])}function aF(){if(az){al.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));U=al.find(">.jspVerticalBar");ap=U.find(">.jspTrack");au=ap.find(">.jspDrag");if(ay.showArrows){aq=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aD(0,-1)).bind("click.jsp",aB);af=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aD(0,1)).bind("click.jsp",aB);if(ay.arrowScrollOnHover){aq.bind("mouseover.jsp",aD(0,-1,aq));af.bind("mouseover.jsp",aD(0,1,af))}ak(ap,ay.verticalArrowPositions,aq,af)}t=v;al.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});au.hover(function(){au.addClass("jspHover")},function(){au.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);au.addClass("jspActive");var s=aI.pageY-au.position().top;b("html").bind("mousemove.jsp",function(aJ){V(aJ.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});o()}}function o(){ap.height(t+"px");I=0;X=ay.verticalGutter+ap.outerWidth();Y.width(aj-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aE){al.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));am=al.find(">.jspHorizontalBar");G=am.find(">.jspTrack");h=G.find(">.jspDrag");if(ay.showArrows){ax=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aD(-1,0)).bind("click.jsp",aB);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aD(1,0)).bind("click.jsp",aB);
|
||||
if(ay.arrowScrollOnHover){ax.bind("mouseover.jsp",aD(-1,0,ax));x.bind("mouseover.jsp",aD(1,0,x))}ak(G,ay.horizontalArrowPositions,ax,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);h.addClass("jspActive");var s=aI.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aJ){W(aJ.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});l=al.innerWidth();ah()}}function ah(){al.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aE&&az){var aI=G.outerHeight(),s=ap.outerWidth();t-=aI;b(am).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;aj-=aI;G.parent().append(b('<div class="jspCorner" />').css("width",aI+"px"));o();ah()}if(aE){Y.width((al.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aE){at=Math.ceil(1/y*l);if(at>ay.horizontalDragMaxWidth){at=ay.horizontalDragMaxWidth}else{if(at<ay.horizontalDragMinWidth){at=ay.horizontalDragMinWidth}}h.width(at+"px");j=l-at;ae(aa)}if(az){A=Math.ceil(1/q*t);if(A>ay.verticalDragMaxHeight){A=ay.verticalDragMaxHeight}else{if(A<ay.verticalDragMinHeight){A=ay.verticalDragMinHeight}}au.height(A+"px");i=t-A;ad(I)}}function ak(aJ,aL,aI,s){var aN="before",aK="after",aM;if(aL=="os"){aL=/Mac/.test(navigator.platform)?"after":"split"}if(aL==aN){aK=aL}else{if(aL==aK){aN=aL;aM=aI;aI=s;s=aM}}aJ[aN](aI)[aK](s)}function aD(aI,s,aJ){return function(){H(aI,s,this,aJ);this.blur();return false}}function H(aL,aK,aO,aN){aO=b(aO).addClass("jspActive");var aM,aJ,aI=true,s=function(){if(aL!==0){Q.scrollByX(aL*ay.arrowButtonSpeed)}if(aK!==0){Q.scrollByY(aK*ay.arrowButtonSpeed)}aJ=setTimeout(s,aI?ay.initialDelay:ay.arrowRepeatFreq);aI=false};s();aM=aN?"mouseout.jsp":"mouseup.jsp";aN=aN||b("html");aN.bind(aM,function(){aO.removeClass("jspActive");aJ&&clearTimeout(aJ);aJ=null;aN.unbind(aM)})}function p(){w();if(az){ap.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageY-aO.top-I,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageY-aR.top-A/2,aP=v*ay.scrollPagePercent,aQ=i*aP/(Z-v);if(aM<0){if(I-aQ>aS){Q.scrollByY(-aP)}else{V(aS)}}else{if(aM>0){if(I+aQ<aS){Q.scrollByY(aP)}else{V(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}if(aE){G.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageX-aO.left-aa,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageX-aR.left-at/2,aP=aj*ay.scrollPagePercent,aQ=j*aP/(T-aj);if(aM<0){if(aa-aQ>aS){Q.scrollByX(-aP)}else{W(aS)}}else{if(aM>0){if(aa+aQ<aS){Q.scrollByX(aP)}else{W(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}}function w(){if(G){G.unbind("mousedown.jsp")}if(ap){ap.unbind("mousedown.jsp")}}function aw(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(au){au.removeClass("jspActive")}if(h){h.removeClass("jspActive")}}function V(s,aI){if(!az){return}if(s<0){s=0}else{if(s>i){s=i}}if(aI===c){aI=ay.animateScroll}if(aI){Q.animate(au,"top",s,ad)}else{au.css("top",s);ad(s)}}function ad(aI){if(aI===c){aI=au.position().top}al.scrollTop(0);I=aI;var aL=I===0,aJ=I==i,aK=aI/i,s=-aK*(Z-v);if(ai!=aL||aG!=aJ){ai=aL;aG=aJ;D.trigger("jsp-arrow-change",[ai,aG,P,k])}u(aL,aJ);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aL,aJ]).trigger("scroll")}function W(aI,s){if(!aE){return}if(aI<0){aI=0}else{if(aI>j){aI=j}}if(s===c){s=ay.animateScroll}if(s){Q.animate(h,"left",aI,ae)
|
||||
}else{h.css("left",aI);ae(aI)}}function ae(aI){if(aI===c){aI=h.position().left}al.scrollTop(0);aa=aI;var aL=aa===0,aK=aa==j,aJ=aI/j,s=-aJ*(T-aj);if(P!=aL||k!=aK){P=aL;k=aK;D.trigger("jsp-arrow-change",[ai,aG,P,k])}r(aL,aK);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aL,aK]).trigger("scroll")}function u(aI,s){if(ay.showArrows){aq[aI?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aI,s){if(ay.showArrows){ax[aI?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aI){var aJ=s/(Z-v);V(aJ*i,aI)}function N(aI,s){var aJ=aI/(T-aj);W(aJ*j,s)}function ab(aV,aQ,aJ){var aN,aK,aL,s=0,aU=0,aI,aP,aO,aS,aR,aT;try{aN=b(aV)}catch(aM){return}aK=aN.outerHeight();aL=aN.outerWidth();al.scrollTop(0);al.scrollLeft(0);while(!aN.is(".jspPane")){s+=aN.position().top;aU+=aN.position().left;aN=aN.offsetParent();if(/^body|html$/i.test(aN[0].nodeName)){return}}aI=aA();aO=aI+v;if(s<aI||aQ){aR=s-ay.verticalGutter}else{if(s+aK>aO){aR=s-v+aK+ay.verticalGutter}}if(aR){M(aR,aJ)}aP=aC();aS=aP+aj;if(aU<aP||aQ){aT=aU-ay.horizontalGutter}else{if(aU+aL>aS){aT=aU-aj+aL+ay.horizontalGutter}}if(aT){N(aT,aJ)}}function aC(){return -Y.position().left}function aA(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aA()<10)}function B(){var s=T-aj;return(s>20)&&(s-aC()<10)}function ag(){al.unbind(ac).bind(ac,function(aL,aM,aK,aI){var aJ=aa,s=I;Q.scrollBy(aK*ay.mouseWheelSpeed,-aI*ay.mouseWheelSpeed,false);return aJ==aa&&s==I})}function n(){al.unbind(ac)}function aB(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aI,aK=[];aE&&aK.push(am[0]);az&&aK.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aN){if(aN.target!==this&&!(aK.length&&b(aN.target).closest(aK).length)){return}var aM=aa,aL=I;switch(aN.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aN.keyCode;aJ();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aI=aN.keyCode==s&&aM!=aa||aL!=I;return !aI}).bind("keypress.jsp",function(aL){if(aL.keyCode==s){aJ()}return !aI});if(ay.hideFocus){D.css("outline","none");if("hideFocus" in al[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in al[0]){D.attr("hideFocus",false)}}function aJ(){var aM=aa,aL=I;switch(s){case 40:Q.scrollByY(ay.keyboardSpeed,false);break;case 38:Q.scrollByY(-ay.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*ay.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*ay.scrollPagePercent,false);break;case 39:Q.scrollByX(ay.keyboardSpeed,false);break;case 37:Q.scrollByX(-ay.keyboardSpeed,false);break}aI=aM!=aa||aL!=I;return aI}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aK,aI,aJ=escape(location.hash.substr(1));try{aK=b("#"+aJ+', a[name="'+aJ+'"]')}catch(s){return}if(aK.length&&Y.find(aJ)){if(al.scrollTop()===0){aI=setInterval(function(){if(al.scrollTop()>0){ab(aK,true);b(document).scrollTop(al.position().top);clearInterval(aI)}},50)}else{ab(aK,true);b(document).scrollTop(al.position().top)}}}}function m(){if(b(document.body).data("jspHijack")){return}b(document.body).data("jspHijack",true);b(document.body).delegate("a[href*=#]","click",function(s){var aI=this.href.substr(0,this.href.indexOf("#")),aK=location.href,aO,aP,aJ,aM,aL,aN;if(location.href.indexOf("#")!==-1){aK=location.href.substr(0,location.href.indexOf("#"))}if(aI!==aK){return}aO=escape(this.href.substr(this.href.indexOf("#")+1));aP;try{aP=b("#"+aO+', a[name="'+aO+'"]')}catch(aQ){return}if(!aP.length){return}aJ=aP.closest(".jspScrollable");aM=aJ.data("jsp");aM.scrollToElement(aP,true);if(aJ[0].scrollIntoView){aL=b(a).scrollTop();aN=aP.offset().top;if(aN<aL||aN>aL+b(a).height()){aJ[0].scrollIntoView()}}s.preventDefault()
|
||||
})}function an(){var aJ,aI,aL,aK,aM,s=false;al.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aN){var aO=aN.originalEvent.touches[0];aJ=aC();aI=aA();aL=aO.pageX;aK=aO.pageY;aM=false;s=true}).bind("touchmove.jsp",function(aQ){if(!s){return}var aP=aQ.originalEvent.touches[0],aO=aa,aN=I;Q.scrollTo(aJ+aL-aP.pageX,aI+aK-aP.pageY);aM=aM||Math.abs(aL-aP.pageX)>5||Math.abs(aK-aP.pageY)>5;return aO==aa&&aN==I}).bind("touchend.jsp",function(aN){s=false}).bind("click.jsp-touchclick",function(aN){if(aM){aM=false;return false}})}function g(){var s=aA(),aI=aC();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ao.append(Y.children()));ao.scrollTop(s);ao.scrollLeft(aI);if(av){clearInterval(av)}}b.extend(Q,{reinitialise:function(aI){aI=b.extend({},ay,aI);ar(aI)},scrollToElement:function(aJ,aI,s){ab(aJ,aI,s)},scrollTo:function(aJ,s,aI){N(aJ,aI);M(s,aI)},scrollToX:function(aI,s){N(aI,s)},scrollToY:function(s,aI){M(s,aI)},scrollToPercentX:function(aI,s){N(aI*(T-aj),s)},scrollToPercentY:function(aI,s){M(aI*(Z-v),s)},scrollBy:function(aI,s,aJ){Q.scrollByX(aI,aJ);Q.scrollByY(s,aJ)},scrollByX:function(s,aJ){var aI=aC()+Math[s<0?"floor":"ceil"](s),aK=aI/(T-aj);W(aK*j,aJ)},scrollByY:function(s,aJ){var aI=aA()+Math[s<0?"floor":"ceil"](s),aK=aI/(Z-v);V(aK*i,aJ)},positionDragX:function(s,aI){W(s,aI)},positionDragY:function(aI,s){V(aI,s)},animate:function(aI,aL,s,aK){var aJ={};aJ[aL]=s;aI.animate(aJ,{duration:ay.animateDuration,easing:ay.animateEase,queue:false,step:aK})},getContentPositionX:function(){return aC()},getContentPositionY:function(){return aA()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aC()/(T-aj)},getPercentScrolledY:function(){return aA()/(Z-v)},getIsScrollableH:function(){return aE},getIsScrollableV:function(){return az},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:b.noop,destroy:function(){g()}});ar(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);
|
|
@ -0,0 +1,12 @@
|
|||
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.6
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
|
|
@ -1,266 +0,0 @@
|
|||
var gSelectedIndex = -1;
|
||||
var gSelectedID = -1;
|
||||
var gMatches = new Array();
|
||||
var gLastText = "";
|
||||
var ROW_COUNT = 20;
|
||||
var gInitialized = false;
|
||||
var DEFAULT_TEXT = "search developer docs";
|
||||
|
||||
function set_row_selected(row, selected)
|
||||
{
|
||||
var c1 = row.cells[0];
|
||||
// var c2 = row.cells[1];
|
||||
if (selected) {
|
||||
c1.className = "jd-autocomplete jd-selected";
|
||||
// c2.className = "jd-autocomplete jd-selected jd-linktype";
|
||||
} else {
|
||||
c1.className = "jd-autocomplete";
|
||||
// c2.className = "jd-autocomplete jd-linktype";
|
||||
}
|
||||
}
|
||||
|
||||
function set_row_values(toroot, row, match)
|
||||
{
|
||||
var link = row.cells[0].childNodes[0];
|
||||
link.innerHTML = match.__hilabel || match.label;
|
||||
link.href = toroot + match.link
|
||||
// row.cells[1].innerHTML = match.type;
|
||||
}
|
||||
|
||||
function sync_selection_table(toroot)
|
||||
{
|
||||
var filtered = document.getElementById("search_filtered");
|
||||
var r; //TR DOM object
|
||||
var i; //TR iterator
|
||||
gSelectedID = -1;
|
||||
|
||||
filtered.onmouseover = function() {
|
||||
if(gSelectedIndex >= 0) {
|
||||
set_row_selected(this.rows[gSelectedIndex], false);
|
||||
gSelectedIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
//initialize the table; draw it for the first time (but not visible).
|
||||
if (!gInitialized) {
|
||||
for (i=0; i<ROW_COUNT; i++) {
|
||||
var r = filtered.insertRow(-1);
|
||||
var c1 = r.insertCell(-1);
|
||||
// var c2 = r.insertCell(-1);
|
||||
c1.className = "jd-autocomplete";
|
||||
// c2.className = "jd-autocomplete jd-linktype";
|
||||
var link = document.createElement("a");
|
||||
c1.onmousedown = function() {
|
||||
window.location = this.firstChild.getAttribute("href");
|
||||
}
|
||||
c1.onmouseover = function() {
|
||||
this.className = this.className + " jd-selected";
|
||||
}
|
||||
c1.onmouseout = function() {
|
||||
this.className = "jd-autocomplete";
|
||||
}
|
||||
c1.appendChild(link);
|
||||
}
|
||||
/* var r = filtered.insertRow(-1);
|
||||
var c1 = r.insertCell(-1);
|
||||
c1.className = "jd-autocomplete jd-linktype";
|
||||
c1.colSpan = 2; */
|
||||
gInitialized = true;
|
||||
}
|
||||
|
||||
//if we have results, make the table visible and initialize result info
|
||||
if (gMatches.length > 0) {
|
||||
document.getElementById("search_filtered_div").className = "showing";
|
||||
var N = gMatches.length < ROW_COUNT ? gMatches.length : ROW_COUNT;
|
||||
for (i=0; i<N; i++) {
|
||||
r = filtered.rows[i];
|
||||
r.className = "show-row";
|
||||
set_row_values(toroot, r, gMatches[i]);
|
||||
set_row_selected(r, i == gSelectedIndex);
|
||||
if (i == gSelectedIndex) {
|
||||
gSelectedID = gMatches[i].id;
|
||||
}
|
||||
}
|
||||
//start hiding rows that are no longer matches
|
||||
for (; i<ROW_COUNT; i++) {
|
||||
r = filtered.rows[i];
|
||||
r.className = "no-display";
|
||||
}
|
||||
//if there are more results we're not showing, so say so.
|
||||
/* if (gMatches.length > ROW_COUNT) {
|
||||
r = filtered.rows[ROW_COUNT];
|
||||
r.className = "show-row";
|
||||
c1 = r.cells[0];
|
||||
c1.innerHTML = "plus " + (gMatches.length-ROW_COUNT) + " more";
|
||||
} else {
|
||||
filtered.rows[ROW_COUNT].className = "hide-row";
|
||||
}*/
|
||||
//if we have no results, hide the table
|
||||
} else {
|
||||
document.getElementById("search_filtered_div").className = "no-display";
|
||||
}
|
||||
}
|
||||
|
||||
function search_changed(e, kd, toroot)
|
||||
{
|
||||
var search = document.getElementById("search_autocomplete");
|
||||
var text = search.value.replace(/(^ +)|( +$)/g, '');
|
||||
|
||||
// 13 = enter
|
||||
if (e.keyCode == 13) {
|
||||
document.getElementById("search_filtered_div").className = "no-display";
|
||||
if (kd && gSelectedIndex >= 0) {
|
||||
window.location = toroot + gMatches[gSelectedIndex].link;
|
||||
return false;
|
||||
} else if (gSelectedIndex < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// 38 -- arrow up
|
||||
else if (kd && (e.keyCode == 38)) {
|
||||
if (gSelectedIndex >= 0) {
|
||||
gSelectedIndex--;
|
||||
}
|
||||
sync_selection_table(toroot);
|
||||
return false;
|
||||
}
|
||||
// 40 -- arrow down
|
||||
else if (kd && (e.keyCode == 40)) {
|
||||
if (gSelectedIndex < gMatches.length-1
|
||||
&& gSelectedIndex < ROW_COUNT-1) {
|
||||
gSelectedIndex++;
|
||||
}
|
||||
sync_selection_table(toroot);
|
||||
return false;
|
||||
}
|
||||
else if (!kd) {
|
||||
gMatches = new Array();
|
||||
matchedCount = 0;
|
||||
gSelectedIndex = -1;
|
||||
for (var i=0; i<DATA.length; i++) {
|
||||
var s = DATA[i];
|
||||
if (text.length != 0 &&
|
||||
s.label.toLowerCase().indexOf(text.toLowerCase()) != -1) {
|
||||
gMatches[matchedCount] = s;
|
||||
matchedCount++;
|
||||
}
|
||||
}
|
||||
rank_autocomplete_results(text);
|
||||
for (var i=0; i<gMatches.length; i++) {
|
||||
var s = gMatches[i];
|
||||
if (gSelectedID == s.id) {
|
||||
gSelectedIndex = i;
|
||||
}
|
||||
}
|
||||
highlight_autocomplete_result_labels(text);
|
||||
sync_selection_table(toroot);
|
||||
return true; // allow the event to bubble up to the search api
|
||||
}
|
||||
}
|
||||
|
||||
function rank_autocomplete_results(query) {
|
||||
query = query || '';
|
||||
if (!gMatches || !gMatches.length)
|
||||
return;
|
||||
|
||||
// helper function that gets the last occurence index of the given regex
|
||||
// in the given string, or -1 if not found
|
||||
var _lastSearch = function(s, re) {
|
||||
if (s == '')
|
||||
return -1;
|
||||
var l = -1;
|
||||
var tmp;
|
||||
while ((tmp = s.search(re)) >= 0) {
|
||||
if (l < 0) l = 0;
|
||||
l += tmp;
|
||||
s = s.substr(tmp + 1);
|
||||
}
|
||||
return l;
|
||||
};
|
||||
|
||||
// helper function that counts the occurrences of a given character in
|
||||
// a given string
|
||||
var _countChar = function(s, c) {
|
||||
var n = 0;
|
||||
for (var i=0; i<s.length; i++)
|
||||
if (s.charAt(i) == c) ++n;
|
||||
return n;
|
||||
};
|
||||
|
||||
var queryLower = query.toLowerCase();
|
||||
var queryAlnum = (queryLower.match(/\w+/) || [''])[0];
|
||||
var partPrefixAlnumRE = new RegExp('\\b' + queryAlnum);
|
||||
var partExactAlnumRE = new RegExp('\\b' + queryAlnum + '\\b');
|
||||
|
||||
var _resultScoreFn = function(result) {
|
||||
// scores are calculated based on exact and prefix matches,
|
||||
// and then number of path separators (dots) from the last
|
||||
// match (i.e. favoring classes and deep package names)
|
||||
var score = 1.0;
|
||||
var labelLower = result.label.toLowerCase();
|
||||
var t;
|
||||
t = _lastSearch(labelLower, partExactAlnumRE);
|
||||
if (t >= 0) {
|
||||
// exact part match
|
||||
var partsAfter = _countChar(labelLower.substr(t + 1), '.');
|
||||
score *= 200 / (partsAfter + 1);
|
||||
} else {
|
||||
t = _lastSearch(labelLower, partPrefixAlnumRE);
|
||||
if (t >= 0) {
|
||||
// part prefix match
|
||||
var partsAfter = _countChar(labelLower.substr(t + 1), '.');
|
||||
score *= 20 / (partsAfter + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return score;
|
||||
};
|
||||
|
||||
for (var i=0; i<gMatches.length; i++) {
|
||||
gMatches[i].__resultScore = _resultScoreFn(gMatches[i]);
|
||||
}
|
||||
|
||||
gMatches.sort(function(a,b){
|
||||
var n = b.__resultScore - a.__resultScore;
|
||||
if (n == 0) // lexicographical sort if scores are the same
|
||||
n = (a.label < b.label) ? -1 : 1;
|
||||
return n;
|
||||
});
|
||||
}
|
||||
|
||||
function highlight_autocomplete_result_labels(query) {
|
||||
query = query || '';
|
||||
if (!gMatches || !gMatches.length)
|
||||
return;
|
||||
|
||||
var queryLower = query.toLowerCase();
|
||||
var queryAlnumDot = (queryLower.match(/[\w\.]+/) || [''])[0];
|
||||
var queryRE = new RegExp(
|
||||
'(' + queryAlnumDot.replace(/\./g, '\\.') + ')', 'ig');
|
||||
for (var i=0; i<gMatches.length; i++) {
|
||||
gMatches[i].__hilabel = gMatches[i].label.replace(
|
||||
queryRE, '<b>$1</b>');
|
||||
}
|
||||
}
|
||||
|
||||
function search_focus_changed(obj, focused)
|
||||
{
|
||||
if (focused) {
|
||||
if(obj.value == DEFAULT_TEXT){
|
||||
obj.value = "";
|
||||
obj.style.color="#000000";
|
||||
}
|
||||
} else {
|
||||
if(obj.value == ""){
|
||||
obj.value = DEFAULT_TEXT;
|
||||
obj.style.color="#aaaaaa";
|
||||
}
|
||||
document.getElementById("search_filtered_div").className = "no-display";
|
||||
}
|
||||
}
|
||||
|
||||
function submit_search() {
|
||||
var query = document.getElementById('search_autocomplete').value;
|
||||
document.location = toRoot + 'search.html#q=' + query + '&t=0';
|
||||
return false;
|
||||
}
|
|
@ -1,316 +0,0 @@
|
|||
.jd-toptitle {
|
||||
padding-left: 6px;
|
||||
margin-bottom: 30px;
|
||||
font-size: 160%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div#jd-content table {
|
||||
border: none;
|
||||
}
|
||||
|
||||
div#jd-content td, div#jd-content th {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable {
|
||||
margin-top: 3px;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
div#jd-content p.jd-deprecated-warning {
|
||||
margin-top: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable th {
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
border: none;
|
||||
border-top: 1px solid #d2d7d0;
|
||||
background-color: #F7FCF4;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable td {
|
||||
border: none;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable td p {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable .jd-linkcol {
|
||||
vertical-align: top;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 0;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
border-top: 1px solid #d2d7d0;
|
||||
background-color: #E5F1E0;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable .jd-descrcol {
|
||||
vertical-align: top;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 0;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
border-top: 1px solid #d2d7d0;
|
||||
background-color: #F7FCF4;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable .jd-descrcol p {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable .jd-valcol {
|
||||
vertical-align: top;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 0;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
border-top: 1px solid #d2d7d0;
|
||||
background-color: #E5F1E0;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-linktable .jd-commentrow {
|
||||
vertical-align: top;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 4px;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
background-color: #F7FCF4;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div#jd-content div.jd-inheritedlinks {
|
||||
vertical-align: top;
|
||||
margin-top: 9px;
|
||||
padding-left: 7px;
|
||||
padding-right: 7px;
|
||||
background-color: #F7FCF4;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div#jd-content .jd-page_title-prefix {
|
||||
padding-top: 2em;
|
||||
margin-bottom: -14pt;
|
||||
}
|
||||
|
||||
div#jd-content {
|
||||
margin-left: 0;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div#jd-content h1 {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
div#jd-content h2 {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
div#jd-content h4 {
|
||||
margin-top: 9px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
div#jd-content .jd-descr h5 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
div#jd-content .sidebox h3 {
|
||||
margin: 1em 0 0 0;
|
||||
}
|
||||
|
||||
div#jd-content .jd-letterlist {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div#jd-content .jd-lettertable {
|
||||
margin-top: 15px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
div#jd-content .jd-letterentries {
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
}
|
||||
div#jd-content .jd-letterentrycomments {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-inheritance-table {
|
||||
margin-top: 0;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-inheritance-table td {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-inheritance-table .jd-inheritance-space {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
div#jd-content table.jd-inheritance-table .jd-inheritance-interface-cell {
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
div#jd-content h4.jd-details-title {
|
||||
margin: 0;
|
||||
background-color: #E5F1E0;
|
||||
padding: 2px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
div#jd-content .jd-details {
|
||||
margin-top: 0;
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
div#jd-content .jd-details-descr {
|
||||
line-height: 120%;
|
||||
padding-left: 10px;
|
||||
padding-top: 10px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
div#jd-content .jd-descr h5,
|
||||
div#jd-content .jd-details h5 {
|
||||
font-style: normal;
|
||||
text-decoration: none;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
div#jd-content .jd-more {
|
||||
}
|
||||
|
||||
div#jd-content .jd-descr {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
div#jd-content .jd-tagdata {
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
div#jd-content .jd-tagtitle {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
div#jd-content .jd-tagtable {
|
||||
margin-top: 10px;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
div#jd-content .jd-tagtable th {
|
||||
background: white;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
line-height: 120%;
|
||||
}
|
||||
|
||||
div#jd-content .jd-tagtable th,
|
||||
div#jd-content .jd-tagtable td {
|
||||
line-height: 120%;
|
||||
border: none;
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
div#jd-content .Code,code,pre,samp,var {
|
||||
color: #004000;
|
||||
}
|
||||
|
||||
div#jd-content pre.Code {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
/* XXX I would really like to apply font-size: 9pt only if var/samp
|
||||
is NOT inside of a .jd-descr div. */
|
||||
div#jd-content .jd-descr code,var,samp {
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
#search_autocomplete {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
div#jd-searchbox table.jd-autocomplete-table-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div#jd-searchbox table.jd-autocomplete-table-showing {
|
||||
z-index: 10;
|
||||
border: 1px solid #3366cc;
|
||||
position: relative;
|
||||
top: -14px;
|
||||
left: 5px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
div#jd-searchbox td.jd-autocomplete {
|
||||
font-family: Arial, sans-serif;
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
font-size: 80%;
|
||||
border: none;
|
||||
margin: 0;
|
||||
line-height: 105%;
|
||||
}
|
||||
|
||||
div#jd-searchbox td.jd-selected {
|
||||
background-color: #E5F1E0;
|
||||
}
|
||||
|
||||
div#jd-searchbox td.jd-linktype {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
div#jd-content .jd-expando-trigger {
|
||||
margin-left: -8px;
|
||||
margin-right: 0px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
div#jd-build-id {
|
||||
color: #666;
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
#jd-searchbox, .jd-nav {
|
||||
display: none;
|
||||
}
|
||||
div#jd-content {
|
||||
margin-top: 0px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.com/yui/license.html
|
||||
version: 3.3.0
|
||||
build: 3167
|
||||
*/
|
||||
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
|
|
@ -0,0 +1,650 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>" itemscope itemtype="http://schema.org/Article">
|
||||
<div id="doc-api-level" class="<?cs var:class.since ?>" style="display:none"></div>
|
||||
<a name="top"></a>
|
||||
<?cs include:"header.cs" ?>
|
||||
|
||||
<div class="col-12" id="doc-col">
|
||||
|
||||
<div id="api-info-block">
|
||||
|
||||
<?cs # are there inherited members ?>
|
||||
<?cs each:cl=class.inherited ?>
|
||||
<?cs if:subcount(cl.methods) ?>
|
||||
<?cs set:inhmethods = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(cl.constants) ?>
|
||||
<?cs set:inhconstants = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(cl.fields) ?>
|
||||
<?cs set:inhfields = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(cl.attrs) ?>
|
||||
<?cs set:inhattrs = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs /each ?>
|
||||
|
||||
<div class="sum-details-links">
|
||||
<?cs if:inhattrs || inhconstants || inhfields || inhmethods || (!class.subclasses.hidden &&
|
||||
(subcount(class.subclasses.direct) || subcount(class.subclasses.indirect))) ?>
|
||||
Summary:
|
||||
<?cs if:subcount(class.inners) ?>
|
||||
<a href="#nestedclasses">Nested Classes</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.attrs) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#lattrs">XML Attrs</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:inhattrs ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#inhattrs">Inherited XML Attrs</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.enumConstants) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#enumconstants">Enums</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.constants) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#constants">Constants</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:inhconstants ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#inhconstants">Inherited Constants</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.fields) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#lfields">Fields</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:inhfields ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#inhfields">Inherited Fields</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.ctors.public) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#pubctors">Ctors</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.ctors.protected) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#proctors">Protected Ctors</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.methods.public) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#pubmethods">Methods</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:subcount(class.methods.protected) ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#promethods">Protected Methods</a>
|
||||
<?cs set:linkcount = #1 ?>
|
||||
<?cs /if ?>
|
||||
<?cs if:inhmethods ?>
|
||||
<?cs if:linkcount ?>| <?cs /if ?><a href="#inhmethods">Inherited Methods</a>
|
||||
<?cs /if ?>
|
||||
| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>
|
||||
<?cs /if ?>
|
||||
</div><!-- end sum-details-links -->
|
||||
<div class="api-level">
|
||||
<?cs call:since_tags(class) ?>
|
||||
<?cs call:federated_refs(class) ?>
|
||||
</div>
|
||||
</div><!-- end api-info-block -->
|
||||
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ======== START OF CLASS DATA ======== -->
|
||||
|
||||
<div id="jd-header">
|
||||
<?cs var:class.scope ?>
|
||||
<?cs var:class.static ?>
|
||||
<?cs var:class.final ?>
|
||||
<?cs var:class.abstract ?>
|
||||
<?cs var:class.kind ?>
|
||||
<h1 itemprop="name"><?cs var:class.name ?></h1>
|
||||
|
||||
<?cs set:colspan = subcount(class.inheritance) ?>
|
||||
<?cs each:supr = class.inheritance ?>
|
||||
<?cs if:colspan == 2 ?>
|
||||
extends <?cs call:type_link(supr.short_class) ?><br/>
|
||||
<?cs /if ?>
|
||||
<?cs if:last(supr) && subcount(supr.interfaces) ?>
|
||||
implements
|
||||
<?cs each:t=supr.interfaces ?>
|
||||
<?cs call:type_link(t) ?>
|
||||
<?cs /each ?>
|
||||
<?cs /if ?>
|
||||
<?cs set:colspan = colspan-1 ?>
|
||||
<?cs /each ?>
|
||||
|
||||
</div><!-- end header -->
|
||||
|
||||
<div id="naMessage"></div>
|
||||
|
||||
<div id="jd-content" class="api apilevel-<?cs var:class.since ?>">
|
||||
<table class="jd-inheritance-table">
|
||||
<?cs set:colspan = subcount(class.inheritance) ?>
|
||||
<?cs each:supr = class.inheritance ?>
|
||||
<tr>
|
||||
<?cs loop:i = 1, (subcount(class.inheritance)-colspan), 1 ?>
|
||||
<td class="jd-inheritance-space"> <?cs if:(subcount(class.inheritance)-colspan) == i ?> ↳<?cs /if ?></td>
|
||||
<?cs /loop ?>
|
||||
<td colspan="<?cs var:colspan ?>" class="jd-inheritance-class-cell"><?cs
|
||||
if:colspan == 1
|
||||
?><?cs call:class_name(class.qualifiedType) ?><?cs
|
||||
else
|
||||
?><?cs call:type_link(supr.class) ?><?cs
|
||||
/if ?></td>
|
||||
</tr>
|
||||
<?cs set:colspan = colspan-1 ?>
|
||||
<?cs /each ?>
|
||||
</table>
|
||||
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
|
||||
<?cs if:subcount(class.subclasses.direct) && !class.subclasses.hidden ?>
|
||||
<table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="12" style="border:none;margin:0;padding:0;">
|
||||
<?cs call:expando_trigger("subclasses-direct", "closed") ?>Known Direct Subclasses
|
||||
<?cs call:expandable_class_list("subclasses-direct", class.subclasses.direct, "list") ?>
|
||||
</td></tr></table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.subclasses.indirect) && !class.subclasses.hidden ?>
|
||||
<table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="12" style="border:none;margin:0;padding:0;">
|
||||
<?cs call:expando_trigger("subclasses-indirect", "closed") ?>Known Indirect Subclasses
|
||||
<?cs call:expandable_class_list("subclasses-indirect", class.subclasses.indirect, "list") ?>
|
||||
</td></tr></table>
|
||||
<?cs /if ?>
|
||||
|
||||
<div class="jd-descr">
|
||||
<?cs call:deprecated_warning(class) ?>
|
||||
<?cs if:subcount(class.descr) ?>
|
||||
<h2>Class Overview</h2>
|
||||
<p itemprop="articleBody"><?cs call:tag_list(class.descr) ?></p>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs call:see_also_tags(class.seeAlso) ?>
|
||||
|
||||
</div><!-- jd-descr -->
|
||||
|
||||
|
||||
<?cs # summary macros ?>
|
||||
|
||||
<?cs def:write_method_summary(methods, included) ?>
|
||||
<?cs set:count = #1 ?>
|
||||
<?cs each:method = methods ?>
|
||||
<?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:method.since ?>" >
|
||||
<td class="jd-typecol"><nobr>
|
||||
<?cs var:method.abstract ?>
|
||||
<?cs var:method.synchronized ?>
|
||||
<?cs var:method.final ?>
|
||||
<?cs var:method.static ?>
|
||||
<?cs call:type_link(method.generic) ?>
|
||||
<?cs call:type_link(method.returnType) ?></nobr>
|
||||
</td>
|
||||
<td class="jd-linkcol" width="100%"><nobr>
|
||||
<span class="sympad"><?cs call:cond_link(method.name, toroot, method.href, included) ?></span>(<?cs call:parameter_list(method.params) ?>)</nobr>
|
||||
<?cs if:subcount(method.shortDescr) || subcount(method.deprecated) ?>
|
||||
<div class="jd-descrdiv"><?cs call:short_descr(method) ?></div>
|
||||
<?cs /if ?>
|
||||
</td></tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs def:write_field_summary(fields, included) ?>
|
||||
<?cs set:count = #1 ?>
|
||||
<?cs each:field=fields ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:field.since ?>" >
|
||||
<td class="jd-typecol"><nobr>
|
||||
<?cs var:field.scope ?>
|
||||
<?cs var:field.static ?>
|
||||
<?cs var:field.final ?>
|
||||
<?cs call:type_link(field.type) ?></nobr></td>
|
||||
<td class="jd-linkcol"><?cs call:cond_link(field.name, toroot, field.href, included) ?></td>
|
||||
<td class="jd-descrcol" width="100%"><?cs call:short_descr(field) ?></td>
|
||||
</tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs def:write_constant_summary(fields, included) ?>
|
||||
<?cs set:count = #1 ?>
|
||||
<?cs each:field=fields ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:field.since ?>" >
|
||||
<td class="jd-typecol"><?cs call:type_link(field.type) ?></td>
|
||||
<td class="jd-linkcol"><?cs call:cond_link(field.name, toroot, field.href, included) ?></td>
|
||||
<td class="jd-descrcol" width="100%"><?cs call:short_descr(field) ?></td>
|
||||
</tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs def:write_attr_summary(attrs, included) ?>
|
||||
<?cs set:count = #1 ?>
|
||||
<tr>
|
||||
<td><nobr><em>Attribute Name</em></nobr></td>
|
||||
<td><nobr><em>Related Method</em></nobr></td>
|
||||
<td><nobr><em>Description</em></nobr></td>
|
||||
</tr>
|
||||
<?cs each:attr=attrs ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:attr.since ?>" >
|
||||
<td class="jd-linkcol"><?cs if:included ?><a href="<?cs var:toroot ?><?cs var:attr.href ?>"><?cs /if ?><?cs var:attr.name ?><?cs if:included ?></a><?cs /if ?></td>
|
||||
<td class="jd-linkcol"><?cs each:m=attr.methods ?>
|
||||
<?cs call:cond_link(m.name, toroot, m.href, included) ?>
|
||||
<?cs /each ?>
|
||||
</td>
|
||||
<td class="jd-descrcol" width="100%"><?cs call:short_descr(attr) ?> </td>
|
||||
</tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs def:write_inners_summary(classes) ?>
|
||||
<?cs set:count = #1 ?>
|
||||
<?cs each:cl=class.inners ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:cl.since ?>" >
|
||||
<td class="jd-typecol"><nobr>
|
||||
<?cs var:cl.scope ?>
|
||||
<?cs var:cl.static ?>
|
||||
<?cs var:cl.final ?>
|
||||
<?cs var:cl.abstract ?>
|
||||
<?cs var:cl.kind ?></nobr></td>
|
||||
<td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td>
|
||||
<td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?> </td>
|
||||
</tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs # end macros ?>
|
||||
|
||||
<div class="jd-descr">
|
||||
<?cs # make sure there's a summary view to display ?>
|
||||
<?cs if:subcount(class.inners)
|
||||
|| subcount(class.attrs)
|
||||
|| inhattrs
|
||||
|| subcount(class.enumConstants)
|
||||
|| subcount(class.constants)
|
||||
|| inhconstants
|
||||
|| subcount(class.fields)
|
||||
|| inhfields
|
||||
|| subcount(class.ctors.public)
|
||||
|| subcount(class.ctors.protected)
|
||||
|| subcount(class.methods.public)
|
||||
|| subcount(class.methods.protected)
|
||||
|| inhmethods ?>
|
||||
<h2>Summary</h2>
|
||||
|
||||
<?cs if:subcount(class.inners) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
||||
<table id="nestedclasses" class="jd-sumtable"><tr><th colspan="12">Nested Classes</th></tr>
|
||||
<?cs call:write_inners_summary(class.inners) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<?cs if:subcount(class.attrs) ?>
|
||||
<!-- =========== FIELD SUMMARY =========== -->
|
||||
<table id="lattrs" class="jd-sumtable"><tr><th colspan="12">XML Attributes</th></tr>
|
||||
<?cs call:write_attr_summary(class.attrs, 1) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # if there are inherited attrs, write the table ?>
|
||||
<?cs if:inhattrs ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- =========== FIELD SUMMARY =========== -->
|
||||
<table id="inhattrs" class="jd-sumtable"><tr><th>
|
||||
<a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
|
||||
<div style="clear:left;">Inherited XML Attributes</div></th></tr>
|
||||
<?cs each:cl=class.inherited ?>
|
||||
<?cs if:subcount(cl.attrs) ?>
|
||||
<tr class="api apilevel-<?cs var:cl.since ?>" >
|
||||
<td colspan="12">
|
||||
<?cs call:expando_trigger("inherited-attrs-"+cl.qualified, "closed") ?>From <?cs var:cl.kind ?>
|
||||
<?cs call:cond_link(cl.qualified, toroot, cl.link, cl.included) ?>
|
||||
<div id="inherited-attrs-<?cs var:cl.qualified ?>">
|
||||
<div id="inherited-attrs-<?cs var:cl.qualified ?>-list"
|
||||
class="jd-inheritedlinks">
|
||||
</div>
|
||||
<div id="inherited-attrs-<?cs var:cl.qualified ?>-summary" style="display: none;">
|
||||
<table class="jd-sumtable-expando">
|
||||
<?cs call:write_attr_summary(cl.attrs, cl.included) ?></table>
|
||||
</div>
|
||||
</div>
|
||||
</td></tr>
|
||||
<?cs /if ?>
|
||||
<?cs /each ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.enumConstants) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
|
||||
<table id="enumconstants" class="jd-sumtable"><tr><th colspan="12">Enum Values</th></tr>
|
||||
<?cs set:count = #1 ?>
|
||||
<?cs each:field=class.enumConstants ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:field.since ?>" >
|
||||
<td class="jd-descrcol"><?cs call:type_link(field.type) ?> </td>
|
||||
<td class="jd-linkcol"><?cs call:cond_link(field.name, toroot, field.href, cl.included) ?> </td>
|
||||
<td class="jd-descrcol" width="100%"><?cs call:short_descr(field) ?> </td>
|
||||
</tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.constants) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
|
||||
<table id="constants" class="jd-sumtable"><tr><th colspan="12">Constants</th></tr>
|
||||
<?cs call:write_constant_summary(class.constants, 1) ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # if there are inherited constants, write the table ?>
|
||||
<?cs if:inhconstants ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
|
||||
<table id="inhconstants" class="jd-sumtable"><tr><th>
|
||||
<a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
|
||||
<div style="clear:left;">Inherited Constants</div></th></tr>
|
||||
<?cs each:cl=class.inherited ?>
|
||||
<?cs if:subcount(cl.constants) ?>
|
||||
<tr class="api apilevel-<?cs var:cl.since ?>" >
|
||||
<td colspan="12">
|
||||
<?cs call:expando_trigger("inherited-constants-"+cl.qualified, "closed") ?>From <?cs var:cl.kind ?>
|
||||
<?cs call:cond_link(cl.qualified, toroot, cl.link, cl.included) ?>
|
||||
<div id="inherited-constants-<?cs var:cl.qualified ?>">
|
||||
<div id="inherited-constants-<?cs var:cl.qualified ?>-list"
|
||||
class="jd-inheritedlinks">
|
||||
</div>
|
||||
<div id="inherited-constants-<?cs var:cl.qualified ?>-summary" style="display: none;">
|
||||
<table class="jd-sumtable-expando">
|
||||
<?cs call:write_constant_summary(cl.constants, cl.included) ?></table>
|
||||
</div>
|
||||
</div>
|
||||
</td></tr>
|
||||
<?cs /if ?>
|
||||
<?cs /each ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.fields) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- =========== FIELD SUMMARY =========== -->
|
||||
<table id="lfields" class="jd-sumtable"><tr><th colspan="12">Fields</th></tr>
|
||||
<?cs call:write_field_summary(class.fields, 1) ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # if there are inherited fields, write the table ?>
|
||||
<?cs if:inhfields ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- =========== FIELD SUMMARY =========== -->
|
||||
<table id="inhfields" class="jd-sumtable"><tr><th>
|
||||
<a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
|
||||
<div style="clear:left;">Inherited Fields</div></th></tr>
|
||||
<?cs each:cl=class.inherited ?>
|
||||
<?cs if:subcount(cl.fields) ?>
|
||||
<tr class="api apilevel-<?cs var:cl.since ?>" >
|
||||
<td colspan="12">
|
||||
<?cs call:expando_trigger("inherited-fields-"+cl.qualified, "closed") ?>From <?cs var:cl.kind ?>
|
||||
<?cs call:cond_link(cl.qualified, toroot, cl.link, cl.included) ?>
|
||||
<div id="inherited-fields-<?cs var:cl.qualified ?>">
|
||||
<div id="inherited-fields-<?cs var:cl.qualified ?>-list"
|
||||
class="jd-inheritedlinks">
|
||||
</div>
|
||||
<div id="inherited-fields-<?cs var:cl.qualified ?>-summary" style="display: none;">
|
||||
<table class="jd-sumtable-expando">
|
||||
<?cs call:write_field_summary(cl.fields, cl.included) ?></table>
|
||||
</div>
|
||||
</div>
|
||||
</td></tr>
|
||||
<?cs /if ?>
|
||||
<?cs /each ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.ctors.public) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||
<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr>
|
||||
<?cs call:write_method_summary(class.ctors.public, 1) ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.ctors.protected) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||
<table id="proctors" class="jd-sumtable"><tr><th colspan="12">Protected Constructors</th></tr>
|
||||
<?cs call:write_method_summary(class.ctors.protected, 1) ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.methods.public) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
|
||||
<?cs call:write_method_summary(class.methods.public, 1) ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:subcount(class.methods.protected) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
<table id="promethods" class="jd-sumtable"><tr><th colspan="12">Protected Methods</th></tr>
|
||||
<?cs call:write_method_summary(class.methods.protected, 1) ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # if there are inherited methods, write the table ?>
|
||||
<?cs if:inhmethods ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========== METHOD SUMMARY =========== -->
|
||||
<table id="inhmethods" class="jd-sumtable"><tr><th>
|
||||
<a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
|
||||
<div style="clear:left;">Inherited Methods</div></th></tr>
|
||||
<?cs each:cl=class.inherited ?>
|
||||
<?cs if:subcount(cl.methods) ?>
|
||||
<tr class="api apilevel-<?cs var:cl.since ?>" >
|
||||
<td colspan="12"><?cs call:expando_trigger("inherited-methods-"+cl.qualified, "closed") ?>
|
||||
From <?cs var:cl.kind ?>
|
||||
<?cs if:cl.included ?>
|
||||
<a href="<?cs var:toroot ?><?cs var:cl.link ?>"><?cs var:cl.qualified ?></a>
|
||||
<?cs elif:cl.federated ?>
|
||||
<a href="<?cs var:cl.link ?>"><?cs var:cl.qualified ?></a>
|
||||
<?cs else ?>
|
||||
<?cs var:cl.qualified ?>
|
||||
<?cs /if ?>
|
||||
<div id="inherited-methods-<?cs var:cl.qualified ?>">
|
||||
<div id="inherited-methods-<?cs var:cl.qualified ?>-list"
|
||||
class="jd-inheritedlinks">
|
||||
</div>
|
||||
<div id="inherited-methods-<?cs var:cl.qualified ?>-summary" style="display: none;">
|
||||
<table class="jd-sumtable-expando">
|
||||
<?cs call:write_method_summary(cl.methods, cl.included) ?></table>
|
||||
</div>
|
||||
</div>
|
||||
</td></tr>
|
||||
<?cs /if ?>
|
||||
<?cs /each ?>
|
||||
</table>
|
||||
<?cs /if ?>
|
||||
<?cs /if ?>
|
||||
</div><!-- jd-descr (summary) -->
|
||||
|
||||
<!-- Details -->
|
||||
|
||||
<?cs def:write_field_details(fields) ?>
|
||||
<?cs each:field=fields ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?>
|
||||
<A NAME="<?cs var:field.anchor ?>"></A>
|
||||
<?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?>
|
||||
<div class="jd-details api apilevel-<?cs var:field.since ?>">
|
||||
<h4 class="jd-details-title">
|
||||
<span class="normal">
|
||||
<?cs var:field.scope ?>
|
||||
<?cs var:field.static ?>
|
||||
<?cs var:field.final ?>
|
||||
<?cs call:type_link(field.type) ?>
|
||||
</span>
|
||||
<?cs var:field.name ?>
|
||||
</h4>
|
||||
<div class="api-level">
|
||||
<?cs call:since_tags(field) ?>
|
||||
<?cs call:federated_refs(field) ?>
|
||||
</div>
|
||||
<div class="jd-details-descr">
|
||||
<?cs call:description(field) ?>
|
||||
<?cs if:subcount(field.constantValue) ?>
|
||||
<div class="jd-tagdata">
|
||||
<span class="jd-tagtitle">Constant Value: </span>
|
||||
<span>
|
||||
<?cs if:field.constantValue.isString ?>
|
||||
<?cs var:field.constantValue.str ?>
|
||||
<?cs else ?>
|
||||
<?cs var:field.constantValue.dec ?>
|
||||
(<?cs var:field.constantValue.hex ?>)
|
||||
<?cs /if ?>
|
||||
</span>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
</div>
|
||||
</div>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs def:write_method_details(methods) ?>
|
||||
<?cs each:method=methods ?>
|
||||
<?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?>
|
||||
<A NAME="<?cs var:method.anchor ?>"></A>
|
||||
<?cs # The apilevel-N class MUST BE LAST in the sequence of class names ?>
|
||||
<div class="jd-details api apilevel-<?cs var:method.since ?>">
|
||||
<h4 class="jd-details-title">
|
||||
<span class="normal">
|
||||
<?cs var:method.scope ?>
|
||||
<?cs var:method.static ?>
|
||||
<?cs var:method.final ?>
|
||||
<?cs var:method.abstract ?>
|
||||
<?cs var:method.synchronized ?>
|
||||
<?cs call:type_link(method.returnType) ?>
|
||||
</span>
|
||||
<span class="sympad"><?cs var:method.name ?></span>
|
||||
<span class="normal">(<?cs call:parameter_list(method.params) ?>)</span>
|
||||
</h4>
|
||||
<div class="api-level">
|
||||
<div><?cs call:since_tags(method) ?></div>
|
||||
<?cs call:federated_refs(method) ?>
|
||||
</div>
|
||||
<div class="jd-details-descr">
|
||||
<?cs call:description(method) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs def:write_attr_details(attrs) ?>
|
||||
<?cs each:attr=attrs ?>
|
||||
<?cs # the A tag in the next line must remain where it is, so that Eclipse can parse the docs ?>
|
||||
<A NAME="<?cs var:attr.anchor ?>"></A>
|
||||
<div class="jd-details">
|
||||
<h4 class="jd-details-title"><?cs var:attr.name ?>
|
||||
</h4>
|
||||
<div class="jd-details-descr">
|
||||
<?cs call:description(attr) ?>
|
||||
|
||||
<div class="jd-tagdata">
|
||||
<h5 class="jd-tagtitle">Related Methods</h5>
|
||||
<ul class="nolist">
|
||||
<?cs each:m=attr.methods ?>
|
||||
<li><a href="<?cs var:toroot ?><?cs var:m.href ?>"><?cs var:m.name ?></a></li>
|
||||
<?cs /each ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?cs /each ?>
|
||||
<?cs /def ?>
|
||||
|
||||
|
||||
<!-- XML Attributes -->
|
||||
<?cs if:subcount(class.attrs) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= FIELD DETAIL ======== -->
|
||||
<h2>XML Attributes</h2>
|
||||
<?cs call:write_attr_details(class.attrs) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<!-- Enum Values -->
|
||||
<?cs if:subcount(class.enumConstants) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= ENUM CONSTANTS DETAIL ======== -->
|
||||
<h2>Enum Values</h2>
|
||||
<?cs call:write_field_details(class.enumConstants) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<!-- Constants -->
|
||||
<?cs if:subcount(class.constants) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= ENUM CONSTANTS DETAIL ======== -->
|
||||
<h2>Constants</h2>
|
||||
<?cs call:write_field_details(class.constants) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<!-- Fields -->
|
||||
<?cs if:subcount(class.fields) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= FIELD DETAIL ======== -->
|
||||
<h2>Fields</h2>
|
||||
<?cs call:write_field_details(class.fields) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<!-- Public ctors -->
|
||||
<?cs if:subcount(class.ctors.public) ?>
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||
<h2>Public Constructors</h2>
|
||||
<?cs call:write_method_details(class.ctors.public) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||
<!-- Protected ctors -->
|
||||
<?cs if:subcount(class.ctors.protected) ?>
|
||||
<h2>Protected Constructors</h2>
|
||||
<?cs call:write_method_details(class.ctors.protected) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= METHOD DETAIL ======== -->
|
||||
<!-- Public methdos -->
|
||||
<?cs if:subcount(class.methods.public) ?>
|
||||
<h2>Public Methods</h2>
|
||||
<?cs call:write_method_details(class.methods.public) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= METHOD DETAIL ======== -->
|
||||
<?cs if:subcount(class.methods.protected) ?>
|
||||
<h2>Protected Methods</h2>
|
||||
<?cs call:write_method_details(class.methods.protected) ?>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs # the next two lines must be exactly like this to be parsed by eclipse ?>
|
||||
<!-- ========= END OF CLASS DATA ========= -->
|
||||
<A NAME="navbar_top"></A>
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
</div> <!-- jd-content -->
|
||||
|
||||
</div><!-- end doc-content -->
|
||||
|
||||
<?cs include:"trailer.cs" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,47 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>" itemscope itemtype="http://schema.org/Article">
|
||||
<a name="top"></a>
|
||||
<?cs include:"header.cs" ?>
|
||||
|
||||
<div class="col-12" id="doc-col">
|
||||
|
||||
<div id="jd-header">
|
||||
<h1><?cs var:page.title ?></h1>
|
||||
</div>
|
||||
|
||||
<div id="jd-content">
|
||||
<p>These are the Android API classes. See all <a href="packages.html">API packages</a>.</p>
|
||||
<div class="jd-letterlist"><?cs each:letter=docs.classes ?>
|
||||
<a href="#letter_<?cs name:letter ?>"><?cs name:letter ?></a> <?cs /each?>
|
||||
</div>
|
||||
|
||||
<?cs each:letter=docs.classes ?>
|
||||
<?cs set:count = #1 ?>
|
||||
<h2 id="letter_<?cs name:letter ?>"><?cs name:letter ?></h2>
|
||||
<table class="jd-sumtable">
|
||||
<?cs set:cur_row = #0 ?>
|
||||
<?cs each:cl = letter ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:cl.since ?>" >
|
||||
<td class="jd-linkcol"><?cs call:type_link(cl.type) ?></td>
|
||||
<td class="jd-descrcol" width="100%"><?cs call:short_descr(cl) ?> </td>
|
||||
</tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
</table>
|
||||
<?cs /each ?>
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
</div><!-- end jd-content -->
|
||||
</div><!-- end doc-content -->
|
||||
|
||||
<?cs include:"trailer.cs" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,61 +1,157 @@
|
|||
<?cs def:custom_masthead() ?>
|
||||
<div id="header">
|
||||
<div id="headerLeft">
|
||||
<a href="<?cs var:toroot ?>index.html" tabindex="-1"><img
|
||||
src="<?cs var:toroot ?>assets/images/bg_logo.png" alt="Android Developers" /></a>
|
||||
<?cs include:"header_tabs.cs" ?> <?cs # The links are extracted so we can better manage localization ?>
|
||||
</div>
|
||||
<div id="headerRight">
|
||||
<div id="headerLinks">
|
||||
<?cs if:template.showLanguageMenu ?>
|
||||
<img src="<?cs var:toroot ?>assets/images/icon_world.jpg" alt="Language:" />
|
||||
<span id="language">
|
||||
<select name="language" onChange="changeLangPref(this.value, true)">
|
||||
<option value="en">English </option>
|
||||
<option value="ja">日本語</option>
|
||||
<?cs #
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="es">Español</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
<option value="zh-CN">中文 (简体)</option>
|
||||
<option value="zh-TW">中文 (繁體)</option>
|
||||
?>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
loadLangPref();
|
||||
//-->
|
||||
</script>
|
||||
</span>
|
||||
<?cs /if ?>
|
||||
<a href="<?cs var:toroot ?>design/index.html">Android Design</a>
|
||||
<a href="http://www.android.com">Android.com</a>
|
||||
</div><?cs
|
||||
call:default_search_box() ?><?cs
|
||||
if:reference ?>
|
||||
<div id="api-level-toggle">
|
||||
<input type="checkbox" id="apiLevelCheckbox" onclick="toggleApiLevelSelector(this)" />
|
||||
<label for="apiLevelCheckbox" class="disabled">Filter by API Level: </label>
|
||||
<select id="apiLevelSelector">
|
||||
<!-- option elements added by buildApiLevelSelector() -->
|
||||
</select>
|
||||
</div>
|
||||
<script>
|
||||
var SINCE_DATA = [ <?cs
|
||||
each:since = since ?>'<?cs
|
||||
var:since.name ?>'<?cs
|
||||
if:!last(since) ?>, <?cs /if ?><?cs
|
||||
/each
|
||||
?> ];
|
||||
buildApiLevelSelector();
|
||||
</script><?cs
|
||||
/if ?>
|
||||
</div><!-- headerRight -->
|
||||
<!-- Header -->
|
||||
<div id="header">
|
||||
<div class="wrap" id="header-wrap">
|
||||
<div class="col-3 logo">
|
||||
<a href="<?cs var:toroot ?>index.html">
|
||||
<img src="<?cs var:toroot ?>assets/images/dac_logo.png" width="123" height="25" alt="Android Developers" />
|
||||
</a>
|
||||
<div class="btn-quicknav" id="btn-quicknav">
|
||||
<a href="#" class="arrow-inactive">Quicknav</a>
|
||||
<a href="#" class="arrow-active">Quicknav</a>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav-x col-9">
|
||||
<li class="design"><a href="<?cs var:toroot ?>design/index.html" <?cs
|
||||
if:design ?>class="selected"<?cs /if ?> >Design</a></li>
|
||||
<li class="develop"><a href="<?cs var:toroot ?>develop/index.html" <?cs
|
||||
if:training || guide || reference || tools || develop ?>class="selected"<?cs /if ?> >Develop</a></li>
|
||||
<li class="distribute last"><a href="<?cs var:toroot ?>distribute/index.html" <?cs
|
||||
if:distribute ?>class="selected"<?cs /if ?> >Distribute</a></li>
|
||||
</ul>
|
||||
|
||||
<!-- New Search -->
|
||||
<div class="menu-container">
|
||||
<div class="moremenu">
|
||||
<div id="more-btn"></div>
|
||||
</div>
|
||||
<div class="morehover" id="moremenu">
|
||||
<div class="top"></div>
|
||||
<div class="mid">
|
||||
<div class="header">Android Sites</div>
|
||||
<ul>
|
||||
<li><a href="http://www.android.com">Android.com</a></li>
|
||||
<li class="active"><a>Android Developers</a></li>
|
||||
<li><a href="http://source.android.com">Android Open Source Project</a></li>
|
||||
</ul>
|
||||
<div class="header">Support</div>
|
||||
<ul>
|
||||
<li><a href="<?cs var:toroot ?>support.html">Developer Support</a></li>
|
||||
</ul>
|
||||
<div class="header">Languages</div>
|
||||
<div id="language" class="locales">
|
||||
<select name="language" onChange="changeLangPref(this.value, true)">
|
||||
<option value="en">English</option>
|
||||
<option value="es">Español</option>
|
||||
<option value="ja">日本語</option>
|
||||
<option value="ko">한국어</option>
|
||||
<option value="ru">Русский</option>
|
||||
<option value="zh-CN">中文 (中国)
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
changeTabLang(getLangPref());
|
||||
//-->
|
||||
loadLangPref();
|
||||
//-->
|
||||
</script>
|
||||
</div><!-- header --><?cs
|
||||
/def ?>
|
||||
<br class="clearfix" />
|
||||
</div>
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
<div class="search" id="search-container">
|
||||
<div class="search-inner">
|
||||
<div id="search-btn"></div>
|
||||
<div class="left"></div>
|
||||
<form onsubmit="return submit_search()">
|
||||
<input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
|
||||
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
|
||||
onkeydown="return search_changed(event, true, '/')" onkeyup="return search_changed(event, false,
|
||||
'/')" />
|
||||
</form>
|
||||
<div class="right"></div>
|
||||
<a class="close hide">close</a>
|
||||
<div class="left"></div>
|
||||
<div class="right"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="search_filtered_wrapper">
|
||||
<div id="search_filtered_div" class="no-display">
|
||||
<ul id="search_filtered">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /New Search>
|
||||
|
||||
|
||||
<!-- Expanded quicknav -->
|
||||
<div id="quicknav" class="col-9">
|
||||
<ul>
|
||||
<li class="design">
|
||||
<ul>
|
||||
<li><a href="<?cs var:toroot ?>design/style/index.html">Style</a></li>
|
||||
<li><a href="<?cs var:toroot ?>design/patterns/index.html">Patterns</a></li>
|
||||
<li><a href="<?cs var:toroot ?>design/building-blocks/index.html">Building Blocks</a></li>
|
||||
<li><a href="<?cs var:toroot ?>design/downloads/index.html">Downloads</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="develop">
|
||||
<ul>
|
||||
<li><a href="<?cs var:toroot ?>training/index.html">Android Training</a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/components/index.html">API Guides</a></li>
|
||||
<li><a href="<?cs var:toroot ?>reference/packages.html">Reference</a></li>
|
||||
<li><a href="<?cs var:toroot ?>tools/index.html">Tools</a>
|
||||
<ul><li><a href="<?cs var:toroot ?>sdk/index.html">Get the
|
||||
SDK</a></li></ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="distribute last">
|
||||
<ul>
|
||||
<li><a href="<?cs var:toroot ?>distribute/index.html">Google Play</a></li>
|
||||
<li><a href="<?cs var:toroot ?>distribute/googleplay/publish/index.html">Publishing</a></li>
|
||||
<li><a href="<?cs var:toroot ?>distribute/googleplay/promote/index.html">Promoting</a></li>
|
||||
<!--<li><a href="<?cs var:toroot ?>distribute/googleplay/strategies/index.html">Strategies</a></li> -->
|
||||
<li><a href="<?cs var:toroot ?>distribute/open.html">Open
|
||||
Distribution</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /Expanded quicknav -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Header -->
|
||||
|
||||
|
||||
<div id="searchResults" class="wrap" style="display:none;">
|
||||
<h2 id="searchTitle">Results</h2>
|
||||
<div id="leftSearchControl" class="search-control">Loading...</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?cs if:training || guide || reference || tools || develop ?>
|
||||
<!-- Secondary x-nav -->
|
||||
<div id="nav-x">
|
||||
<div class="wrap">
|
||||
<ul class="nav-x col-9 develop" style="width:75%">
|
||||
<li><a href="<?cs var:toroot ?>training/index.html" <?cs
|
||||
if:training ?>class="selected"<?cs /if ?> >Android Training</a></li>
|
||||
<li><a href="<?cs var:toroot ?>guide/components/index.html" <?cs
|
||||
if:guide ?>class="selected"<?cs /if ?> >API Guides</a></li>
|
||||
<li><a href="<?cs var:toroot ?>reference/packages.html" <?cs
|
||||
if:reference ?>class="selected"<?cs /if ?> >Reference</a></li>
|
||||
<li><a href="<?cs var:toroot ?>tools/index.html" <?cs
|
||||
if:tools ?>class="selected"<?cs /if ?> >Tools</a></li>
|
||||
</ul>
|
||||
<!-- <a class="button-secondary download-sdk">Download the SDK</a> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /Sendondary x-nav -->
|
||||
<?cs /if ?>
|
||||
<?cs
|
||||
/def ?>
|
||||
|
|
|
@ -1,63 +1,219 @@
|
|||
<?cs
|
||||
def:fullpage() ?>
|
||||
<div id="body-content">
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:sdk_nav() ?>
|
||||
<div class="g-section g-tpl-240" id="body-content">
|
||||
<div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav"><?cs
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/sdk/sdk_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:resources_tab_nav() ?>
|
||||
<div class="g-section g-tpl-240" id="body-content">
|
||||
<div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav"><?cs
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<a
|
||||
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/resources/resources_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
addLoadEvent(function() {
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:tools_nav() ?>
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-3" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/tools/tools_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:training_nav() ?>
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/training/training_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:guide_nav() ?>
|
||||
<div class="g-section g-tpl-240" id="body-content">
|
||||
<div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav"><?cs
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/guide/guide_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
addLoadEvent(function() {
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:design_nav() ?>
|
||||
<?cs include:"../../../../frameworks/base/docs/html/design/design_toc.cs" ?>
|
||||
<?cs /def ?>
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-3" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/design/design_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:distribute_nav() ?>
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-3" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/distribute/distribute_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:about_nav() ?>
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-3" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/about/about_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs
|
||||
def:dist_more_nav() ?>
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav" class="scroll-pane">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
|
||||
|
||||
<?cs
|
||||
include:"../../../../frameworks/base/docs/html/distribute/more/more_toc.cs" ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("devdoc-nav");
|
||||
});
|
||||
</script>
|
||||
<?cs /def ?>
|
||||
<?cs # The default side navigation for the reference docs ?><?cs
|
||||
def:default_left_nav() ?>
|
||||
<div class="g-section g-tpl-240" id="body-content">
|
||||
<div class="g-unit g-first" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div class="wrap clearfix" id="body-content">
|
||||
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div id="devdoc-nav">
|
||||
<a class="totop" href="#top" data-g-event="left-nav-top">to top</a>
|
||||
<div id="api-nav-header">
|
||||
<div id="api-level-toggle">
|
||||
<label for="apiLevelCheckbox" class="disabled">API level: </label>
|
||||
<div class="select-wrapper">
|
||||
<select id="apiLevelSelector">
|
||||
<!-- option elements added by buildApiLevelSelector() -->
|
||||
</select>
|
||||
</div>
|
||||
</div><!-- end toggle -->
|
||||
<div id="api-nav-title">Android APIs</div>
|
||||
</div><!-- end nav header -->
|
||||
<script>
|
||||
var SINCE_DATA = [ <?cs
|
||||
each:since = since ?>'<?cs
|
||||
var:since.name ?>'<?cs
|
||||
if:!last(since) ?>, <?cs /if ?><?cs
|
||||
/each
|
||||
?> ];
|
||||
buildApiLevelSelector();
|
||||
</script>
|
||||
|
||||
<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>
|
||||
<div id="packages-nav" class="scroll-pane">
|
||||
|
||||
<ul>
|
||||
<?cs call:package_link_list(docs.packages) ?>
|
||||
</ul><br/>
|
||||
</div> <!-- end packages -->
|
||||
|
||||
</div> <!-- end packages-nav -->
|
||||
</div> <!-- end resize-packages -->
|
||||
<div id="classes-nav"><?cs
|
||||
<div id="classes-nav" class="scroll-pane">
|
||||
|
||||
|
||||
<?cs
|
||||
if:subcount(class.package) ?>
|
||||
<ul>
|
||||
<?cs call:list("Interfaces", class.package.interfaces) ?>
|
||||
|
@ -75,48 +231,70 @@ def:default_left_nav() ?>
|
|||
<?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 id="nav-tree" style="display:none" class="scroll-pane">
|
||||
<div id="tree-list"></div>
|
||||
</div><!-- end nav-tree -->
|
||||
</div><!-- end swapper -->
|
||||
<div id="nav-swap">
|
||||
<a class="fullscreen">fullscreen</a>
|
||||
<a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>
|
||||
</div>
|
||||
</div> <!-- end devdoc-nav -->
|
||||
</div> <!-- end side-nav -->
|
||||
<script>
|
||||
if (!isMobile) {
|
||||
$("<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");
|
||||
<script type="text/javascript">
|
||||
// init fullscreen based on user pref
|
||||
var fullscreen = readCookie("fullscreen");
|
||||
if (fullscreen != 0) {
|
||||
if (fullscreen == "false") {
|
||||
toggleFullscreen(false);
|
||||
} else {
|
||||
toggleFullscreen(true);
|
||||
}
|
||||
}
|
||||
// init nav version for mobile
|
||||
if (isMobile) {
|
||||
swapNav(); // tree view should be used on mobile
|
||||
$('#nav-swap').hide();
|
||||
} else {
|
||||
chooseDefaultNav();
|
||||
if ($("#nav-tree").is(':visible')) {
|
||||
init_default_navtree("<?cs var:toroot ?>");
|
||||
} else {
|
||||
addLoadEvent(function() {
|
||||
scrollIntoView("packages-nav");
|
||||
scrollIntoView("classes-nav");
|
||||
});
|
||||
}
|
||||
$("#swapper").css({borderBottom:"2px solid #aaa"});
|
||||
} else {
|
||||
swapNav(); // tree view should be used on mobile
|
||||
}
|
||||
// scroll the selected page into view
|
||||
$(document).ready(function() {
|
||||
scrollIntoView("packages-nav");
|
||||
scrollIntoView("classes-nav");
|
||||
});
|
||||
</script><?cs
|
||||
/def ?>
|
||||
|
||||
<?cs
|
||||
def:custom_left_nav() ?><?cs
|
||||
if:guide ?><?cs
|
||||
def:custom_left_nav() ?><?cs
|
||||
if:fullpage ?><?cs
|
||||
call:fullpage() ?><?cs
|
||||
elif:guide ?><?cs
|
||||
call:guide_nav() ?><?cs
|
||||
elif:resources ?><?cs
|
||||
call:resources_tab_nav() ?><?cs
|
||||
elif:sdk ?><?cs
|
||||
call:sdk_nav() ?><?cs
|
||||
elif:design ?><?cs
|
||||
call:design_nav() ?><?cs
|
||||
elif:training ?><?cs
|
||||
call:training_nav() ?><?cs
|
||||
elif:tools ?><?cs
|
||||
call:tools_nav() ?><?cs
|
||||
elif:google ?><?cs
|
||||
call:dist_google_nav() ?><?cs
|
||||
elif:more ?><?cs
|
||||
call:dist_more_nav() ?><?cs
|
||||
elif:distribute ?><?cs
|
||||
call:distribute_nav() ?><?cs
|
||||
elif:about ?><?cs
|
||||
call:about_nav() ?><?cs
|
||||
else ?><?cs
|
||||
call:default_left_nav() ?><?cs
|
||||
/if ?><?cs
|
||||
|
@ -142,11 +320,9 @@ def:custom_copyright() ?>
|
|||
<?cs
|
||||
def:custom_footerlinks() ?>
|
||||
<p>
|
||||
<a href="http://www.google.com/intl/en/policies/" target="_blank">Privacy & Terms</a> -
|
||||
<a href="http://www.android.com/branding.html" target="_blank">Brand Guidelines</a> -
|
||||
<a
|
||||
href="http://code.google.com/p/android/issues/entry?template=Developer%20Documentation"
|
||||
target="_blank">Report Document Issues</a>
|
||||
<a href="<?cs var:toroot ?>about/index.html">About Android</a> |
|
||||
<a href="<?cs var:toroot ?>legal.html">Legal</a> |
|
||||
<a href="<?cs var:toroot ?>support.html">Support</a>
|
||||
</p><?cs
|
||||
/def ?>
|
||||
|
||||
|
|
|
@ -14,7 +14,12 @@
|
|||
<script>var SITE_ROOT = '<?cs var:toroot ?>design';</script>
|
||||
<script src="<?cs var:toroot ?>assets/design/default.js"></script>
|
||||
</head>
|
||||
<body itemscope itemtype="http://schema.org/Article">
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>" itemscope itemtype="http://schema.org/Article">
|
||||
<a name="top"></a>
|
||||
|
||||
<div id="page-container">
|
||||
|
||||
|
|
|
@ -2,98 +2,103 @@
|
|||
<?cs include:"macros.cs" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<body class="gc-documentation" itemscope itemtype="http://schema.org/Article">
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs if:guide ?> guide<?cs /if ?><?cs
|
||||
elif:about ?>about<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>" itemscope itemtype="http://schema.org/Article">
|
||||
<a name="top"></a>
|
||||
<?cs include:"header.cs" ?>
|
||||
|
||||
<div class="g-unit" id="doc-content"><a name="top"></a>
|
||||
<div <?cs if:fullpage
|
||||
?><?cs elif:design||tools||about||sdk||distribute
|
||||
?>class="col-13" id="doc-col"<?cs else
|
||||
?>class="col-12" id="doc-col"<?cs /if ?> >
|
||||
|
||||
<div id="jd-header" class="guide-header">
|
||||
<span class="crumb" itemprop="breadcrumb">
|
||||
<?cs if:parent.link ?>
|
||||
<a href="<?cs var:parent.link ?>"><?cs var:parent.title ?></a>:
|
||||
<?cs else ?>
|
||||
<?cs if:(design||training||walkthru) ?><?cs # header logic for docs that provide previous/next buttons ?>
|
||||
<?cs if:header.hide ?>
|
||||
<?cs else ?>
|
||||
<div class="layout-content-row content-header <?cs if:header.justLinks ?>just-links<?cs /if ?>">
|
||||
<div class="layout-content-col <?cs if:training ?>span-7<?cs else ?>span-9<?cs /if ?>">
|
||||
<?cs if:header.justLinks ?>
|
||||
<?cs else ?><h1 itemprop="name"><?cs var:page.title ?></h1>
|
||||
<?cs /if ?>
|
||||
</div>
|
||||
<?cs if:training ?>
|
||||
<div class="training-nav-top layout-content-col span-5" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<a href="#" class="prev-page-link hide">Previous</a>
|
||||
<a href="#" class="next-page-link hide">Next</a>
|
||||
<a href="#" class="start-class-link hide">Get started</a>
|
||||
<a href="#" class="start-course-link hide">First class</a>
|
||||
</div>
|
||||
<?cs else ?>
|
||||
<div class="paging-links layout-content-col span-4" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<a href="#" class="prev-page-link hide">Previous</a>
|
||||
<a href="#" class="next-page-link hide">Next</a>
|
||||
</div>
|
||||
<?cs /if ?><?cs # end if training ?>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
<?cs else ?>
|
||||
<?cs if:(!fullpage && !header.hide) ?>
|
||||
<?cs if:page.landing ?><?cs # header logic for docs that are landing pages ?>
|
||||
<div class="landing-banner">
|
||||
<div class="col-6">
|
||||
<?cs if:page.landing.image ?>
|
||||
<img src="<?cs var:toroot ?><?cs var:page.landing.image ?>" alt="" />
|
||||
<?cs /if ?>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h1 itemprop="name" style="margin-bottom:0;"><?cs var:page.title ?></h1>
|
||||
<p itemprop="description"><?cs var:page.landing.intro ?></p>
|
||||
|
||||
<p><a href="<?cs var:page.landing.next ?>" class="next-page-link">LEARN MORE</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<?cs else ?>
|
||||
<h1 itemprop="name"><?cs var:page.title ?></h1>
|
||||
<?cs /if ?>
|
||||
</span>
|
||||
<h1 itemprop="name"><?cs var:page.title ?></h1>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
<?cs /if ?><?cs # end if design ?>
|
||||
|
||||
<?cs # THIS IS THE MAIN DOC CONTENT ?>
|
||||
<div id="jd-content">
|
||||
|
||||
<?cs if:trainingnavtop ?>
|
||||
<div class="training-nav-top">
|
||||
|
||||
<?cs if:next.link ?>
|
||||
<?cs if:startpage ?>
|
||||
<div class="training-nav-button-next">
|
||||
<a href="<?cs var:next.link ?>">
|
||||
Get started
|
||||
<span style="font-size:1.2em">›</span>
|
||||
<span class="training-nav-button-title"><?cs var:next.title ?></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?cs else ?><?cs # if not startpage ?>
|
||||
|
||||
<div class="training-nav-button-next">
|
||||
<a href="<?cs var:next.link ?>">
|
||||
Next lesson
|
||||
<span style="font-size:1.2em">›</span>
|
||||
<span class="training-nav-button-title"><?cs var:next.title ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?cs /if ?><?cs # end if/else startpage ?>
|
||||
|
||||
<?cs /if ?><?cs # end if next.link ?>
|
||||
|
||||
<?cs if:previous.link ?>
|
||||
<div class="training-nav-button-previous">
|
||||
<a href="<?cs var:previous.link ?>">
|
||||
<span style="font-size:1.2em">‹</span>
|
||||
Previous lesson
|
||||
<span class="training-nav-button-title"><?cs var:previous.title ?></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?cs /if ?><?cs # end if previous.link ?>
|
||||
|
||||
</div><!-- end training-nav-top -->
|
||||
<?cs /if ?><?cs # end if trainingnavtop ?>
|
||||
|
||||
|
||||
<div class="jd-descr" itemprop="articleBody">
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
</div>
|
||||
|
||||
<?cs if:!startpage && (previous.link || next.link) ?>
|
||||
<div class="training-nav-bottom">
|
||||
<?cs if:next.link ?>
|
||||
<div class="training-nav-button-next">
|
||||
<a href="<?cs var:next.link ?>">
|
||||
Next lesson
|
||||
<span style="font-size:1.2em">›</span>
|
||||
<br/><span class="training-nav-button-title"><?cs var:next.title ?></span>
|
||||
</a>
|
||||
|
||||
<div class="content-footer <?cs
|
||||
if:fullpage ?>wrap<?cs
|
||||
else ?>layout-content-row<?cs /if ?>"
|
||||
itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<div class="layout-content-col <?cs
|
||||
if:fullpage ?>col-16<?cs
|
||||
elif:training||guide ?>col-8<?cs
|
||||
else ?>col-9<?cs /if ?>" style="padding-top:4px">
|
||||
<?cs if:!page.noplus ?><?cs if:fullpage ?><style>#___plusone_0 {float:right !important;}</style><?cs /if ?>
|
||||
<div class="g-plusone" data-size="medium"></div>
|
||||
<?cs /if ?>
|
||||
</div>
|
||||
<?cs if:!fullscreen ?>
|
||||
<div class="paging-links layout-content-col col-4">
|
||||
<?cs if:(design||training||guide||walkthru) && !page.landing && !footer.hide ?>
|
||||
<a href="#" class="prev-page-link hide">Previous</a>
|
||||
<a href="#" class="next-page-link hide">Next</a>
|
||||
<?cs /if ?>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
</div>
|
||||
|
||||
<?cs # for training classes, provide a different kind of link when the next page is a different class ?>
|
||||
<?cs if:training ?>
|
||||
<div class="layout-content-row content-footer next-class" style="display:none" itemscope itemtype="http://schema.org/SiteNavigationElement">
|
||||
<a href="#" class="next-class-link hide">Next class: </a>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:previous.link ?>
|
||||
<div class="training-nav-button-previous">
|
||||
<a href="<?cs var:previous.link ?>">
|
||||
<span style="font-size:1.2em">‹</span>
|
||||
Previous lesson
|
||||
<br/><span class="training-nav-button-title"><?cs var:previous.title ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
</div> <!-- end training-nav -->
|
||||
<?cs /if ?>
|
||||
|
||||
<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> <!-- end jd-content -->
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div id="footer">
|
||||
|
||||
<div id="footer" class="wrap" <?cs if:fullpage ?>style="width:940px"<?cs /if ?>>
|
||||
|
||||
<?cs if:reference||guide ?>
|
||||
<div id="copyright">
|
||||
<?cs call:custom_copyright() ?>
|
||||
|
@ -12,8 +12,9 @@
|
|||
<?cs call:custom_cc_copyright() ?>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
<?cs if:!no_footer_links ?>
|
||||
<div id="footerlinks">
|
||||
<?cs call:custom_footerlinks() ?>
|
||||
</div>
|
||||
|
||||
</div> <!-- end footer -->
|
||||
<?cs /if ?>
|
||||
</div> <!-- end footer -->
|
|
@ -7,34 +7,57 @@
|
|||
<title><?cs
|
||||
if:page.title ?><?cs
|
||||
var:page.title ?> | <?cs
|
||||
/if ?>Android Developers</title><?cs
|
||||
if:guide||sdk||resources ?>
|
||||
<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" type="text/javascript"></script>
|
||||
<script src="<?cs var:toroot ?>assets/jquery-resizable.min.js" type="text/javascript"></script>
|
||||
<script src="<?cs var:toroot ?>assets/android-developer-docs.js" type="text/javascript"></script>
|
||||
<script src="<?cs var:toroot ?>assets/prettify.js" type="text/javascript"></script>
|
||||
/if ?>Android Developers</title>
|
||||
|
||||
<!-- BASIC STYLESHEETS -->
|
||||
<link rel="stylesheet"
|
||||
href="//fonts.googleapis.com/css?family=Roboto:regular,medium,thin,italic,mediumitalic,bold" title="roboto">
|
||||
<link href="<?cs var:toroot ?>assets/css/default.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<?cs if:reference ?>
|
||||
<!-- alternative FULLSCREEN styles -->
|
||||
<link href="<?cs var:toroot ?>assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
|
||||
type="text/css">
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:carousel ?>
|
||||
<!-- homepage carousel -->
|
||||
<link href="<?cs var:toroot ?>assets/css/home.css" rel="stylesheet" type="text/css">
|
||||
<?cs /if ?>
|
||||
|
||||
<!-- BASIC JAVASCRIPT -->
|
||||
<script src="<?cs var:toroot ?>assets/js/global-libraries-combined.js"
|
||||
type="text/javascript"></script>
|
||||
<script src="<?cs var:toroot ?>assets/js/docs.js" type="text/javascript"></script>
|
||||
|
||||
<?cs if:carousel ?>
|
||||
<!-- homepage carousel -->
|
||||
<script type="text/javascript" src="<?cs var:toroot ?>assets/js/carousel.js"></script>
|
||||
<?cs /if ?>
|
||||
|
||||
<!-- search -->
|
||||
<script src="//www.google.com/jsapi" type="text/javascript"></script>
|
||||
<script src="<?cs var:toroot ?>assets/js/search_autocomplete.js" type="text/javascript"></script>
|
||||
|
||||
<?cs if:tabbedList ?>
|
||||
<!-- tabbed lists -->
|
||||
<script src="<?cs var:toroot ?>assets/js/tabbedlist.js" type="text/javascript"></script>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs if:reference ?>
|
||||
<script src="<?cs var:toroot ?>assets/js/droiddoc.js" type="text/javascript"></script>
|
||||
<?cs /if ?>
|
||||
<script src="<?cs var:toroot ?>navtree_data.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
setToRoot("<?cs var:toroot ?>");
|
||||
</script><?cs
|
||||
if:reference ?>
|
||||
<script src="<?cs var:toroot ?>assets/android-developer-reference.js" type="text/javascript"></script>
|
||||
<script src="<?cs var:toroot ?>navtree_data.js" type="text/javascript"></script><?cs
|
||||
/if ?><?cs
|
||||
if:resources ?>
|
||||
<script src="<?cs var:toroot ?>resources/resources-data.js" type="text/javascript"></script><?cs
|
||||
/if ?>
|
||||
<noscript>
|
||||
<style type="text/css">
|
||||
html,body{overflow:auto;}
|
||||
#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>
|
||||
var basePath = getBaseUri(location.pathname);
|
||||
var SITE_ROOT = toRoot + basePath.substring(1,basePath.indexOf("/",1));
|
||||
</script>
|
||||
|
||||
<script src="//www.google.com/js/gweb/analytics/autotrack.js"></script>
|
||||
<script>
|
||||
new gweb.analytics.AutoTrack({
|
||||
profile: 'UA-5831155-1'
|
||||
});
|
||||
</script>
|
||||
</head>
|
|
@ -0,0 +1,3 @@
|
|||
<?cs call:custom_masthead() ?>
|
||||
<?cs call:custom_left_nav() ?>
|
||||
|
|
@ -1,31 +1,38 @@
|
|||
|
||||
<!-- CURRENTLY NOT USED... ALL TABS ARE IN masthead.cs -->
|
||||
|
||||
<ul id="header-tabs" class="<?cs
|
||||
if:reference ?>reference<?cs
|
||||
elif:guide ?>guide<?cs
|
||||
elif:sdk ?>sdk<?cs
|
||||
elif:home ?>home<?cs
|
||||
elif:resources ?>resources<?cs
|
||||
elif:training ?>training<?cs
|
||||
elif:tools ?>tools<?cs
|
||||
elif:videos ?>videos<?cs /if ?>">
|
||||
|
||||
<li id="home-link"><a href="<?cs var:toroot ?><?cs
|
||||
if:android.whichdoc != "online" ?>offline.html<?cs
|
||||
else ?>index.html<?cs /if ?>">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Home</span>
|
||||
<span style="display:none" class="de">Startseite</span>
|
||||
<span style="display:none" class="es"></span>
|
||||
<span style="display:none" class="fr"></span>
|
||||
<span style="display:none" class="it"></span>
|
||||
<span style="display:none" class="ja">ホーム</span>
|
||||
<span style="display:none" class="zh-CN">主页</span>
|
||||
<span style="display:none" class="zh-TW">首頁</span>
|
||||
<?cs /if ?>
|
||||
<li id="sdk-link"><a href="<?cs var:toroot ?>design/index.html">
|
||||
<span class="en">Design</span>
|
||||
</a></li>
|
||||
<li id="sdk-link"><a href="<?cs var:toroot ?>sdk/index.html">
|
||||
<span class="en">SDK</span>
|
||||
<li id="sdk-link"><a href="<?cs var:toroot ?>develop/index.html">
|
||||
<span class="en">Develop</span>
|
||||
</a></li>
|
||||
<li id="sdk-link"><a href="<?cs var:toroot ?>distribute/index.html">
|
||||
<span class="en">Distribute</span>
|
||||
</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<li id="guide-link"><a href="<?cs var:toroot ?>guide/index.html" onClick="return loadLast('guide')">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Dev Guide</span>
|
||||
<span class="en">Guide</span>
|
||||
<span style="display:none" class="de">Handbuch</span>
|
||||
<span style="display:none" class="es">Guía</span>
|
||||
<span style="display:none" class="fr">Guide</span>
|
||||
|
@ -35,54 +42,8 @@
|
|||
<span style="display:none" class="zh-TW">開發指南</span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
<li id="reference-link"><a href="<?cs var:toroot ?>reference/packages.html" onClick="return loadLast('reference')">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Reference</span>
|
||||
<span style="display:none" class="de">Referenz</span>
|
||||
<span style="display:none" class="es">Referencia</span>
|
||||
<span style="display:none" class="fr">Référence</span>
|
||||
<span style="display:none" class="it">Riferimento</span>
|
||||
<span style="display:none" class="ja">リファレンス</span>
|
||||
<span style="display:none" class="zh-CN">参考</span>
|
||||
<span style="display:none" class="zh-TW">參考資料</span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
<li id="resources-link"><a href="<?cs var:toroot ?>resources/index.html" onClick="return loadLast('resources')">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Resources</span>
|
||||
<span style="display:none" class="de"></span>
|
||||
<span style="display:none" class="es"></span>
|
||||
<span style="display:none" class="fr"></span>
|
||||
<span style="display:none" class="it"></span>
|
||||
<span style="display:none" class="ja"></span>
|
||||
<span style="display:none" class="zh-CN"></span>
|
||||
<span style="display:none" class="zh-TW"></span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
<li id="videos-link"><a href="<?cs var:toroot ?>videos/index.html" onClick="return loadLast('videos')">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Videos</span>
|
||||
<span style="display:none" class="de"></span>
|
||||
<span style="display:none" class="es"></span>
|
||||
<span style="display:none" class="fr"></span>
|
||||
<span style="display:none" class="it"></span>
|
||||
<span style="display:none" class="ja">ビデオ</span>
|
||||
<span style="display:none" class="zh-CN"></span>
|
||||
<span style="display:none" class="zh-TW"></span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
<li><a href="http://android-developers.blogspot.com" onClick="return requestAppendHL(this.href)">
|
||||
<?cs if:!sdk.redirect ?>
|
||||
<span class="en">Blog</span>
|
||||
<span style="display:none" class="de"></span>
|
||||
<span style="display:none" class="es"></span>
|
||||
<span style="display:none" class="fr"></span>
|
||||
<span style="display:none" class="it"></span>
|
||||
<span style="display:none" class="ja">ブログ</span>
|
||||
<span style="display:none" class="zh-CN">博客</span>
|
||||
<span style="display:none" class="zh-TW">網誌</span>
|
||||
<?cs /if ?>
|
||||
</a></li>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>" itemscope itemtype="http://schema.org/Article">
|
||||
<a name="top"></a>
|
||||
<?cs call:custom_masthead() ?>
|
||||
|
||||
<div id="body-content">
|
||||
<div id="doc-content" style="position:relative;">
|
||||
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
</div><!-- end doc-content -->
|
||||
|
||||
<?cs include:"trailer.cs" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>">
|
||||
<div id="doc-api-level" class="<?cs var:class.since ?>" style="display:none"></div>
|
||||
<a name="top"></a>
|
||||
<?cs include:"header.cs" ?>
|
||||
|
||||
<div class="col-12" id="doc-col">
|
||||
|
||||
<div id="api-info-block">
|
||||
<div class="api-level">
|
||||
<?cs call:since_tags(package) ?>
|
||||
<?cs call:federated_refs(package) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="jd-header">
|
||||
package
|
||||
<h1><?cs var:package.name ?></h1>
|
||||
</div><!-- end header -->
|
||||
|
||||
<div id="naMessage"></div>
|
||||
|
||||
<div id="jd-content" class="api apilevel-<?cs var:package.since ?>">
|
||||
|
||||
<?cs if:subcount(package.descr) ?>
|
||||
<div class="jd-descr">
|
||||
<?cs call:tag_list(package.descr) ?>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs def:class_table(label, classes) ?>
|
||||
<?cs if:subcount(classes) ?>
|
||||
<h2><?cs var:label ?></h2>
|
||||
<div class="jd-sumtable">
|
||||
<?cs call:class_link_table(classes) ?>
|
||||
</div>
|
||||
<?cs /if ?>
|
||||
<?cs /def ?>
|
||||
|
||||
<?cs call:class_table("Interfaces", package.interfaces) ?>
|
||||
<?cs call:class_table("Classes", package.classes) ?>
|
||||
<?cs call:class_table("Enums", package.enums) ?>
|
||||
<?cs call:class_table("Exceptions", package.exceptions) ?>
|
||||
<?cs call:class_table("Errors", package.errors) ?>
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
</div><!-- end jd-content -->
|
||||
</div><!-- doc-content -->
|
||||
|
||||
<?cs include:"trailer.cs" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,43 @@
|
|||
<?cs include:"doctype.cs" ?>
|
||||
<?cs include:"macros.cs" ?>
|
||||
<html>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>">
|
||||
<a name="top"></a>
|
||||
<?cs include:"header.cs" ?>
|
||||
|
||||
<div class="col-12" id="doc-col">
|
||||
|
||||
<div id="jd-header">
|
||||
<h1><?cs var:page.title ?></h1>
|
||||
</div>
|
||||
|
||||
<div id="jd-content">
|
||||
|
||||
<div class="jd-descr">
|
||||
<p><?cs call:tag_list(root.descr) ?></p>
|
||||
</div>
|
||||
|
||||
<?cs set:count = #1 ?>
|
||||
<table class="jd-sumtable">
|
||||
<?cs each:pkg = docs.packages ?>
|
||||
<tr class="<?cs if:count % #2 ?>alt-color<?cs /if ?> api apilevel-<?cs var:pkg.since ?>" >
|
||||
<td class="jd-linkcol"><?cs call:package_link(pkg) ?></td>
|
||||
<td class="jd-descrcol" width="100%"><?cs call:tag_list(pkg.shortDescr) ?></td>
|
||||
</tr>
|
||||
<?cs set:count = count + #1 ?>
|
||||
<?cs /each ?>
|
||||
</table>
|
||||
|
||||
<?cs include:"footer.cs" ?>
|
||||
</div><!-- end jd-content -->
|
||||
</div> <!-- end doc-content -->
|
||||
|
||||
<?cs include:"trailer.cs" ?>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -12,11 +12,18 @@
|
|||
<?cs else ?>
|
||||
<?cs include:"head_tag.cs" ?>
|
||||
<?cs /if ?>
|
||||
<body class="gc-documentation" itemscope itemtype="http://schema.org/CreativeWork">
|
||||
<a name="top"></a>
|
||||
<?cs call:custom_masthead() ?>
|
||||
<body class="gc-documentation
|
||||
<?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
|
||||
elif:design ?>design<?cs
|
||||
elif:distribute ?>distribute<?cs
|
||||
/if ?>" itemscope itemtype="http://schema.org/CreativeWork">
|
||||
<a name="top"></a>
|
||||
<?cs include:"header.cs" ?>
|
||||
|
||||
<?cs call:sdk_nav() ?>
|
||||
|
||||
<div <?cs if:fullpage
|
||||
?><?cs else
|
||||
?>class="col-13" id="doc-col"<?cs /if ?> >
|
||||
|
||||
<?cs if:sdk.redirect ?>
|
||||
|
||||
|
@ -39,13 +46,9 @@
|
|||
#
|
||||
?>
|
||||
|
||||
<div class="g-unit" id="doc-content" >
|
||||
<div id="jd-header" class="guide-header" >
|
||||
<span class="crumb"> </span>
|
||||
<h1 itemprop="name"><?cs if:android.whichdoc == "online" ?>Download the <?cs /if ?><?cs
|
||||
var:page.title ?></h1>
|
||||
</div>
|
||||
|
||||
<?cs if:header.hide ?><?cs else ?>
|
||||
<h1 itemprop="name"><?cs var:page.title ?></h1>
|
||||
<?cs /if ?>
|
||||
<div id="jd-content" itemprop="description">
|
||||
|
||||
<?cs if:sdk.not_latest_version ?>
|
||||
|
@ -73,26 +76,6 @@ var:page.title ?></h1>
|
|||
#
|
||||
?>
|
||||
|
||||
<p>The Android NDK is a companion tool to the Android SDK that lets you build
|
||||
performance-critical portions of your apps in native code. It provides headers and
|
||||
libraries that allow you to build activities, handle user input, use hardware sensors,
|
||||
access application resources, and more, when programming in C or C++. If you write
|
||||
native code, your applications are still packaged into an .apk file and they still run
|
||||
inside of a virtual machine on the device. The fundamental Android application model
|
||||
does not change.</p>
|
||||
|
||||
<p>Using native code does not result in an automatic performance increase,
|
||||
but always increases application complexity. If you have not run into any limitations
|
||||
using the Android framework APIs, you probably do not need the NDK. Read <a
|
||||
href="<?cs var:toroot ?>sdk/ndk/overview.html">What is the NDK?</a> for more information about what
|
||||
the NDK offers and whether it will be useful to you.
|
||||
</p>
|
||||
<p>
|
||||
The NDK is designed for use <em>only</em> in conjunction with the
|
||||
Android SDK. If you have not already installed and setup the <a
|
||||
href="http://developer.android.com/sdk/index.html">Android SDK</a>, please
|
||||
do so before downloading the NDK.
|
||||
</p>
|
||||
|
||||
<table class="download">
|
||||
<tr>
|
||||
|
@ -126,6 +109,9 @@ do so before downloading the NDK.
|
|||
<td><?cs var:ndk.linux_checksum ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?cs ######## HERE IS THE JD DOC CONTENT ######### ?>
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
|
||||
<?cs else ?>
|
||||
<?cs # end if NDK ...
|
||||
|
@ -145,14 +131,12 @@ do so before downloading the NDK.
|
|||
?>
|
||||
<?cs if:android.whichdoc == "online" ?>
|
||||
|
||||
<p>Welcome Developers! If you are new to the Android SDK, please read the steps below, for an
|
||||
overview of how to set up the SDK. </p>
|
||||
|
||||
<p>If you're already using the Android SDK, you should
|
||||
update to the latest tools or platform using the <em>Android SDK and AVD Manager</em>, rather than
|
||||
downloading a new SDK starter package. See <a
|
||||
href="<?cs var:toroot ?>sdk/adding-components.html">Adding SDK Components</a>.</p>
|
||||
<?cs ######## HERE IS THE JD DOC CONTENT FOR ONLINE ######### ?>
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="pax col-13 online" style="display:none">
|
||||
<table class="download">
|
||||
<tr>
|
||||
<th>Platform</th>
|
||||
|
@ -172,7 +156,8 @@ href="<?cs var:toroot ?>sdk/adding-components.html">Adding SDK Components</a>.</
|
|||
<tr>
|
||||
<!-- blank TD from Windows rowspan -->
|
||||
<td>
|
||||
<a onclick="onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_installer
|
||||
<a onclick="onDownload(this)" id="win-sdk" href="http://dl.google.com/android/<?cs
|
||||
var:sdk.win_installer
|
||||
?>"><?cs var:sdk.win_installer ?></a> (Recommended)
|
||||
</td>
|
||||
<td><?cs var:sdk.win_installer_bytes ?> bytes</td>
|
||||
|
@ -181,7 +166,8 @@ href="<?cs var:toroot ?>sdk/adding-components.html">Adding SDK Components</a>.</
|
|||
<tr class="alt-color">
|
||||
<td>Mac OS X (intel)</td>
|
||||
<td>
|
||||
<a onclick="onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.mac_download
|
||||
<a onclick="onDownload(this)" id="mac-sdk" href="http://dl.google.com/android/<?cs
|
||||
var:sdk.mac_download
|
||||
?>"><?cs var:sdk.mac_download ?></a>
|
||||
</td>
|
||||
<td><?cs var:sdk.mac_bytes ?> bytes</td>
|
||||
|
@ -190,26 +176,52 @@ href="<?cs var:toroot ?>sdk/adding-components.html">Adding SDK Components</a>.</
|
|||
<tr>
|
||||
<td>Linux (i386)</td>
|
||||
<td>
|
||||
<a onclick="onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.linux_download
|
||||
<a onclick="onDownload(this)" id="linux-sdk" href="http://dl.google.com/android/<?cs
|
||||
var:sdk.linux_download
|
||||
?>"><?cs var:sdk.linux_download ?></a>
|
||||
</td>
|
||||
<td><?cs var:sdk.linux_bytes ?> bytes</td>
|
||||
<td><?cs var:sdk.linux_checksum ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<script>
|
||||
function onDownload(link) {
|
||||
$("#filename").text($(link).html());
|
||||
$("#next-steps").fadeIn('slow');
|
||||
$("#intro").fadeOut('slow');
|
||||
$('.pax').slideUp();
|
||||
$('.reqs').slideUp();
|
||||
}
|
||||
|
||||
|
||||
var os;
|
||||
var $link;
|
||||
if (navigator.appVersion.indexOf("Win")!=-1) {
|
||||
os = "Windows";
|
||||
$link = $('#win-sdk');
|
||||
} else if (navigator.appVersion.indexOf("Mac")!=-1) {
|
||||
os = "Mac";
|
||||
$link = $('#mac-sdk');
|
||||
} else if (navigator.appVersion.indexOf("Linux")!=-1) {
|
||||
os = "Linux";
|
||||
$link = $('#linux-sdk');
|
||||
}
|
||||
|
||||
if (os) {
|
||||
$('#download-button').text("Download the SDK for " + os).removeClass("disabled");
|
||||
$('#download-button').click(function() {onDownload($link.get());}).attr('href', $link.attr('href'));
|
||||
} else {
|
||||
$('.pax').show();
|
||||
$('#download-button').css({'font-size':'14px'});
|
||||
}
|
||||
|
||||
<div id="next-steps" style="display:none">
|
||||
<p><b><em><span id="filename"></span></em> is now downloading. Follow the steps below to
|
||||
get started.</b></p>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function onDownload(link) {
|
||||
$("#filename").text($(link).html());
|
||||
$("#next-steps").show();
|
||||
}
|
||||
</script>
|
||||
|
||||
</div><!-- end pax -->
|
||||
</div><!-- end wrap -->
|
||||
|
||||
<?cs else ?> <?cs # end if online ?>
|
||||
|
||||
<?cs if:sdk.preview ?><?cs # it's preview offline docs ?>
|
||||
|
@ -225,10 +237,16 @@ function onDownload(link) {
|
|||
</style>
|
||||
|
||||
<?cs else ?><?cs # it's normal offline docs ?>
|
||||
|
||||
<?cs ######## HERE IS THE JD DOC CONTENT FOR OFFLINE ######### ?>
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
<style type="text/css">
|
||||
p.offline-message { display:block; }
|
||||
p.online-message { display:none; }
|
||||
</style>
|
||||
body .offline { display:block; }
|
||||
body .online { display:none; }
|
||||
</style>
|
||||
<script>
|
||||
$('.reqs').show();
|
||||
</script>
|
||||
<?cs /if ?>
|
||||
|
||||
<?cs /if ?> <?cs # end if/else online ?>
|
||||
|
@ -237,7 +255,6 @@ function onDownload(link) {
|
|||
|
||||
<?cs /if ?> <?cs # end if/else redirect ?>
|
||||
|
||||
<?cs call:tag_list(root.descr) ?>
|
||||
|
||||
</div><!-- end jd-content -->
|
||||
|
||||
|
|
|
@ -1,11 +1,49 @@
|
|||
</div> <!-- end body-content --> <?cs # normally opened by header.cs ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Grid - for dev
|
||||
<script type="text/javascript">
|
||||
|
||||
window.gOverride = {
|
||||
gColor: '#FF0000',
|
||||
pColor: '#EEEEEE',
|
||||
gOpacity: 0.10,
|
||||
pOpacity: 0.40,
|
||||
pHeight: 16,
|
||||
pOffset: 2,
|
||||
gColumns:16,
|
||||
gEnabled:false,
|
||||
pEnabled:false
|
||||
}
|
||||
</script>
|
||||
|
||||
<link href="<?cs var:toroot ?>assets/js/grid/960.gridder.css" rel="stylesheet" type="text/css">
|
||||
<script src="<?cs var:toroot ?>assets/js/grid/960.gridder.js" type="text/javascript"></script>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<?cs if:carousel ?>
|
||||
<script type="text/javascript">
|
||||
$('.slideshow-container').dacSlideshow({
|
||||
btnPrev: '.slideshow-prev',
|
||||
btnNext: '.slideshow-next'
|
||||
});
|
||||
</script>
|
||||
<?cs /if ?>
|
||||
<?cs if:tabbedList ?>
|
||||
<script type="text/javascript">
|
||||
$(".feed").dacTabbedList({
|
||||
nav_id: '.feed-nav',
|
||||
frame_id: '.feed-frame'
|
||||
});
|
||||
</script>
|
||||
<?cs /if ?>
|
||||
<script type="text/javascript">
|
||||
init(); /* initialize android-developer-docs.js */
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var pageTracker = _gat._getTracker("UA-5831155-1");
|
||||
pageTracker._trackPageview();
|
||||
</script>
|
||||
|
||||
|
|