utils.js revision 1342
1187N/A * The contents of this file are subject to the terms of the 1187N/A * Common Development and Distribution License (the "License"). 1187N/A * You may not use this file except in compliance with the License. 1187N/A * language governing permissions and limitations under the License. 1187N/A * When distributing Covered Code, include this CDDL HEADER in each 1187N/A * If applicable, add the following below this CDDL HEADER, with the 1187N/A * fields enclosed by brackets "[]" replaced with your own identifying 1187N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1187N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 1187N/A * Portions Copyright 2011 Jens Elkner. 1187N/A * Resize the element with the ID 'content' so that it fills the whole browser 1187N/A * window (i.e. the space between the header and the bottom of the window) and 1281N/A * thus get rid off the scrollbar in the page header. 1281N/A if (h !=
null && h !=
"null") {
1281N/A if ($(
'#whole_header') !=
null && $(
'#content') !=
null) {
1281N/A $("#project").autocomplete(projects, { 1281N/A formatItem: function(row, i, max) { 1281N/A return (row != null) ? i + "/" + max + ": " + row[0] : ""; 1281N/A formatMatch: function(row, i, max) { 1281N/A return (row != null) ? row[0] : ""; 1281N/A formatResult: function(row) { 1281N/A return (row != null) ? row[0] : ""; 1281N/A // var p = document.getElementById('project'); 1281N/A // p.setAttribute("autocomplete", "off"); 1281N/A // start state should ALWAYS be: first row: r1 hidden, r2 checked ; 1187N/A // second row: r1 clicked, (r2 hidden)(optionally) 1281N/A // I cannot say what will happen if they are not like that, togglediffs 1187N/A/* ------ Navigation window for definitions ------ */ 1187N/A * Create the Navigation toggle link as well as its contents. 1281N/A // var contents = "<input id=\"input_highlight\" name=\"input_highlight\" 1281N/A // contents += " "; 1281N/A // contents += "<b><a href=\"#\" onclick=\"javascript:add_highlight();return 1281N/A // false;\" title=\"Add highlight\">Highlight</a></b><br/>"; 1281N/A "<a href=\"#\" onclick=\"javascript:lsttoggle();\">[Close]</a><br/>" 1187N/A * Toggle the display of the 'Navigation' window used to highlight definitions. 1187N/A * Toggle the display of line numbers. 1187N/A/* ------ Highlighting ------ */ 1187N/A * An expensive Highlighter: 1187N/A * Note: It will replace link's href contents as well, be careful. 1281N/Afunction HighlightKeywordsFullText(keywords) { 1281N/A var pattern = new RegExp("("+this+")", ["gi"]); 1281N/A var rs = "<span style='background-color:#FFFF00;font-weight:bold;'" 1281N/A // HighlightKeywordsFullText(["nfstcpsock"]); 1187N/A * Highlight keywords by changeing the style of matching tags. 1281N/A 'text-decoration' :
'underline',
1187N/A//Test: HighlightKeyword('timeval'); 1187N/A * Highlight the text given as value of the element with the ID "input_highlight" .