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   var annotations = $("dt:contains('Annotations')").next("dd").children("span.name");
0022   addBadges(annotations, "AlphaComponent", ":: AlphaComponent ::", '<span class="alphaComponent badge">Alpha Component</span>');
0023   addBadges(annotations, "DeveloperApi", ":: DeveloperApi ::", '<span class="developer badge">Developer API</span>');
0024   addBadges(annotations, "Experimental", ":: Experimental ::", '<span class="experimental badge">Experimental</span>');
0025 });
0026 
0027 function addBadges(allAnnotations, name, tag, html) {
0028   var annotations = allAnnotations.filter(":contains('" + name + "')")
0029   var tags = $(".cmt:contains(" + tag + ")")
0030 
0031   // Remove identifier tags from comments
0032   tags.each(function(index) {
0033     var oldHTML = $(this).html();
0034     var newHTML = oldHTML.replace(tag, "");
0035     $(this).html(newHTML);
0036   });
0037 
0038   // Add badges to all containers
0039   tags.prevAll("h4.signature")
0040     .add(annotations.closest("div.fullcommenttop"))
0041     .add(annotations.closest("div.fullcomment").prevAll("h4.signature"))
0042     .prepend(html);
0043 }
0044 
0045 $(document).ready(function() {
0046   var script = document.createElement('script');
0047   script.type = 'text/javascript';
0048   script.async = true;
0049   script.onload = function(){
0050     MathJax.Hub.Config({
0051       displayAlign: "left",
0052       tex2jax: {
0053         inlineMath: [ ["$", "$"], ["\\(","\\)"] ],
0054         displayMath: [ ["$$","$$"], ["\\[", "\\]"] ],
0055         processEscapes: true,
0056         skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'a']
0057       }
0058     });
0059   };
0060   script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
0061                 'cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js' +
0062                 '?config=TeX-AMS-MML_HTMLorMML';
0063   document.getElementsByTagName('head')[0].appendChild(script);
0064 });