Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  *
0009  *    http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /* Dynamically injected post-processing code for the API docs */
0019 
0020 $(document).ready(function() {
0021   addBadges(":: AlphaComponent ::", '<span class="alphaComponent badge">Alpha Component</span>');
0022   addBadges(":: DeveloperApi ::", '<span class="developer badge">Developer API</span>');
0023   addBadges(":: Experimental ::", '<span class="experimental badge">Experimental</span>');
0024 });
0025 
0026 function addBadges(tag, html) {
0027   var tags = $(".block:contains(" + tag + ")")
0028 
0029   // Remove identifier tags
0030   tags.each(function(index) {
0031     var oldHTML = $(this).html();
0032     var newHTML = oldHTML.replace(tag, "");
0033     $(this).html(newHTML);
0034   });
0035 
0036   // Add html badge tags
0037   tags.each(function(index) {
0038     if ($(this).parent().is('td.colLast')) {
0039       $(this).parent().prepend(html);
0040     } else if ($(this).parent('li.blockList')
0041                       .parent('ul.blockList')
0042                       .parent('div.description')
0043                       .parent().is('div.contentContainer')) {
0044       var contentContainer = $(this).parent('li.blockList')
0045                                     .parent('ul.blockList')
0046                                     .parent('div.description')
0047                                     .parent('div.contentContainer')
0048       var header = contentContainer.prev('div.header');
0049       if (header.length > 0) {
0050         header.prepend(html);
0051       } else {
0052         contentContainer.prepend(html);
0053       }
0054     } else if ($(this).parent().is('li.blockList')) {
0055       $(this).parent().prepend(html);
0056     } else {
0057       $(this).prepend(html);
0058     }
0059   });
0060 }