/* FILE ARCHIVED ON 22:02:10 Feb 14, 2013 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 14:24:13 Aug 4, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ //this function is used to check or uncheck all checkboxes //in a specified check box collection function check_uncheck_all(formName, field, checkflag) { for (var i=0; i= 0; i--) { var curRow = $(selectedRows[i]).parent().parent().parent(); // Check value to see if it's already in the selected components list var componentToAdd = $(curRow).children('td').children('center').children('input[type="checkbox"]')[0].value; if ($('#table_selectedComponents input[value="' + componentToAdd + '"]').length == 0) { // Append value to string of selected component ID's var selectedComponentIds = $('input[name="' + selectedComponentsFieldName + '"]').val(); selectedComponentIds += $(curRow).children('td').children('center').children('input[type="checkbox"]')[0].value + ','; $('input[name="' + selectedComponentsFieldName + '"]').val(selectedComponentIds); // Remove row from pager-created "rowsCopy" array in results var c = $('#table_searchResults')[0].config; var index = (c.page * c.size) + curRow[0].rowIndex - 1; var rest = c.rowsCopy.slice(index + 1); c.rowsCopy.length = index; c.rowsCopy.push.apply(c.rowsCopy, rest); // Move row to selected components table and uncheck it var newRow = $(curRow).clone(); var newIndex = $('#table_selectedComponents tr').length - 1; newRow.find('td:first').html('
'); $('#table_selectedComponents')[0].config.rowsCopy.push(newRow); $(curRow).remove(); } // Uncheck row $(curRow).children('td').children('center').children('input[type="checkbox"]')[0].checked = false; } // Refresh paging for search results table -- may have less pages due to removal of rows c = $('#table_searchResults')[0].config; c.totalRows = c.rowsCopy.length; c.totalPages = Math.ceil(c.totalRows / c.size); if (c.page >= c.totalPages) c.page = c.totalPages - 1; if (c.totalRows > 0) $('#pager_results .pagesize').change(); // Refresh paging for selected components table -- may have more pages due to addition of rows c = $('#table_selectedComponents')[0].config; c.totalRows = c.rowsCopy.length; c.totalPages = Math.ceil(c.totalRows / c.size); if (c.totalRows > 0) $('#pager_components .pagesize').change(); } sysofreg.editComponent = {}; sysofreg.editComponent.add = function(selectedComponentsFieldName) { var selectedRows = $('#table_searchResults input:checked'); for (var i = selectedRows.length - 1; i >= 0; i--) { var curRow = $(selectedRows[i]).parent().parent().parent(); // Check value to see if it's already in the selected components list var componentToAdd = $(curRow).children('td').children('center').children('input[type="checkbox"]')[0].value; if ($('#table_selectedComponents input[value="' + componentToAdd + '"]').length == 0) { // Append value to string of selected component ID's var selectedComponentIds = $('input[name="' + selectedComponentsFieldName + '"]').val(); selectedComponentIds += $(curRow).children('td').children('center').children('input[type="checkbox"]')[0].value + ','; $('input[name="' + selectedComponentsFieldName + '"]').val(selectedComponentIds); // Remove row from pager-created "rowsCopy" array in results var c = $('#table_searchResults')[0].config; var index = (c.page * c.size) + curRow[0].rowIndex - 1; var rest = c.rowsCopy.slice(index + 1); c.rowsCopy.length = index; c.rowsCopy.push.apply(c.rowsCopy, rest); // Move row to selected components table and uncheck it var newRow = $(curRow).clone(); $(newRow.children('td').children('center').children('input[type="checkbox"]')[0]).remove(); newRow.children('td').children('center').append(''); newRow.appendTo('#table_selectedComponents tbody'); $('#table_selectedComponents')[0].config.rowsCopy.push(newRow); $(curRow).remove(); } // Uncheck row $(curRow).children('td').children('center').children('input[type="checkbox"]')[0].checked = false; } // Refresh paging for search results table -- may have less pages due to removal of rows c = $('#table_searchResults')[0].config; c.totalRows = c.rowsCopy.length; c.totalPages = Math.ceil(c.totalRows / c.size); if (c.page >= c.totalPages) c.page = c.totalPages - 1; if (c.totalRows > 0) $('#pager_results .pagesize').change(); // Refresh paging for selected components table -- may have less pages due to addition of rows c = $('#table_selectedComponents')[0].config; c.totalRows = c.rowsCopy.length; c.totalPages = Math.ceil(c.totalRows / c.size); if (c.totalRows > 0) $('#pager_components .pagesize').change(); } // Functions for adding/removing related links and classifications // on Request New Substance, Manage Substance, and Admin screens sysofreg.substanceMetadata = {}; sysofreg.substanceMetadata.sorterSettings = { widgets: ['zebra'], headers: { 0: { sorter: false } } }; sysofreg.substanceMetadata.addRelatedLink = function() { var name = $('#addRelatedLinkName').val(); var url = $('#addRelatedLinkUrl').val(); if ((name != null) && (name.length > 0) && (url != null) & (url.length > 0)) { var curIndex = $('#table_relatedLinks tbody')[0].rows.length; $('#table_relatedLinks tbody').append( '' + '
' + '' + '' + '' + '' + name + '' + '' + '' ); $('#table_relatedLinks').trigger('update').trigger('stripe'); $('#addRelatedLinkName').val(""); $('#addRelatedLinkUrl').val(""); $('#existingRelatedLinks').show(); } } sysofreg.substanceMetadata.addClass = function() { var selectedClassificationIds = $('input[name="selectedClassificationIds"]').val(); var options = $('#select_classifications option:selected'); for (var i = 0; i < options.length; i++) { selectedClassificationIds += options[i].value + ','; options[i].selected = false; $('#select_selectedClassifications').append(options[i]); } $('input[name="selectedClassificationIds"]').val(selectedClassificationIds); } sysofreg.substanceMetadata.removeClass = function() { var selectedClassificationIds = $('input[name="selectedClassificationIds"]').val(); var options = $('#select_selectedClassifications option:selected'); for (var i = 0; i < options.length; i++) { selectedClassificationIds = selectedClassificationIds.replace(new RegExp(options[i].value + ',', 'g'), ''); options[i].selected = false; $('#select_classifications').append(options[i]); } $('input[name="selectedClassificationIds"]').val(selectedClassificationIds); } // Options to make the tablesorter sort on an anchor link var linkParserOptions = { id: 'link', is: function(s) { return false; }, format: function(s) { return s.replace(/".*"/g, '').replace(//,'').replace(/<\/a>/,''); }, type: 'text' }; sysofreg.updateSynonymInputs = function() { if($('#inputSynonymRadio').is(":checked")) { $('#inputSynonym').attr('disabled', ''); $('#selectSynonym').attr('disabled', 'disabled'); } else { $('#selectSynonym').attr('disabled', ''); $('#inputSynonym').attr('disabled', 'disabled'); } } sysofreg.filterList = function(list, backupList, filterBox) { $('#' + list).empty().append($('#' + backupList + ' option').clone()); var filterText = jQuery.trim($('#' + filterBox).attr('value')); if (filterText.length > 0) $('#' + list + ' option:not(:Contains(' + filterText +'))').remove(); } sysofreg.executeSearch = function(e, formName, action) { if (e.keyCode == 13) { $('form[name=' + formName + ']').attr('action', $('form[name=' + formName + ']').attr('action') + '?' + action + '='); $('input[type="submit"]').attr('disabled', 'true'); $('form[name=' + formName + ']').submit(); } } /** READ Utility Search + Popup Functions */ function displayOrgSearch(sysOptURL, window_name) { var window_props = "left=0,top=0,width=960,height=600,toolbar=no,titlebar=yes,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no"; var window_url = sysOptURL + "?clearSearch=y"; var w = window.open(window_url, window_name, window_props); if(w != null) w.focus(); } function displayPersonSearch(sysOptURL, window_name) { var window_props = "left=0,top=0,width=960,height=600,toolbar=no,titlebar=yes,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no"; var window_url = sysOptURL + "?clearSearch=y"; var w = window.open(window_url, window_name, window_props); if(w != null) w.focus(); } function displayInfoResourceSearch(sysOptURL, window_name) { var window_props = "left=0,top=0,width=960,height=600,toolbar=no,titlebar=yes,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no"; var window_url = sysOptURL + "?clearSearch=y"; var w = window.open(window_url, window_name, window_props); if(w != null) w.focus(); } function displayArchitectureSearch(sysOptURL, window_name, architecture) { var window_props = "left=0,top=0,width=950,height=600,toolbar=no,titlebar=yes,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no"; var window_url = sysOptURL + "?architecture=" + architecture; var w = window.open(window_url, window_name, window_props); if(w != null) w.focus(); } function displayREADResource(sysOptURL, resourcePkId) { var window_props = "left=0,top=0,width=1024,height=700,toolbar=no,titlebar=yes,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no"; var window_url = sysOptURL + "?infoResourcePkId=" + resourcePkId; var w = window.open(window_url, "READ_" + resourcePkId, window_props); if(w != null) w.focus(); } function displayREADResourceRequest(sysOptURL, resourcePkId) { var window_props = "location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=no,top=0,left=0,width=780,height=600"; var window_url = sysOptURL + "?infoResourcePkId=" + resourcePkId; var w = window.open(window_url, "READ_RESREQ_" + resourcePkId, window_props); if(w != null) w.focus(); } function displayREADTaskDetail(sysOptURL, taskId) { var window_props = "left=0,top=0,width=1000,height=500,toolbar=no,titlebar=yes,menubar=no,scrollbars=yes,status=yes,resizable=yes,location=no"; var window_url = sysOptURL + "?taskID=" + taskId; var w = window.open(window_url, "READ_TASK_" + taskId, window_props); if(w != null) w.focus(); } function displayREADRefDataMaint(sysOptURL) { var window_props = "left=0,top=0,width=800,height=600,toolbar=yes,titlebar=yes,menubar=yes,scrollbars=yes,status=yes,resizable=yes,location=no"; var w = window.open(sysOptURL, "READ_REFDATA_MAINT", window_props); if(w != null) w.focus(); } function displayResourcePopup(sysOptURL, resourcePkId, type, field) { var window_props = "left=0,top=0,width=575,height=325,toolbar=no,titlebar=yes,menubar=no,scrollbars=no,status=yes,resizable=no,location=no"; var window_url = sysOptURL + "?reqMode=" + type + "&infoResourcePkId=" + resourcePkId; if ((field != null) && (field != '')) window_url = window_url + "&requestedField=" + field; var w = window.open(window_url, "READ_RESOURCE_POPUP", window_props); if(w != null) w.focus(); } /** ================== Functions for add/removing Resource Detail items ================== */ var systmreg = {}; systmreg.resourcedetail = {}; systmreg.resourcedetail.reviews = {}; systmreg.resourcedetail.sorterSettings = { widgets: ['zebra'], headers: { 0: { sorter: false } } }; systmreg.resourcedetail.reviews.addReadReview = function() { var index = $('#readReviews tbody')[0].rows.length; if($('#readReviews input:checkbox').length == 0) { $('#readReviews tbody').html(""); } $('#readReviews tbody').append( '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' Select a READ reviewer' + ' ' + ' ' + ' ' + ' ' + '' ); $('#readReviews').trigger('update').trigger('stripe'); } /** Formats the comment date that is displayed (before saving which saves the server side date) */ function formatCommentDate(commentDate) { var day = commentDate.getDate(); if(10 > day) day = "0" + day; var month = commentDate.getMonth() + 1; if(10 > month) month = "0" + month; var date = commentDate.getFullYear() + '-' + month + '-' + day; var minutes = commentDate.getMinutes(); if(10 > minutes) minutes = "0" + minutes; var time = commentDate.getHours() + ":" + minutes + ":" + commentDate.getSeconds() + "." + commentDate.getMilliseconds(); return date + ' ' + time; } systmreg.resourcedetail.reviews.addPiaReview = function() { var userDisplayName = $('input[name=userDisplayName]').val(); var index = $('#piaReviews tbody')[0].rows.length; // TODO: get server date? var commentDate = new Date(); // client-side date (changes to server date when saved) // var meridiem = "AM"; // if(11 < commentDate.getHours()) meridiem = "PM"; commentDate = formatCommentDate(commentDate); $('#piaReviews tbody').append( '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + userDisplayName + ' ' + ' ' + ' ' + commentDate + ' ' + '' ); $('#piaReviews').trigger('update').trigger('stripe'); } systmreg.resourcedetail.reviews.removePiaReview = function() { $('#piaReviews input:checked').parent().parent().remove(); $('#piaReviews').trigger('update').trigger('stripe'); } systmreg.resourcedetail.reviews.addCommentReview = function() { if($('#commentReviews input:checkbox').length == 0) { $('#commentReviews tbody').html(""); } var userDisplayName = $('input[name=userDisplayName]').val(); var index = $('#commentReviews tbody')[0].rows.length; // TODO: get server date? var commentDate = new Date(); // client-side date (changes to server date when saved) // var meridiem = "AM"; // if(11 < commentDate.getHours()) meridiem = "PM"; commentDate = formatCommentDate(commentDate); $('#commentReviews tbody').append( '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + userDisplayName + ' ' + ' ' + ' ' + commentDate + ' ' + '' ); $('#commentReviews').trigger('update').trigger('stripe'); } /** ================== Functions for add/removing Administration items ================== */ systmreg.administration = {}; systmreg.administration.sorterSettings = { widgets: ['zebra'], headers: { 0: { sorter: false } } }; systmreg.administration.addInfoResource = function() { if($('#assignGroupTable input:checkbox').length == 0) { $('#assignGroupTable tbody').html(""); } var highestCount = $('#assignGroupTable input:checkbox').length; $('#assignGroupTable tr.empty').remove(); $('#assignGroupTable tbody').append( '' + '
' + ' ' + ' ' + ' ' + ' ' + ' Select a resource to add to this group' + ' ' + ' ' + '' ); $('#assignGroupTable').trigger('update').trigger('stripe'); } systmreg.administration.addPerson = function() { var highestPersonCount; if($('#assignPersonTable input:checkbox').length == 0) { $('#assignPersonTable tbody').html(""); highestPersonCount = 0; } else{ highestPersonCount = $('#assignPersonTable input:checkbox').length; } $('#assignPersonTable tbody').append( '' + '
' + ' ' + ' ' + ' ' + ' ' + ' Select a person to provide access to' + ' ' + ' ' + '' ); $('#assignPersonTable').trigger('update').trigger('stripe'); } function callMyFavoriteSystems(contextPath) { var action = contextPath + "/registry/systmreg/common/myFavoriteSystems.do"; if ($('#myFavoriteSystemsDiv').length) { $.ajax({ url: contextPath + "/registry/systmreg/common/myFavoriteSystems.do", dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { $('#myFavoriteSystemsDiv').html(html); } }, error: function() { alert('callMyFavoriteSystems: An error has occured.') } }); } else { window.location = action; } } function callDeleteFavoriteSystem(contextPath, formId, sysId) { if (confirm('Are you sure you want to delete this info resource from your favorites?')) { $('[name=deleteFavSystem]').val(sysId); var action = contextPath + "/registry/systmreg/common/myFavoriteSystems.do?delete="; if ($('#myFavoriteSystemsDiv').length) { var data = $('#' + formId).serialize(); $.ajax({ type: "POST", url: action, data: data, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('myFavoriteSystemsDiv').innerHTML = html; } }, error: function() { alert('callDeleteFavoriteSystem: An error has occured.') } }); } else { $("#" + formId).attr("action", action); $("#" + formId).submit(); } } } function callCloseTask(contextPath, systemTaskTypeCode, readSystemTaskId, pkid) { if(confirm('Are you sure you want to permanently close this task?')) { var action = contextPath + "/registry/systmreg/common/tasklist/taskHistoryDetail.do?closeTask="; action += "&systemTaskTypeCode=" + systemTaskTypeCode + "&readSystemTaskId=" + readSystemTaskId + "&infoResourcePkId=" + pkid; $.ajax({ url: action, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { callSystemTaskList(contextPath); } }, error: function() { alert('callCloseTask: An error has occured.') } }); } } function callSystemTaskList(contextPath) { var action = contextPath + "/registry/systmreg/common/taskList.do"; if ($('#taskListDiv').length) { $.ajax({ url: action, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { $('#taskListDiv').html(html); applyPaging("pager_results_stl", "_stl", {0:{sorter:'link'},1:{ sorter: 'link'},5:{ sorter: false }}); } }, error: function() { alert('callSystemTaskList: An error has occured.') } }); } else { window.location = action; } } function callPersonalTaskList(contextPath) { var action = contextPath + "/registry/systmreg/common/taskList.do?retrievePersonalTaskList="; if ($('#taskListDiv').length) { $.ajax({ url: action, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('taskListDiv').innerHTML = html; } }, error: function() { alert('callPersonalTaskList: An error has occured.') } }); } else { window.location = action; } } function callSinglePersonalTask(contextPath, formId) { var action = contextPath + "/registry/systmreg/common/taskList.do?retrieveSinglePersonalTask="; if ($('#taskListDiv').length) { var data = $('#' + formId).serialize(); $.ajax({ type: "POST", url: action, data: data, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('taskListDiv').innerHTML = html; } }, error: function() { alert('callSinglePersonTask: An error has occured.') } }); } else { $('#' + formId).submit(); } } function callUpdatePersonalTask(contextPath, formId) { var action = contextPath + "/registry/systmreg/common/taskList.do?updatePersonalTask="; if ($('#taskListDiv').length) { var data = $('#' + formId).serialize(); $.ajax({ type: "POST", url: action, data: data, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('taskListDiv').innerHTML = html; } }, error: function() { alert('callUpdatePersonalTask: An error has occured.') } }); } else { $('#' + formId).submit(); } } function callDeletePersonalTask(contextPath, formId) { if(confirm('Are you sure you want to delete this task?')) { var action = contextPath + "/registry/systmreg/common/taskList.do?deletePersonalTask="; if ($('#taskListDiv').length) { var data = $('#' + formId).serialize(); $.ajax({ type: "POST", url: action, data: data, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('taskListDiv').innerHTML = html; } }, error: function() { alert('callDeletePersonalTask: An error has occured.') } }); } else { $('#' + formId).attr('action', action); $('#' + formId).submit(); } } } function callDisplayNewPersonalTask(contextPath) { var action = contextPath + "/registry/systmreg/common/taskList.do?displayNewPersonalTask="; if ($('#taskListDiv').length) { $.ajax({ url: action, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('taskListDiv').innerHTML = html; } }, error: function() { alert('callDisplayNewPersonalTask: An error has occured.') } }); } else { window.location = action; } } function callAddPersonalTask(contextPath, formId) { var action = contextPath + "/registry/systmreg/common/taskList.do?addPersonalTask="; if ($('#taskListDiv').length) { var data = $('#' + formId).serialize(); $.ajax({ type: "POST", url: action, data: data, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('taskListDiv').innerHTML = html; } }, error: function() { alert('callAddPersonalTask: An error has occured.') } }); } else { $('#' + formId).submit(); } } /** perform submit (post) to retain form values */ function callPostResourceSearchCriteria(contextPath, formId) { var action = $('#' + formId).attr('action'); //Required to check if this search is in the embedded manage page if ($('#resourceSearchDiv').length) { action = action + "?isAjax=yes&doIncludes=no"; var data = $('#' + formId).serialize(); $.ajax({ type: "POST", url: action, data: data, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('resourceSearchDiv').innerHTML = html; setInputKeydown(contextPath); } }, error: function() { alert('callPostResourceSearchCriteria: An error has occured.') } }); } else { //only occurs if the button is clicked from the ?isAjax=yes page. if ($('.links').length <= 0) { if($('input[name=modelOnlyFlag]').val() == 'true') modelOnly = '&modelOnly=true'; else modelOnly = ''; $('#' + formId).attr('action', $('#' + formId).attr('action') + '?isAjax=yes' + modelOnly); $('#' + formId).submit(); } else { $('#' + formId).submit(); } } } function callClearResourceSearch(path, isAdvancedSearch) { var action; if(isAdvancedSearch) action = path; else action = path + "/registry/systmreg/searchandretrieve/basic/search.do"; if ($('#resourceSearchDiv').length) { action = action + "?isAjax=yes&doIncludes=no"; $.ajax({ url: action, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('resourceSearchDiv').innerHTML = html; setInputKeydown(path); } }, error: function() { alert('callClearResourceSearch: An error has occured.') } }); } else { if ($('.links').length <= 0) { action = action + "?isAjax=yes"; } window.location = action; } } function setInputKeydown(path) { $('#resourceSearchDiv :input').keydown(function(event){ if (event.keyCode == 13) callBasicResourceSearchResults(path, 'readResourceSearch'); }); } function browseBy(path, value) { $('[name=browseBy]').val(value); callBasicResourceSearchResults(path, 'readResourceSearch'); } function callBasicResourceSearchResults(contextPath, formId) { if ($('#resourceSearchDiv').length) { var action = contextPath + "/registry/systmreg/searchandretrieve/basic/search.do?search=&isAjax=yes&doIncludes=no&isManageBasicAction=yes"; var data = $('#' + formId).serialize(); $.ajax({ type: "POST", url: action, data: data, dataType: "html", success: function(html) { if (($(html).find('input[name=userid]').length > 0) && ($(html).find('input[name=password]').length > 0)) { window.location = "search.do"; } else { document.getElementById('resourceSearchDiv').innerHTML = html; applyPaging("pager_results_search", '_search', {0:{sorter:'link'},1:{ sorter: 'link'}}); // Move export links below table container div $('#readResourceSearch span.exportlinks_top').html(' (' + $('div.exportlinks').html() + ')'); $('div.exportlinks').html(''); } }, error: function() { alert('callBasicResourceSearchResults: An error has occured.') } }); } else { //if no #content is present, then it must perform search in the isAjax view. //alert("adding isAjax: " + $('#' + formId).attr('action').indexOf('Ajax')); //if the action already had the Ajax attributes (from clicking on the back button) //the page would reload with two isAjax attributes and cause the page to not work as expected if($('#' + formId).attr('action').indexOf('Ajax') == -1) { if (($('.links').length <= 0) ) { $('#' + formId).attr('action', $('#' + formId).attr('action') + '?search=&isAjax=yes'); } else { $('#' + formId).attr('action', $('#' + formId).attr('action') + '?search='); } } $('#' + formId).submit(); } } function openResource(id, rdURL) { displayREADResource(rdURL, id); } function applyPaging(pagerId, classAppender, headers) { classAppender = classAppender || ""; $('div.tableScroller' + classAppender + ' table') .tablesorter({ widthFixed: true, widgets: ['zebra'], headers: headers }); $('div.tableScroller' + classAppender + ' table').tablesorterPager({ container: $("#" + pagerId), size: 25, positionFixed: false, container: null, cssNext: '.resultset_next' + classAppender, cssPrev: '.resultset_prev' + classAppender, cssFirst: '.resultset_first' + classAppender, cssLast: '.resultset_last' + classAppender, cssPageDisplay: '.pagedisplay' + classAppender, cssPageSize: '.pagesize' + classAppender, cssNumResults: '.numresults' + classAppender }); $('#pagerId .pagesize').val('25'); } function systemTaskOpenResource(id, type, status, rdURL, rrURL) { //Determine which window to show if ((type == 'NEW_REQUEST') && (status != 'APPROVED')) displayREADResourceRequest(rrURL, id); else displayREADResource(rdURL, id); }