fbcontentpane.js

来自「proe5.0野火版下载(中文版免费下载)」· JavaScript 代码 · 共 1,698 行 · 第 1/4 页

JS
1,698
字号
/*--------------------------------------------------------------------------*\||  Module Details:||  Name:    fbcontentpane.js||  Purpose: The single javascript code file for the folder content||  History:||  Date         Release Name    Ver.    Comments|  -----------  ------- ------- ------- -------------------------------------|  04-Feb-02	J-03-19	Idan	$$01	Created from contentPane.js, fbcp.js, |					tables.js and fbcp_sysdep.js|  24-Mar-02	J-03-22	Idan	$$02	Added subtype filtering|  04-Apr-02	J-03-23	Idan	$$03	Removed table width attribute|  14-May-02	J-03-25	Idan	$$04	use filename in <a href=...>|  20-May-02	J-03-26	Idan	$$05	added SegmentedPathObj|                       Boris           changed layout; added pvx code|  18-Jun-02	J-03-28	Boris	$$06    Add PVX buttons for drawing.|			Idan		preview file prior to activating it|  04-Jul-02    J-03-30 Idan	$$07    Documentation|  25-Aug-02    J-03-32 Asaf	$$08    Support pvxSelection; Improved perf|  19-Sep-02    J-03-34 Boris   $$09    Disabled PVX on SGI|  03-Sep-02    J-03-35 Boris   $$10    Fixed strings translation.|  08-Oct-02	J-03-36	Idan	$$11	Added ColDataObj|  28-Oct-02    J-03-38 bay     $$12    Enabled PVX on SGI|  10-Nov-02    J-03-37 Boris   $$13    Added groove support|  25-Nov-02    J-03-38 Boris   $$14    Added s_activateFileTimer.|  09-Dec-02    J-03-38+Boris   $$15    Desabled s_activateFileTimer for windows|  08-Dec-02    J-03-39 Boris   $$16    Disable error dialog if PVX is not|                                       installed.|  09-Dec-02    J-03-39 Boris           Disabled s_activateFileTimer in|                                       trail replay.|  09-Dec-02    J-03-39 Boris           Updated useSheetControls()|  15-Jan-02    J-03-41 Boris   $$17    Fixed loadCB().|  15-Apr-03    K-01-05 Boris   $$18    Removed writeSegmentedPath(),|					SegmentedPathObj|                                       Updated for the new escaping in folder browser|  11-May-03    K-01-07 RSH     $$19    Added support for onPVXDoneLoading pvx callback|  16-May-03    K-01-07 mgs     $$20    Enabled gph ref-models to be previewed|  10-Jun-03    K-01-09 Boris   $$21    Fixed fbcpRowCB|                                       disabled PreviewMsg for INTRALINK|  26-Oct-03    K-01-17 LUBA    $$22    Added showOpts_data.allowVers handling|  16-Nov-03    K-01-18 Asaf    $$23    Update PVX filename parameter.|  05-Jan-04    K-01-21 Asaf    $$24    Support tooltips for long file names|  04-Mar-04    K-01-25 LUBA    $$25    Moved layoutPage() later in loadCB()|  19-Apr-04    K-03-01 Moti    $$26    Added additional unescape in fixupHrefs|  30-May-04    K-03-04 LUBA    $$27    Added file count limiting|  14-Jul-04    K-03-06 LUBA    $$28    Added wait cursor for table regeneration|  04-Dec-04    K-03-15 Moti    $$29    Added dbg_error_crash when PVX fails.|  15-Feb-05    K-03-19 LUBA    $$30    Reverted #26|  22-Aug-05    K-03-31 Moti    $$31    Single table instead of two.||  INSERT COMMENT ABOVE THIS LINE|\*--------------------------------------------------------------------------*/// --------------------------------------------------------------------------// Global variables// --------------------------------------------------------------------------var table		= null;	// The table objectvar row_data		= null;	// The array for the table's row datavar head_data		= null;	// The array for the HTML page static datavar showOpts_data	= null;	// The show options object var ImgTable		= null; // The image lookup table (for icons)var s_selectedFile	= null;	// The currently selected file objectvar gSysDep		= null;	// The system dependent objectvar s_previewTimerId	= null;	// Timer for file selection timervar s_activateFileTimer = null; // Timer for "FC_ActivateFile" commandvar s_UserClick         = true; // weather the click was initiated by pvxvar s_filename_col_width= "45%"; // The width of the file name columnvar pvxIsUp		= false;// --------------------------------------------------------------------------// Layout functions// ================// These are the assortment of functions that control the layout of the HTML// page.// --------------------------------------------------------------------------var originalHeight = -1;function setTableDivOriginalHeight(){  var div = document.getElementById("theDiv");  if (!div) return;  originalHeight = div.offsetHeight;}function GetTableExactHeight ( table ){  var bodyRows = table.getElementsByTagName("TR");  var num = bodyRows.length ;  var height = ( gSysDep.isMsie ? 6 : 32 );  for ( var i = 0 ; i < num ; i ++ )    height += bodyRows.item(i).offsetHeight + 2;/* this can be optimized1) we can save all the heights 2) we can calculate till the height we need */  return height;}function layoutPage(){  var div = document.getElementById("theDiv");  if (!div) return;  var table = document.getElementById("STDTABLE");  if (!table) return;  var tableHeight = GetTableExactHeight ( table );  var body = document.getElementById("theBody");  if (!body) return;  var h = gSysDep.getInnerHeight();  if ( originalHeight == -1)   setTableDivOriginalHeight();  var topOfPage = document.getElementById('topOfPage');    h = h-35;  if (tableHeight + topOfPage.offsetHeight > h)  {    // the table and the rest of the pgae don't fit in    if ( h > topOfPage.offsetHeight)    {      div.style.height = h - topOfPage.offsetHeight;      if ( !gSysDep.isMsie )      {	body.style.height = h - topOfPage.offsetHeight - 50 ;        body.style.overflow = '-moz-scrollbars-vertical' ;      }    }  }  else  {    div.style.height = tableHeight ;    if ( !gSysDep.isMsie )    {      body.style.height = tableHeight - 50 ;      body.style.overflow = 'hidden' ;    }  }}function resizeCB(){   layoutPage();}function loadCB(){  initElementsFromData();  clearPreview();  PVXTooolTipsInit();  fbcpDisplayDirectoryPath();  // We are using here the same logic as in  sProEFile() - we should  // display the message ( and PVX ) only for standart file system + groove.  // See bug #1020635  if ( head_data &&        (head_data.isInSession || !head_data.isStdFilesys ) )  {    setVisible('PreviewDiv', false);    setVisible('PreviewMsg', false);	  }		  layoutPage();}function clearPreview(){  if ( pvxIsUp)  {    setVisible('PvxTable', false);    setVisible('PreviewDiv', true);    setVisible('PreviewMsg', true);    pvxIsUp = false;    layoutPage();  }}// flag can be true or falsefunction setVisible(id, flag){  var pvw = document.getElementById(id);  if (pvw)    pvw.style.display = flag ? "" : "none";}function isVisible(id){  var pvw = document.getElementById(id);  if (pvw.style.display == "none")	return false;   return true;}function setFileCountVisibility( visible ){  setVisible('view_td_ID', visible);  setVisible('file_count_status_ID', visible);  setVisible('file_list_colon_ID', visible);}window.onresize = resizeCB;window.onload = loadCB;/*--------------------------------------------------------------------------*\| Function:	initElementsFromData|| Purpose:	This function initiliazes various HTML elements with the |		relevant data from fc_data.js|| Input Args:	None| Output Args:	None| Return Vals:	None\*--------------------------------------------------------------------------*/function initElementsFromData(){  setVisible('all_vers_group_id', showOpts_data.allowVers );  document.getElementById('all_vers_id').checked = showOpts_data.showVers;  document.getElementById('all_inst_id').checked = showOpts_data.showInst;  fillSelectElem('filterSpan', 'filter_id', showOpts_data.filters,		 "fillSelectElem('subfilterSpan', 'subfilter_id', showOpts_data.filters[this.selectedIndex].sub, null);"    );  if (showOpts_data.curTypeIdx != null)  {    var filter = document.getElementById('filter_id')    if (filter)      filter.selectedIndex = showOpts_data.curTypeIdx;    fillSelectElem('subfilterSpan', 'subfilter_id', 		   showOpts_data.filters[showOpts_data.curTypeIdx].sub,		   null);      }   if (showOpts_data.curSubTypeIdx != null)  {    var subfilter = document.getElementById('subfilter_id');    if (subfilter)      subfilter.selectedIndex = showOpts_data.curSubTypeIdx;  }  if (showOpts_data.isFileCountLimitEnabled)  {    setFileCountVisibility( true );    var opt = document.getElementById("limited_files_display_opt_ID");    opt.text = showOpts_data.show_partial_opt_str;    set_file_count_status();  }}/*--------------------------------------------------------------------------*\| Purpose:	Fill a Div element with a Select element, whose|		contents are taken from a FilterObj or SubFilterObj array|| Input Args:	selDiv_id - The id of the Div |		sel_id	  - the id the selection element will have|		filterArr - An array of either FilterObj or SubFilterObj |			    with which to fill the select element.|		onChangeEvent - The onchange event for the select element.\*--------------------------------------------------------------------------*/function fillSelectElem(selDiv_id, sel_id, filterArr, onChangeEvent){  var span = document.getElementById(selDiv_id);  if (span)  {    var iHtml = '';    if (filterArr)    {      iHtml = '<select id="' + sel_id + '"';       if (onChangeEvent)	iHtml += '\n\tonChange="' + onChangeEvent + '"';      iHtml += '>\n';          for (var i=0; i<filterArr.length; ++i)      {	iHtml += '<option value="' + filterArr[i].id + '">';	iHtml += filterArr[i].label + '</option>\n';      }          iHtml += '</select>';    }    span.innerHTML = iHtml;  }}function dbg_error_crash (msg , func_name){  var full_command = 'report_js_debug_info?' + func_name + '?crash?' + msg ;  ProECommandVoid ( full_command ) ;}// --------------------------------------------------------------------------// Table management functions// ==========================// --------------------------------------------------------------------------//****************************************************************************************// Global functions//****************************************************************************************function generateTable(cb_getheader, cb_gettrailer, cb_getrow){  var html = "";  if (row_data != null)  {    table = new std_table(cb_getheader, cb_gettrailer, cb_getrow);    html = table.render();  }  return html;}// specify whether file count can be trimmed to the size of the limiting parameterfunction can_limit_file_count(){  var ret = false;  if ( row_data != null )  {    ret = ( row_data.length > showOpts_data.file_count_limit );  }  return ret;}//****************************************************************************************// Table class//****************************************************************************************function std_table(cb_getheader, cb_gettrailer, cb_getrow) // constructor{  // attributes  this.id = "STDTABLE";  // data  var initial_rows = row_data.length;  // file count is limited if theres more files than initial_display_limit  // and limit flag is true - limit flag is controlled by the option menu and is on by default  if ( showOpts_data.isFileCountLimitEnabled && is_file_count_limiting_on() )  {    initial_rows = showOpts_data.file_count_limit;  }  set_file_count_status();  this.rows = new Array(initial_rows);  this.lastSelIdx = -1;	  // populate the row data  for (var i=0; i<initial_rows; i++)    this.rows[i] = new std_row(i, row_data[i]);  // callback functions  this.get_header = cb_getheader;  this.get_trailer = cb_gettrailer;  // methods  this.render = renderDOMTable;  this.getRow = cb_getrow;  this.update = updateTableDisplay;}function getDoubleClassString ( first_class ){  return (first_class + ' ' + first_class + (gSysDep.isMsie ? 'IE' : 'Moz')) ;}function renderDOMTable(){  var html = "";  // create a div for a scrollable table  html += '<div class="' + getDoubleClassString('divAutoOverflow');  html += '" id="theDiv">';  // render the table rows  html += '<table class="' + getDoubleClassString ('generictable');  html += '" id=' + this.id + '>';  // render the static table header  html += this.get_header();  html += '<tbody id="theBody">';  var rows = this.rows;  var count = rows.length;  var getFunc = this.getRow;  var strArray = new Array(count);  for (var i=0; i<count; i++)    strArray[i] = getFunc(rows[i]);    html += strArray.join("");  html += '</tbody></table></div>';  // render the table trailer  if (this.get_trailer != null)  {    html += '<table border="0" width="100%" cellspacing="0">';    html += this.get_trailer();    html += '</table>';  }  return html;}function updateTableDisplay(){  var htmlRows = getHtmlRows();  var rows = this.rows;  var count = rows.length;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?