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