Home | History | Annotate | Download | only in js

Lines Matching refs:if

8 var isMobile = false; // true if mobile, so we can adjust some layout
24 // show lang dialog if the URL includes /intl/
25 //if (location.pathname.substring(0,6) == "/intl/") {
27 // if (lang != getLangPref()) {
42 if(jqxhr.status === 200) {
44 if(jqxhr.status === 200) {
59 if (event.which == 191) {
66 if ($(this).hasClass('disabled')) {
98 if (quicknav_open) {
131 if ($("#search_autocomplete").is(":focus")) return;
132 if ($("#search_autocomplete").val() == '') {
140 if ($("#search_autocomplete").val() == '') {
149 if (pagePath.indexOf("/intl/") == 0) {
153 if (pagePath.indexOf(SITE_ROOT) == 0) {
154 if (pagePath == '' || pagePath.charAt(pagePath.length - 1) == '/') {
162 if (SITE_ROOT.match(/\.\.\//) || SITE_ROOT == '') {
163 // If running locally, SITE_ROOT will be a relative path, so account for that by
183 if ($("body").hasClass("design")) {
188 } else if ($("body").hasClass("about")) {
190 if (rootDir == "about") {
192 } else if (rootDir == "wear") {
194 } else if (rootDir == "tv") {
196 } else if (rootDir == "auto") {
200 } else if ($("body").hasClass("develop") || $("body").hasClass("google")) {
205 if (rootDir == "training") {
207 } else if (rootDir == "guide") {
209 } else if (rootDir == "reference") {
210 // If the root is reference, but page is also part of Google Services, select Google
211 if ($("body").hasClass("google")) {
216 } else if ((rootDir == "tools") || (rootDir == "sdk")) {
218 } else if ($("body").hasClass("google")) {
220 } else if ($("body").hasClass("samples")) {
225 } else if ($("body").hasClass("distribute")) {
231 if (secondFrag == "users") {
233 } else if (secondFrag == "engage") {
235 } else if (secondFrag == "monetize") {
237 } else if (secondFrag == "analyze") {
239 } else if (secondFrag == "tools") {
241 } else if (secondFrag == "stories") {
243 } else if (secondFrag == "essentials") {
245 } else if (secondFrag == "googleplay") {
248 } else if ($("body").hasClass("about")) {
258 // set up prev/next links if they exist
261 if ($selNavLink.length) {
270 if ($prevListItem.length) {
271 if ($prevListItem.hasClass('nav-section') || crossBoundaries) {
274 } else if (!$selListItem.hasClass('nav-section')) {
279 // jump to this section's index page (if it exists)
283 // except if cross boundaries aren't allowed, and we're at the top of a section already
285 if (!crossBoundaries && $parentListItem.hasClass('nav-section')
296 if ($selListItem.hasClass('nav-section') && $selListItem.children('div.empty').length == 0) {
300 // if there aren't any children, go to the next section (required for About pages)
301 if($nextLink.length == 0) {
303 } else if ($('.topic-start-link').length) {
309 // If the selected page has a description, then it's a class or article homepage
310 if ($selListItem.find('a[description]').length) {
315 // jump to the next topic in this section (if it exists)
317 if ($nextLink.length == 0) {
321 if (!$nextLink.length) { // Go up another layer to look for next page (lesson > class > course)
323 if ($nextLink.length == 0) {
324 // if that doesn't work, we're at the end of the list, so disable NEXT link
334 if (startClass) {
337 // if there's no training bar (below the start button),
339 if (!$("#tb").length) {
342 } else if (isCrossingBoundary && !$('body.design').length) { // Design always crosses boundaries
349 if ($nextLink.length) {
362 if (!startClass && $prevLink.length) {
364 if (prevHref == SITE_ROOT + 'index.html') {
376 if ($('body.trainingcourse').length) {
384 if (typeof langDescr !== 'undefined' && langDescr !== false) {
385 // if there's a class description in the selected language, use that
409 if ($lessons.length) {
438 if ($('#side-nav').length == 0) return;
440 setNavBarLeftPos(); // do this even if sidenav isn't fixed because it could become fixed
442 if (sticky) {
443 if ((stylesheet.attr("disabled") == "disabled") || stylesheet.length == 0) {
454 if ($('#devdoc-nav').length) {
497 if (id) {
518 if ($(".scroll-pane").length > 1) {
519 // Check if there's a user preference for the panel heights
521 if (cookieHeight) {
528 // Check if there's an anchor that we need to scroll into view.
549 if (location.href.indexOf("/reference/") != -1) {
551 } else if (location.href.indexOf("/guide/") != -1) {
553 } else if (location.href.indexOf("/tools/") != -1) {
555 } else if (location.href.indexOf("/training/") != -1) {
557 } else if (location.href.indexOf("/design/") != -1) {
559 } else if (location.href.indexOf("/distribute/") != -1) {
566 if ($videoLinks.length) {
567 // if there's at least one, add the shadowbox HTML to the body
619 if (videoWidth > maxWidth) {
625 // check if we've already created this player
626 if (youTubePlayer == null) {
627 // check if there's a start time specified
630 if (idAndHash.length > 1) {
650 // if a video different from the one already playing was requested, cue it up
651 if (videoId != youTubePlayer.getVideoUrl().split('?v=')[1].split('&')[0].split('%')[0]) {
674 if (event.data == YT.PlayerState.PLAYING) {
675 if (mPlayerPaused) {
687 if (event.data == YT.PlayerState.PAUSED) {
694 if (event.data == YT.PlayerState.ENDED) {
707 if (section.hasClass('expanded')) {
742 // Add the secondary horizontal nav item, if provided
744 if ($selectedSecondNav.length) {
749 // If there's no header nav item, use the logo link and title from alt text
750 if ($selectedFirstNav.length < 1) {
762 // if something is already highlighted, undo it. This is for dynamic navigation (Samples index)
763 if ($("ul#nav li.selected").length) {
769 // If the selNavLink is still empty, look for it without the hash
770 if ($selNavLink.length == 0) {
775 if ($selNavLink.length) {
797 if (enable) {
833 if (typeof window.onload != 'function') {
844 // If a mobile phone, set flag and do mobile setup
845 if ((agent.indexOf("mobile") != -1) || // android, iphone, ipod
881 if (headerVisible) {
892 if ($scrollPanes.length > 1) {
897 if ($("#nav-tree").is(":visible")) {
904 // if the window becomes small enough to make the class panel height 0,
906 if (parseInt(classesHeight) <= 0) {
919 if (delay) {
937 // If we're scheduled for an update, but have received another resize request
940 if (updateScrollbars && updateFromResize) {
946 if (updateScrollbars && !updateFromResize) {
960 if (!api) { setTimeout(reInitScrollbars,300); return;}
1000 if ($nav.is(':visible')) {
1002 if ($selected.length == 0) {
1003 // If no selected item found, exit
1009 if (selectedOffset > $nav.height() * .8) { // multiply nav height by .8 so we move up the item
1010 // if it's more than 80% down the nav
1038 if (document.cookie) {
1040 if (index != -1) {
1043 if (valEnd == -1) {
1054 if (val==undefined) return;
1083 // Exit if there's no sidenav
1084 if ($('#side-nav').length == 0) return;
1085 // Exit if the mouse target is a DIV, because that means the event is coming
1087 if ($(event.target).nodeName == "DIV") {
1094 // ... except if the document content is shorter than the sidenav height.
1096 if ($("#doc-col").height() < $("#side-nav").height()) {
1102 if (sticky && (scrollLeft != prevScrollLeft)) {
1107 // Don't continue if the header is sufficently far away
1109 if (sticky == shouldBeSticky) {
1113 // If sticky header visible and position is now near top, hide sticky
1114 if (sticky && !shouldBeSticky) {
1129 } else if (!sticky && shouldBeSticky) {
1144 } else if (hiding && top < 15) {
1193 if (li.hasClass("closed")) {
1194 if (slide) {
1224 if($list.hasClass('showing')) {
1275 if (v != NAV_PREF_TREE) {
1283 if (nav_pref == NAV_PREF_TREE) {
1292 if (nav_pref == NAV_PREF_TREE) {
1313 if ($("#nav-tree").is(':visible')) {
1329 if (intlUrl) {
1343 if (lang) {
1358 if (lang != "en") { // No need to worry about English, because a language change invokes new request
1369 // This condition is only needed if we still need to support legacy GAE server
1370 if (devsite) {
1372 if (submit) {
1377 if (submit) {
1385 if (lang != 0) {
1392 if (!lang) {
1410 if (div.hasClass("closed")) { // if it's closed, open it
1416 } else { // if it's open, close it
1432 if($(id).is(':visible')) {
1537 if (o.pagination) {
1540 if (tl > 1) {
1544 if (i==o.start) li.addClass('active');
1555 if(o.btnPrev)
1562 if(o.btnNext)
1569 if(o.btnPause)
1572 if ($(this).hasClass('paused')) {
1580 if(o.auto) startRotateTimer();
1585 if (curr == tl-1) {
1601 if(!running) {
1603 if(to<0) {
1605 } else if (to>itemLength-1) {
1634 if(o.auto) startRotateTimer();
1722 if(!running) {
1791 if (selected) {
1835 // if there are NO results at all, hide all columns
1836 if (!(gMatches.length > 0) && !(gGoogleMatches.length > 0) && !(gDocsMatches.length > 0)) {
1841 // if there are api results
1842 if ((gMatches.length > 0) || (gGoogleMatches.length > 0)) {
1852 if (gMatches.length > 0) {
1865 if (gGoogleMatches.length > 0) {
1883 if (gDocsMatches.length > 0) {
1895 if (sugg.type == "design") {
1898 if (sugg.type == "distribute") {
1901 if (sugg.type == "samples") {
1904 if (sugg.type == "training") {
1907 if (sugg.type == "about"||"guide"||"tools"||"google") {
1918 if ($(".suggest-card.design li").length > 0) {
1924 if ($(".suggest-card.distribute li").length > 0) {
1930 if ($(".child-card.guides li").length > 0) {
1934 if ($(".child-card.training li").length > 0) {
1938 if ($(".child-card.samples li").length > 0) {
1943 if ($(".suggest-card.develop li").length > 0) {
1958 * @param kd True if the event is key-down
1960 * @returns True if the event should bubble up
1973 if (text != '') {
1979 if (e.keyCode == 27) {
1981 if (kd) $('.search .close').trigger('click');
1985 else if (e.keyCode == 13) {
1986 if (gSelectedIndex < 0) {
1988 if ($("#searchResults").is(":hidden") && (search.value != "")) {
1989 // if results aren't showing (and text not empty), return true to allow search to execute
1997 } else if (kd && gSelectedIndex >= 0) {
2003 // If Google results are showing, return true to allow ajax search to execute
2004 else if ($("#searchResults").is(":visible")) {
2005 // Also, if search_results is scrolled out of view, scroll to top to make results visible
2006 if ((sticky ) && (search.value != "")) {
2012 else if (kd && (e.keyCode == 38)) {
2013 // if the next item is a header, skip it
2014 if ($($("li", $selectedUl)[gSelectedIndex-1]).hasClass("header")) {
2017 if (gSelectedIndex >= 0) {
2021 // If user reaches top, reset selected column
2022 if (gSelectedIndex < 0) {
2029 else if (kd && (e.keyCode == 40)) {
2030 // if the next item is a header, skip it
2031 if ($($("li", $selectedUl)[gSelectedIndex+1]).hasClass("header")) {
2034 if ((gSelectedIndex < $("li", $selectedUl).length-1) ||
2044 else if (kd && $columns.length > 1 && gSelectedColumn >= 0) {
2046 // go left only if current column is not left-most column (last column)
2047 if (e.keyCode == 37 && gSelectedColumn < $columns.length - 1) {
2055 // if the corresponding item is a header, move down
2056 if ($($("li", $selectedUl)[gSelectedIndex]).hasClass("header")) {
2064 // go right only if current column is not the right-most column (first column)
2065 else if (e.keyCode == 39 && gSelectedColumn > 0) {
2073 // if the corresponding item is a header, move down
2074 if ($($("li", $selectedUl)[gSelectedIndex]).hasClass("header")) {
2083 // if key-up event and not arrow down/up/left/right,
2085 else if (!kd && (e.keyCode != 40)
2100 if (text.length != 0 &&
2115 if (text.length != 0 &&
2131 if (text.length >= 2) {
2145 // Check if query matches any tags; work backwards toward 1 to assist ranking
2148 if (s.keywords[j].toLowerCase().match(textRegex)) {
2155 if ((s.lang == currentLang) &&
2158 if (s.title.toLowerCase().match(textRegex)) {
2163 if (matched) {
2179 // Check if query matches any tags; work backwards toward 1 to assist ranking
2182 if (s.keywords[j].toLowerCase().match(textRegex)) {
2187 // Check if query matches the doc title, but only for current language
2188 if (s.lang == currentLang) {
2189 // if query matches the doc title
2190 if (s.title.toLowerCase().match(textRegex)) {
2195 if (matched) {
2211 // Check if query matches any tags; work backwards toward 1 to assist ranking
2214 if (s.keywords[j].toLowerCase().match(textRegex)) {
2219 // Check if query matches the doc title, but only for current language
2220 if (s.lang == currentLang) {
2221 // if query matches the doc title
2222 if (s.title.toLowerCase().match(textRegex)) {
2227 if (matched) {
2243 // Check if query matches any tags; work backwards toward 1 to assist ranking
2246 if (s.keywords[j].toLowerCase().match(textRegex)) {
2251 // Check if query matches the doc title, but only for current language
2252 if (s.lang == currentLang) {
2253 // if query matches the doc title
2254 if (s.title.toLowerCase().match(textRegex)) {
2259 if (matched) {
2275 // Check if query matches any tags; work backwards toward 1 to assist ranking
2278 if (s.keywords[j].toLowerCase().match(textRegex)) {
2283 // Check if query matches the doc title, but only for current language
2284 if (s.lang == currentLang) {
2285 // if query matches the doc title
2286 if (s.title.toLowerCase().match(textRegex)) {
2291 if (matched) {
2307 // Check if query matches any tags; work backwards toward 1 to assist ranking
2310 if (s.keywords[j].toLowerCase().match(textRegex)) {
2315 // Check if query matches the doc title, but only for current language
2316 if (s.lang == currentLang) {
2317 // if query matches the doc title
2318 if (s.title.toLowerCase().match(textRegex)) {
2323 if (matched) {
2339 // Check if query matches any tags; work backwards toward 1 to assist ranking
2342 if (s.keywords[j].toLowerCase().match(textRegex)) {
2347 // Check if query matches the doc title, but only for current language
2348 if (s.lang == currentLang) {
2349 // if query matches the doc title
2350 if (s.title.toLowerCase().match(textRegex)) {
2355 if (matched) {
2370 // Check if query matches any tags; work backwards toward 1 to assist ranking
2373 if (s.keywords[j].toLowerCase().match(textRegex)) {
2378 // Check if query matches the doc title, but only for current language
2379 if (s.lang == currentLang) {
2380 // if query matches the doc title.t
2381 if (s.title.toLowerCase().match(textRegex)) {
2386 if (matched) {
2405 if (!matches || !matches.length)
2411 // if the query matched a tag
2412 if (match.matched_tag > 0) {
2416 // if it also matched the title
2417 if (match.matched_title > 0) {
2420 } else if (match.matched_title > 0) {
2433 if (n == 0) // lexicographical sort if scores are the same
2442 if (!matches || !matches.length)
2446 // in the given string, or -1 if not found
2448 if (s == '')
2453 if (l < 0) l = 0;
2465 if (s.charAt(i) == c) ++n;
2482 if (t >= 0) {
2488 if (t >= 0) {
2499 // if the API is deprecated, default score is 0; otherwise, perform scoring
2500 if (matches[i].deprecated == "true") {
2509 if (n == 0) // lexicographical sort if scores are the same
2518 if ((!gMatches || !gMatches.length) && (!gGoogleMatches || !gGoogleMatches.length))
2537 if (!focused) {
2538 if(obj.value == ""){
2666 if (location.hash.indexOf("q=") == -1) {
2667 // if there's no query in the url, don't search and make sure results are hidden
2678 /* Adjust the scroll position to account for sticky header, only if the hash matches an id.
2681 // Ignore if there's no search bar (some special pages have no header)
2682 if ($("#search-container").length < 1) return;
2687 if ($matchingElement.length) {
2688 // If the position of the target element is near the top of the page (<20px, where we expect it
2690 if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) {
2698 // Ignore if there's no search bar (some special pages have no header)
2699 if ($("#search-container").length < 1) return;
2701 // If the hash isn't a search query or there's an error in the query,
2703 if ((location.hash.indexOf("q=") == -1) || (query == "undefined")) {
2704 // If the results pane is open, close it.
2705 if (!$("#searchResults").is(":hidden")) {
2788 /* Initialize some droiddoc stuff, but only if we're in the reference */
2789 if (location.pathname.indexOf("/reference") == 0) {
2790 if(!(location.pathname.indexOf("/reference-gms/packages.html") == 0)
2823 if (!sticky) return;
2834 if (!sticky) return;
2847 userApiLevel = userApiLevel == 0 ? maxLevel : userApiLevel; // If there's no cookie (zero), use the max by default
2853 if (isNaN(minLevel) && minLevel.length) {
2859 // if (SINCE_DATA[i] < minLevel) option.addClass("absent"); // always false for strings (codenames)
2877 if (selectedLevel < minLevel) {
2905 if
2910 // Handle provisional api levels; if this item's level is the provisional one, set it to the max
2913 if (isNaN(apiLevelNum)) {
2918 if (apiLevelNum > selectedLevelNum) {
2944 if (api_level != null) {
2950 if (children_data != null) {
2954 if (node.expanded) {
2978 if (link) {
2981 if (children_data != null) {
2995 if (!node.children_ul) {
3012 if (node.children_data && !node.expanded) {
3013 if (node.children_visited) {
3017 if ($(node.label_div).hasClass("absent")) {
3045 if (toroot.substr(0, 1) == "/") {
3046 if (full.substr(0, toroot.length) == toroot) {
3053 if (toroot != "./") {
3057 if (toroot.substr(toroot.length-3, 3) == "../" || toroot == "./") {
3074 if (d[1] == url) {
3077 else if (d[2] != null) {
3079 if (result != null) {
3091 if(jqxhr.status === 200) {
3120 if (me.breadcrumbs != null && me.breadcrumbs.length != 0) {
3168 if (!node.children_ul) {
3180 if(link) {
3189 if (children_data != null) {
3200 if(link) {
3219 if(linkText.match("^"+"com.google.android")=="com.google.android"){
3258 if(linkText.match("^"+"com.google.android")=="com.google.android"){
3263 if (node_data[NODE_HREF] != null) {
3271 if (node_data[NODE_CHILDREN] != null) {
3274 if (node_data[NODE_HREF] == null) $a.addClass('empty');
3306 if(jqxhr.status === 200) {
3318 if(jqxhr.status === 200) {
3334 if(jqxhr.status === 200) {
3344 if ($("#jd-content #samples").length) {
3364 if ( (expand == null && a.hasClass("closed")) || expand ) {
3370 } else if ( (expand == null && a.hasClass("opened")) || (expand == false) ) {
3389 if ( (expand == null && a.text() == "[Expand]") || expand ) {
3394 } else if ( (expand == null && a.text() == "[Collapse]") || (expand == false) ) {
3408 if (a.text() == "[Expand All]") {
3440 if (control && e.which == 70) { // 70 is "F"
3455 if (numbers.length) {
3462 if (!shifted) {
3491 if (doc.body.createTextRange) { //ms
3495 } else if (window.getSelection) { //all others
3568 if (m) {
3589 if (isFlow) {
3591 } else if (isCarousel) {
3593 } else if (isStack) {
3659 if (sections) {
3661 if (!sections[i].sections || !sections[i].sections.length) {
3685 if (opts.resourceStyle.indexOf('related') > -1) {
3692 if (opts.stackSort != 'false') {
3701 if (height < minHeight - 45) {
3724 if (opts.resourceStyle == 'generic') {
3762 if (isStack) {
3778 if (isStack) {
3780 if (++stackCount == parseInt(isStack[3])) {
3796 if (opts.section && SECTION_BY_ID[opts.section]) {
3839 if (clauses.length > 1) {
3845 if (i > 1) {
3859 if (opts.sortOrder && results.length) {
3862 if (opts.sortOrder == 'random') {
3872 if (desc) {
3921 if (!map || (!!clauses[i].negative ? map[resource.index] : !map[resource.index])) {
3930 if (url && url.indexOf('//') === -1) {
3956 if (clause.attr) {
3957 if (clause.attr.charAt(0) == '+') {
3959 } else if (clause.attr.charAt(0) == '-') {
3965 if (parts.length > 1) {
3972 if (!clauses.length) {
3994 if (resource.cta) {
3998 if (plusone) {
4019 if (imgUrl.indexOf('//') === -1) {
4052 if (section.sections && section.sections.length) {
4057 if (stack[0].resource.image) {
4062 if (stack[0].sections) {
4077 if (!plusone) {
4101 if (max < section.sections.length) {
4125 if (imgUrl.indexOf('//') === -1) {
4129 if (linkUrl && linkUrl.indexOf('//') === -1) {
4157 if ($(this).is(":visible")) {
4224 if ($content.length <= 1) {
4245 if ($(this).height() > minHeight) minHeight = $(this).height();
4337 if (!$curTab.is($toTab)) {