' + ''); // BUILD THE FIRST PAGE OF ORGANIZATIONS _this.BuildOrganizationsPage({ "pageNumber": 1, "listContainer": $("#org-details-tab-panel-" + schoolsID + " .staff-directory-panel-list"), "scrollView": false }); } } // NOW BUILD THE ACCOUNT GROUP TABS _this.BuildRoleTabs(); }); // BUILD OUT THE REST OF THE VIEW _this.BuildBreadcrumbs(); _this.Search(); _this.Events(); if(props.scrollView) { _this.ScrollView({ "scrollToContainer": $("#pmi-9894 .ui-widget-detail") }); } }); }, "BuildOrganization": function(props) { // props.main, props.org // INCLUDE ADDITIONAL INFORMATION FIELDS FOR THE MAIN ORG AT THE TOP var additionalContacts = '' // URL CHECK HELPER FUNCTION function isUrl(string) { var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ return regexp.test(string); } // EMAIL CHECH HELPER FUNCTION function isEmail(email) { var regexp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return regexp.test(String(email).toLowerCase()); } if(props.main) { if(this.CheckKey({ "object": props.org, "key": "directoryInfo" })) { $.each(props.org.directoryInfo, function(index, contact) { var contactValue = $.trim(contact.value); if(isUrl(contactValue)) { contactValue = '' + contactValue + ''; } if(isEmail(contactValue)) { contactValue = '' + contactValue + ''; } additionalContacts +='
' + '
' + contact.label + '
' + '
' + contactValue + '
' + '
'; }); } if(this.CheckKey({ "object": props.org, "key": "twitterHandle" })) { if(props.org.twitterHandle != null && props.org.twitterHandle != "") { additionalContacts +='
'; } } if(this.CheckKey({ "object": props.org, "key": "facebookUrl" })) { if(props.org.facebookUrl != null && props.org.facebookUrl != "") { additionalContacts +='
' + '
' + '
' + props.org.facebookUrl + '
' + '
'; } } } // BUILD EMAIL ICON var emailLink = ''; if($.trim(props.org.emailAddress) != "" && (this.displayEmail=='True'||this.displayEmail=="")) { // EMAIL FORM IS SELECTED if(this.EmailMethod == "form") { emailLink += ''; } // CAPTCHA EMAIL RETRIEVAL SELECTED else if(this.EmailMethod == "captcha") { emailLink += ''; } // LIST ADDRESS IS SELECTED else {emailLink += ''; } } // BUILD TWITTER ICON var twitterLink = ''; if($.trim(props.org.twitterHandle) != "" && (this.displayTwitter=='True'||this.displayTwitter=="")) { twitterLink += ''; } // BUILD FACEBOOK ICON var facebookLink = ''; if($.trim(props.org.facebookUrl) != "" && (this.displayFacebook=='True'||this.displayFacebook=="")) { facebookLink += ''; } var orgStructure =((!props.main) ? '
' + '
' + (($.trim(props.org.picThumbnailUrl) != "" & (props.main)) ? '' : '') + (($.trim(props.org.picThumbnailUrl) != "" & (!props.main)) ? '
' : '') + '
' + '
' +((!props.main) ? '
' + $.trim(props.org.name) + ((!props.main) ? '
' : '') + ((!props.main) ? '
' + '
' + (($.trim(props.org.addressLine2) + $.trim(props.org.city) + $.trim(props.org.state) + $.trim(props.org.postCode) != "" && (this.displayAddress=='True'||this.displayAddress=="")) ? 'Main Office' + '
' : '') + '
' + // PHONE/FAX/ADDITIONAL '
' + (($.trim(props.org.phoneNumber) != "" && (this.displayPhoneNumber=='True'||this.displayPhoneNumber=="")) ? '
' + 'Main Office' + '
' + ''+$.trim(props.org.phoneNumber) +'
' + '
' : '') + (($.trim(props.org.faxNumber) != ""&& (this.displayFaxNumber=='True'||this.displayFaxNumber=="")) ? '
' + 'Fax' + '
' + ''+$.trim(props.org.faxNumber) +'
' + '
' : '') + additionalContacts + '
' + // EMAIL/WEB '
' + (($.trim(props.org.url) != "" && (this.displayWebsite=='True'||this.displayWebsite=="")) ? '' : '' ) + emailLink + facebookLink + twitterLink + '
' + '
' : '') + '
' + ((!props.main) ? '' : '') + '
' : ''); return orgStructure; }, "BuildOrganizationsPage": function(props) { // props.pageNumber, props.listContainer, props.scrollView var _this = this; var organizationsList = ''; $.each(_this.PaginatedOrganizations[_this.OrganizationID][props.pageNumber], function(index, org) { organizationsList += _this.BuildOrganization({ "main": false, "org": org }); }); $(props.listContainer).removeClass("loading").html(organizationsList); // SCROLL THE USER BACK TO THE TOP if(props.scrollView) { this.ScrollView({ "scrollToContainer": $(props.listContainer) }); } }, "BuildRoleTabs": function() { var _this = this; // ADD ALL ROLE TYPE TABS AND PANELS Bb.WCM.API.BBComm.GetDirectory(this.DirectoryID).then(function(data) { var roleGroupTabCount = 0, roleGroupTabs = '', roleGroupTabPanels = '', relationshipID = ''; var roleGroupSelectOptions = ''; // FIRST BUILD THE VIP TAB IF VIPS EXIST if(_this.CheckKey({ "object": data.vips, "key": _this.OrganizationID })) { if(data.vips[_this.OrganizationID].length) { relationshipID = _this.GenerateID(); roleGroupSelectOptions += '
'; roleGroupTabs += '
'; roleGroupTabPanels += '
' + '
- ' + '
- ' + '
' + '
'; roleGroupTabCount++; } } // ITERATE OVER THE AVAILABLE ROLE GROUPS $.each(data.roleGroups, function(index, roleGroup) { if(roleGroup.totalAccountNumber > 0 || roleGroup.totalAccountNumber == undefined) { relationshipID = _this.GenerateID(); roleGroupSelectOptions += '
'; roleGroupTabs += '
'; roleGroupTabPanels += '
' + '
- ' + '
- ' + '
' + '
'; roleGroupTabCount++; } }); if(roleGroupTabCount > 0) { // ADD SELECT OPTIONS TO THE DOM FOR MOBILE $("#pmi-9894 .org-details-select").append(roleGroupSelectOptions); // ADD TABS AND PANELS TO THE DOM $("#pmi-9894 .org-details-tabs").append(roleGroupTabs); $("#pmi-9894 .org-details-tab-panels").append(roleGroupTabPanels); // SET TAB AND PANEL PROPERTIES $("#pmi-9894 .org-details-tabs > li:first-child").attr({ "aria-selected": "true", "tabindex": "0" }); $("#pmi-9894 .org-details-tab-panels > div:first-child").attr("aria-hidden", "false"); // LOAD THE FIRST TAB IF NEEDED if($("#pmi-9894 .org-details-tab:first-child").attr("data-loaded") == "false") { switch($("#pmi-9894 .org-details-tab:first-child").attr("data-end-point")) { case "accounts": _this.BuildAccounts({ "tab": $("#pmi-9894 .org-details-tab:first-child") }); break; case "vips": _this.BuildVips({ "tab": $("#pmi-9894 .org-details-tab:first-child") }); break; } // MARK LOADED $("#pmi-9894 .org-details-tab:first-child").attr("data-loaded", "true"); } } else if(!$("#pmi-9894 .org-details-tabs").length) { $("#pmi-9894 .org-details-toolbar, #pmi-9894 .org-details-tab-panels").hide(); } }); }, "BuildAccounts": function(props) { // props.tab var _this = this; var groupName = $(props.tab).attr("data-name"); var accountList = ''; // DONT MAKE A NEW REQUEST IF WE ALREADY HAVE THE DATA STORED try { // BUILD OUT THE ACCOUNTS $.each(_this.PaginatedAccounts[_this.OrganizationID][groupName]["1"], function(index, account) { accountList += _this.BuildAccount({ "account": account, "submittedSearch": false }); }); addAccountsStructure(); } // NO DATA SO GO GET IT catch(error) { // REQUEST THE ACCOUNT LISTING Bb.WCM.API.BBComm.GetAccounts({orgIDs:_this.OrganizationID,roleIDs:$(props.tab).attr("data-role-ids"),limit:10000,forDirectory:true,page:0}).then(function(data) { var accounts = [], totalPages = Math.ceil(data.accounts.length / _this.PaginationLimit);// data.totalPages; // LOOP THROUGH ACCOUNTS AND STORE EACH ACCOUNT IN THE ARRAY TO SORT LATER $.each(data.accounts, function(index, account) { accounts.push(account); }); // SORT ACCOUNTS ALPHABETICALLY BY LAST NAME accounts.sort(function(a, b) { return (a.lastName < b.lastName) ? -1 : (a.lastName > b.lastName) ? 1 : 0; }); // WE WILL STORE ALL DATA RETRIEVED FROM THE API IN THIS OBJECT SO THAT WE DO NOT MAKE DUPLICATE REQUESTS // IF A PAGE NUMBER IS CHOSEN WHERE WE ALREADY LOADED THE DATA, THE DATA WILL BE PULLED FROM THIS OBJECT /* OBJECT STRUCTURE IS: { 37846: { // ORG ID "Teachers": { // ROLE GROUP NAME 1: [ // PAGE 1 ARRAY OF ACCOUNTS - EACH ACCOUNT IS AN OBJECT - NUMBER OF ACCOUNTS BASED ON LIMIT RETURNED FROM API ], 2: [ // PAGE 2 ARRAY OF ACCOUNTS - EACH ACCOUNT IS AN OBJECT - NUMBER OF ACCOUNTS BASED ON LIMIT RETURNED FROM API ], etc, }, "Staff": { // ROLE GROUP NAME 1: [ // PAGE 1 ARRAY OF ACCOUNTS - EACH ACCOUNT IS AN OBJECT - NUMBER OF ACCOUNTS BASED ON LIMIT RETURNED FROM API ], 2: [ // PAGE 2 ARRAY OF ACCOUNTS - EACH ACCOUNT IS AN OBJECT - NUMBER OF ACCOUNTS BASED ON LIMIT RETURNED FROM API ], etc, }, etc, }, 68264: { // ORG ID }, etc, } */ if(!_this.CheckKey({ "object": _this.PaginatedAccounts, "key": _this.OrganizationID })) { _this.PaginatedAccounts[_this.OrganizationID] = {}; } if(!_this.CheckKey({ "object": _this.PaginatedAccounts[_this.OrganizationID], "key": groupName })) { _this.PaginatedAccounts[_this.OrganizationID][groupName] = {}; } if(totalPages>1) { _this.PaginatedAccounts[_this.OrganizationID][groupName].totalPages = totalPages; for(var p = 1; p <= totalPages; p++) {_this.PaginatedAccounts[_this.OrganizationID][groupName][p] = accounts.splice(0, _this.PaginationLimit);} } else { _this.PaginatedAccounts[_this.OrganizationID][groupName].totalPages = totalPages; _this.PaginatedAccounts[_this.OrganizationID][groupName]["1"] = accounts; } // BUILD OUT THE ACCOUNTS $.each(_this.PaginatedAccounts[_this.OrganizationID][groupName]["1"], function(index, account) { accountList += _this.BuildAccount({ "account": account, "submittedSearch": false }); }); addAccountsStructure(); }).catch(function(jqXHR, textStatus, errorThrown) { // ADD ERROR MESSAGE TO THE DOM $("#pmi-9894 #" + $(props.tab).attr("aria-controls")).html('' + '
- ' + '
- ' + 'Something happened when trying to retrieve the list of accounts for ' + $(props.tab).attr("data-name") + '. Please refresh your page and try again. If this continues to happen, please contact WCM Support with the following error details:
' + 'Problem retrieving account listing for ' + $(props.tab).attr("data-name") + ':
' + 'Staff Directory App Location: ' + window.location.href + '
' + 'Returned Error: ' + (($.trim(errorThrown) == "") ? "None provided" : errorThrown) + ' ' + '
' + ''); }); } function addAccountsStructure() { if(accountList.length == 0) { accountList = '
'; } // BUILD OUT THE PAGINATION LIST var numberOfPages = _this.PaginatedAccounts[_this.OrganizationID][groupName].totalPages; var pagination = _this.BuildPaginationControl({ "numberOfPages": numberOfPages, "pageButtonClass": "load-accounts-page", "loadPageFor": $(props.tab).attr("data-name") + " tab", "panelID": "#" + $(props.tab).attr("aria-controls"), "startPage": 1, "attributes": [ 'data-role-ids="' + $(props.tab).attr("data-role-ids") + '"', 'data-list-container="#' + $(props.tab).attr("aria-controls") + ' .staff-directory-panel-list"', 'data-role-group="' + $(props.tab).attr("data-name") + '"', ] }); // ADD THE ACCOUNTS TO THE DOM $("#pmi-9894 #" + $(props.tab).attr("aria-controls")).html('' + '
- ' + accountList + '
' + pagination + ''); } }, "BuildAccount": function(props) { // props.account, props.submittedSearch // GENERATE INITIALS FOR NO THUMBNAIL // SOMETIMES THE firstName AND lastName PROPERTIES HAVE ARRAY VALUES AND SOMETIMES STRING VALUES IN THE API - NOT SURE WHY var firstInitial = "", lastInitial = ""; if(Array.isArray(props.account.firstName)) { firstInitial = props.account.firstName[0].charAt(0); lastInitial = props.account.lastName[0].charAt(0); } else { firstInitial = props.account.firstName.charAt(0); lastInitial = props.account.lastName.charAt(0); } var initials = firstInitial + lastInitial; // BUILD EMAIL FUNCTION var emailLink = ''; if($.trim(props.account.directoryEmail) != "") { // EMAIL FORM IS SELECTED if(this.EmailMethod == "form") { emailLink += ''; } // CAPTCHA EMAIL RETRIEVAL SELECTED else if(this.EmailMethod == "captcha") { emailLink += ''; } // LIST ADDRESS IS SELECTED else { emailLink += ''; } } // ACCOUNT LINKEDIN URL var directoryLinkedIn = ''; if($.trim(props.account.directoryLinkedIn)!="") { directoryLinkedIn += ''; } // ACCOUNT TWITTER HANDLE var directoryTwitter = ''; if($.trim(props.account.directoryTwitter)!="") { directoryTwitter += '
'; } // GENERATE UNIQUE ID var relationshipID = this.GenerateID(); // SET HANDY EXPANDABLE CHECK var isExpandable = props.account.sectionCount > 0 || (this.CheckKey({ "object": props.account, "key": "directoryUrls" }) && props.account.directoryUrls.length) || this.CheckKey({ "object": props.account, "key": "bio" }) // BUILD ACCOUNT STRUCTURE var accountStructure ='
' + '
' + (($.trim(props.account.thumbnail) != "") ? '' : '
' + initials + '
') + '
' + '
' + '
' + '
' + '
' + $.trim(props.account.name) + '
' + '
' + $.trim(props.account.title).toLowerCase() + '
' + ((props.submittedSearch) ? '
' + $.trim(props.account.orgName).toLowerCase() + '
' : '') + '
' + '
' + (($.trim(props.account.directoryPhone) != "") ? '
' + ''+ $.trim(props.account.directoryPhone) + '' + '
' : '' ) + '
' + '
' + emailLink + directoryTwitter + directoryLinkedIn + '
' + '
' + ((isExpandable) ? '
' + '
' + '
' + '
' + '
' + '
' : '') + '
' + ((isExpandable) ? '' : '') + '
'; return accountStructure; }, "BuildAccountsPage": function(props) { // props.pageNumber, props.listContainer, props.roleIDs, props.roleGroup, props.scrollView var _this = this; // ALREADY REQUESTED THIS DATA SO LOAD FROM STORED OBJECT try { // BUILD ACCOUNTS AND ADD TO THE DOM var accountList = ''; $.each(_this.PaginatedAccounts[_this.OrganizationID][props.roleGroup][props.pageNumber], function(index, account) { accountList += _this.BuildAccount({ "account": account, "submittedSearch": false }); }); // UPDATE ATTRIBUTES $(props.listContainer).removeClass("loading").html(accountList); // SCROLL THE USER BACK TO THE TOP if(props.scrollView) { this.ScrollView({ "scrollToContainer": $(props.listContainer) }); } } // HAVE NOT REQUESTED THIS DATA YET SO GO GET IT catch(error) { Bb.WCM.API.BBComm.GetAccounts({orgIDs:_this.OrganizationID,roleIDs:$(props.tab).attr("data-role-ids"),limit:_this.PaginationLimit,forDirectory:true,page: (props.pageNumber - 1) // MINUS ONE BECAUSE BB COMMS API PAGES START AT 0}).then(function(data) { // SORT ACCOUNTS ALPHABETICALLY BY LAST NAME data.accounts.sort(function(a, b) { return (a.lastName < b.lastName) ? -1 : (a.lastName > b.lastName) ? 1 : 0; }); // BUILD ACCOUNTS AND ADD TO THE DOM var accountList = ''; $.each(data.accounts, function(index, account) { accountList += _this.BuildAccount({ "account": account, "submittedSearch": false }); }); if(accountList.length == 0) { accountList = '
'; } // UPDATE ATTRIBUTES $(props.listContainer).removeClass("loading").html(accountList);// ADD DATA TO OBJECT FOR LATER USE IF NEEDED// IF GROUP NAME EXISTS IN THE OBJECT FOR THIS ORGANIZATION if(!_this.CheckKey({ "object": _this.PaginatedAccounts[_this.OrganizationID], "key": props.roleGroup })) { _this.PaginatedAccounts[_this.OrganizationID][props.roleGroup] = {}; } _this.PaginatedAccounts[_this.OrganizationID][props.roleGroup][props.pageNumber] = data.accounts; // SCROLL THE USER BACK TO THE TOP if(props.scrollView) { _this.ScrollView({ "scrollToContainer": $(props.listContainer) }); } }); } }, "BuildAdditionalAccountInfo": function(props) { // props.accountID, props.relationshipID var _this = this; // REQUEST THE ACCOUNT INFO Bb.WCM.API.BBComm.GetAccount(props.accountID).then(function(account) {// ACCOUNT BIO var bio = ''; if(_this.CheckKey({ "object": account, "key": "bio" })) { bio +='
' + '
About
' + '
' + $.trim(account.bio) + '
' + '
'; } // ACCOUNT SECTION LIST var sections = ''; if(_this.CheckKey({ "object": account, "key": "sections" })) { if(account.sections.length) { var sectionsList = ''; $.each(account.sections, function(index, section) {sectionsList += '
'; }); sections +='
' + '
Sections
' + '
- ' + sectionsList + '
' + '
'; } } // ACCOUNT URLS var directoryUrls = ''; if(_this.CheckKey({ "object": account, "key": "directoryUrls" })) { if(account.directoryUrls.length) { var urlList = ''; $.each(account.directoryUrls, function(index, url) {urlList += '
'; }); directoryUrls +='
' + '
- ' + urlList + '
' + '
'; } } // ADD ACCOUNT INFO TO THE DOM $("#staff-directory-additional-info-" + props.relationshipID + " .account-additional-info-column.one").html(bio + sections); $("#staff-directory-additional-info-" + props.relationshipID + " .account-additional-info-column.two").html(directoryUrls); $("#staff-directory-additional-info-" + props.relationshipID).attr("aria-hidden", "false").slideDown(); }).catch(function(jqXHR, textStatus, errorThrown) { // ADD ERROR MESSAGE TO THE DOM $("#pmi-9894 #" + $(props.tab).attr("aria-controls")).html('' + '
- ' + '
- ' + 'Something happened when trying to retrieve the account information. Please refresh your page and try again. If this continues to happen, please contact WCM Support with the following error details:
' + 'Problem retrieving additional account information:
' + 'Staff Directory App Location: ' + window.location.href + '
' + 'Returned Error: ' + (($.trim(errorThrown) == "") ? "None provided" : errorThrown) + ' ' + '
' + ''); }); }, "BuildVips": function(props) { // props.tab var _this = this; // REQUEST THE ACCOUNT LISTING Bb.WCM.API.BBComm.GetVIP(_this.DirectoryID,_this.OrganizationID).then(function(data) { var accounts = []; // LOOP THROUGH ACCOUNTS AND STORE EACH ACCOUNT IN THE ARRAY TO SORT LATER $.each(data.vips, function(index, account) { accounts.push(account); }); // SORT ACCOUNTS ALPHABETICALLY BY LAST NAME accounts.sort(function(a, b) { return (a.lastName < b.lastName) ? -1 : (a.lastName > b.lastName) ? 1 : 0; }); // BUILD PAGINATED DATA OBJECT FOR EASY PAGE BUILDING LATER var paginationNumber = Math.ceil(accounts.length / _this.PaginationLimit); if(!_this.CheckKey({ "object": _this.PaginatedVips, "key": _this.OrganizationID })) { _this.PaginatedVips[_this.OrganizationID] = {}; } for(var p = 1; p <= paginationNumber; p++) { _this.PaginatedVips[_this.OrganizationID][p] = accounts.splice(0, _this.PaginationLimit); } // BUILD OUT THE PAGINATION LIST var pagination = _this.BuildPaginationControl({ "numberOfPages": paginationNumber, "pageButtonClass": "load-vips-page", "loadPageFor": $(props.tab).attr("data-name") + " tab", "panelID": "#" + $(props.tab).attr("aria-controls"), "startPage": 1, "attributes": [ 'data-list-container="#' + $(props.tab).attr("aria-controls") + ' .staff-directory-panel-list"', 'data-role-group="' + $(props.tab).attr("data-name") + '"', ] }); // ADD THE ACCOUNT STRUCTURE TO THE DOM $("#pmi-9894 #" + $(props.tab).attr("aria-controls")).html('' + '
- ' + '
- ' + '
' + ((paginationNumber > 1) ? pagination : "") + ''); // BUILD THE FIRST PAGE OF VIPS _this.BuildVipsPage({ "pageNumber": 1, "listContainer": $("#" + $(props.tab).attr("aria-controls") + " .staff-directory-panel-list"), "scrollView": false }); }).catch(function(jqXHR, textStatus, errorThrown) { // ADD ERROR MESSAGE TO THE DOM $("#pmi-9894 #" + $(props.tab).attr("aria-controls")).html('' + '
- ' + '
- ' + 'Something happened when trying to retrieve the list of accounts for ' + $(props.tab).attr("data-name") + '. Please refresh your page and try again. If this continues to happen, please contact WCM Support with the following error details:
' + 'Problem retrieving account listing for ' + $(props.tab).attr("data-name") + ':
' + 'Staff Directory App Location: ' + window.location.href + '
' + 'Returned Error: ' + (($.trim(errorThrown) == "") ? "None provided" : errorThrown) + ' ' + '
' + ''); }); }, "BuildVipsPage": function(props) { // props.pageNumber, props.listContainer, props.scrollView var _this = this; // BUILD EACH VIP ACCOUNT var accountsList = ''; $.each(_this.PaginatedVips[_this.OrganizationID][props.pageNumber], function(index, account) { accountsList += _this.BuildAccount({ "account": account, "submittedSearch": false }); }); // ADD THE VIP ACCOUNT LIST TO THE DOM $(props.listContainer).removeClass("loading").html(accountsList); // SCROLL THE USER BACK TO THE TOP if(props.scrollView) { this.ScrollView({ "scrollToContainer": $(props.listContainer) }); } }, "BuildBreadcrumbs": function() { var breadcrumbs = ''; // ONLY BUILD BREADCRUMBS IF THERE ARE MORE THAN ONE if(this.Breadcrumbs.length > 1) { // LAST BREADCRUMB INDEX var lastIndex = this.Breadcrumbs.length - 1; // ITERATE AND BUILD THE BREADCRUMBS $.each(this.Breadcrumbs, function(index, breadcrumb) { breadcrumbs +='
'; }); // ADD THE BREADCRUMBS TO THE DOM$("#pmi-9894 .ui-widget-detail").prepend('' + '
' + '
- ' + breadcrumbs + '
' + '
' + ''); } }, "BuildPaginationControl": function(props) { // props.numberOfPages, props.pageButtonClass, props.loadPageFor, props.panelID, props.startPage, props.attributes var pagination = ''; // ONLY BUILD PAGINATION IF THERE IS MORE THAN ONE PAGE if(props.numberOfPages > 1) { pagination = '
'; } // RETURN THE BUILT PAGINATION CONTROLS return pagination; }, "ScrollView": function(props) { // props.scrollToContainer $("html, body").animate({ scrollTop: $(props.scrollToContainer).offset().top }, "slow"); }, "Search": function() { var _this = this; // SEARCH FORM BUTTON SUBMIT $(document).off("click keydown", "#pmi-9894 .staff-directory-search-submit").on("click keydown", "#pmi-9894 .staff-directory-search-submit", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); $("#pmi-9894 .staff-directory-search").submit(); } }); // SEARCH FORM SUBMIT $(document).off("submit", "#pmi-9894 .staff-directory-search").on("submit", "#pmi-9894 .staff-directory-search", function(e) { e.preventDefault(); if($.trim($("#pmi-9894 .staff-directory-search-input").val()) != "") { Bb.WCM.API.BBComm.Search({orgIDs:_this.OrganizationID,limit:_this.PaginationLimit,roleGroups:true,forDirectory:true,includeChildOrgs:true,q:$.trim($("#pmi-9894 .staff-directory-search-input").val())}).then(function(data) { // BUILD SEARCH RESULTS var results = '' if(data.roleGroups.length) { $.each(data.roleGroups, function(index, roleGroup) { $.each(roleGroup.accounts, function(index, account) { results += _this.BuildAccount({ "account": account, "submittedSearch": true }); }); }); } else { results += '
'; } // HIDE THE CURRENT TABS AND TAB PANELS AND SHOW THE SEARCH FILTER $("#pmi-9894 .org-details-tabs, #pmi-9894 .org-details-tab-panels").hide(); $("#pmi-9894 .staff-directory-search-filter").removeClass("staff-directory-hidden"); $("#pmi-9894 .staff-directory-search-filter-text").html("Showing results for \"" + $.trim($("#pmi-9894 .staff-directory-search-input").val()) + "\""); // ADD THE SEARCH RESULTS TO THE DOM $("#pmi-9894 .staff-directory-search-results").removeClass("staff-directory-hidden").html('
- ' + results + '
'); }); } }); // CLEAR SEARCH FILTER $(document).off("click keydown", "#pmi-9894 .staff-directory-search-filter-clear").on("click keydown", "#pmi-9894 .staff-directory-search-filter-clear", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); // SET THE APP TO LOADING STATE $("#pmi-9894 .ui-widget-detail").addClass("loading"); // REBUILD THE VIEW _this.BuildView({ "scrollView": true }); } }); }, "Events": function() { var _this = this; // ORGANIZATION/BREADCRUMB ARROW CLICK/KEYDOWN $(document).off("click keydown", "#pmi-9894 .load-org").on("click keydown", "#pmi-9894 .load-org", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); // UPDATE ORGANIZATION ID _this.OrganizationID = $(this).attr("data-org-id"); // SET THE APP TO LOADING STATE $("#pmi-9894 .ui-widget-detail").addClass("loading"); // REBUILD THE VIEW _this.BuildView({ "scrollView": true }); } }); // ORGANIZATION PAGE CLICK/KEYDOWN $(document).off("click keydown", "#pmi-9894 .load-organizations-page").on("click keydown", "#pmi-9894 .load-organizations-page", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); var pageNumber = ""; // IF THE CLICKED BUTTON IS TO LOAD A NEW PAGE SET if($(this).hasClass("staff-directory-pagination-skip")) { // REBUILD THE PAGINATION CONTROLS var pagination = _this.BuildPaginationControl({ "numberOfPages": parseInt($(this).attr("data-number-of-pages")), "pageButtonClass": $(this).attr("data-page-button-class"), "loadPageFor": $(this).attr("data-load-pages-for"), "panelID": $(this).attr("data-panel"), "startPage": parseInt($(this).attr("data-start-page")), "attributes": [ 'data-list-container="' + $(this).attr("data-list-container") + '"' ] }); // ADD THE NEW PAGINATION CONTROLS TO THE DOM $($(this).attr("data-panel") + " .staff-directory-pagination-list").replaceWith(pagination); pageNumber = parseInt($(this).attr("data-start-page")); } // LOAD THE CLICKED PAGE NUMBER else { pageNumber = $(this).attr("data-page-number"); // UPDATE ATTRIBUTES $(".staff-directory-load-page", $(this).closest(".staff-directory-pagination-list")).removeClass("active").removeAttr('aria-current'); $(this).addClass("active").attr('aria-current', true); } // UPDATE ATTRIBUTES $($(this).attr("data-list-container")).addClass("loading").html('
'); // BUILD THE PAGE _this.BuildOrganizationsPage({ "pageNumber": pageNumber, "listContainer": $(this).attr("data-list-container"), "scrollView": true }); // AUTO FOCUS THE PANEL IF KEYDOWN if(e.type == "keydown") { $(this).closest(".org-details-tab-panel").focus(); } } }); // ACCOUNT PAGE CLICK/KEYDOWN $(document).off("click keydown", "#pmi-9894 .load-accounts-page").on("click keydown", "#pmi-9894 .load-accounts-page", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); var pageNumber = ""; // IF THE CLICKED BUTTON IS TO LOAD A NEW PAGE SET if($(this).hasClass("staff-directory-pagination-skip")) { // REBUILD THE PAGINATION CONTROLS var pagination = _this.BuildPaginationControl({ "numberOfPages": parseInt($(this).attr("data-number-of-pages")), "pageButtonClass": $(this).attr("data-page-button-class"), "loadPageFor": $(this).attr("data-load-pages-for"), "panelID": $(this).attr("data-panel"), "startPage": parseInt($(this).attr("data-start-page")), "attributes": [ 'data-role-ids="' + $(this).attr("data-role-ids") + '"', 'data-list-container="' + $(this).attr("data-panel") + ' .staff-directory-panel-list"', 'data-role-group="' + $(this).attr("data-role-group") + '"', ] }); // ADD THE NEW PAGINATION CONTROLS TO THE DOM $($(this).attr("data-panel") + " .staff-directory-pagination-list").replaceWith(pagination); pageNumber = parseInt($(this).attr("data-start-page")); } // LOAD THE CLICKED PAGE NUMBER else { pageNumber = $(this).attr("data-page-number"); // UPDATE ATTRIBUTES $(".staff-directory-load-page", $(this).closest(".staff-directory-pagination-list")).removeClass("active"); $(this).addClass("active"); } // UPDATE ATTRIBUTES $($(this).attr("data-list-container")).addClass("loading").html('
'); // BUILD THE PAGE _this.BuildAccountsPage({ "pageNumber": pageNumber, "listContainer": $(this).attr("data-list-container"), "roleIDs": $(this).attr("data-role-ids"), "roleGroup": $(this).attr("data-role-group"), "scrollView": true }); // AUTO FOCUS THE PANEL IF KEYDOWN if(e.type == "keydown") { $(this).closest(".org-details-tab-panel").focus(); } } }); // VIP PAGE CLICK/KEYDOWN $(document).off("click keydown", "#pmi-9894 .load-vips-page").on("click keydown", "#pmi-9894 .load-vips-page", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); var pageNumber = ""; // IF THE CLICKED BUTTON IS TO LOAD A NEW PAGE SET if($(this).hasClass("staff-directory-pagination-skip")) { // REBUILD THE PAGINATION CONTROLS var pagination = _this.BuildPaginationControl({ "numberOfPages": parseInt($(this).attr("data-number-of-pages")), "pageButtonClass": $(this).attr("data-page-button-class"), "loadPageFor": $(this).attr("data-load-pages-for"), "panelID": $(this).attr("data-panel"), "startPage": parseInt($(this).attr("data-start-page")), "attributes": [ 'data-list-container="' + $(this).attr("data-panel") + ' .staff-directory-panel-list"', 'data-role-group="' + $(this).attr("data-name") + '"', ] }); // ADD THE NEW PAGINATION CONTROLS TO THE DOM $($(this).attr("data-panel") + " .staff-directory-pagination-list").replaceWith(pagination); pageNumber = parseInt($(this).attr("data-start-page")); } // LOAD THE CLICKED PAGE NUMBER else { pageNumber = $(this).attr("data-page-number"); // UPDATE ATTRIBUTES $(".staff-directory-load-page", $(this).closest(".staff-directory-pagination-list")).removeClass("active"); $(this).addClass("active"); } // UPDATE ATTRIBUTES $(".staff-directory-load-page", $(this).closest(".staff-directory-pagination-list")).removeClass("active"); $(this).addClass("active"); $($(this).attr("data-list-container")).addClass("loading").html('
'); // BUILD THE PAGE _this.BuildVipsPage({ "pageNumber": $(this).attr("data-page-number"), "listContainer": $(this).attr("data-list-container"), "scrollView": true }); // AUTO FOCUS THE PANEL IF KEYDOWN if(e.type == "keydown") { $(this).closest(".org-details-tab-panel").focus(); } } }); // ACCOUNT ARROW CLICK/KEYDOWN $(document).off("click keydown", "#pmi-9894 .load-account").on("click keydown", "#pmi-9894 .load-account", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); // IF CURRENTLY EXPANDED if($(this).attr("aria-expanded") == "true") { // UPDATE ATTRIBUTES $(this).attr("aria-expanded", "false"); // CLOSE THE CONTAINER $("#staff-directory-additional-info-" + $(this).attr("data-relationship-id")).attr("aria-hidden", "true").slideUp(); } // NOT CURRENTLY EXPANDED else { // UPDATE ATTRIBUTES $(this).attr("aria-expanded", "true"); // ACCOUNT DATA HAS NOT BEEN REQUESTED YET if($(this).attr("data-loaded") == "false") { // ADD THE ADDITIONAL ACCOUNT INFO _this.BuildAdditionalAccountInfo({ "accountID": $(this).attr("data-account-id"), "relationshipID": $(this).attr("data-relationship-id") }); // MARK LOADED SO WE DO NOT CALL THE API AGAIN $(this).attr("data-loaded", "true"); } // ACCOUNT DATA HAS ALREADY BEEN RETRIEVED SO JUST RE-OPEN THE CONTAINER else { // OPEN THE CONTAINER $("#staff-directory-additional-info-" + $(this).attr("data-relationship-id")).attr("aria-hidden", "false").slideDown(); } } } }); // BREADCRUMB CLICK/KEYDOWN $(document).off("click keydown", "#pmi-9894 .staff-directory-breadcrumb > a").on("click keydown", "#pmi-9894 .staff-directory-breadcrumb > a", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); // UPDATE ORGANIZATION ID _this.OrganizationID = $(this).attr("data-org-id"); // UPDATE BREADCRUMBS _this.Breadcrumbs.splice(parseInt($(this).attr("data-breadcrumb-index"))); // SET THE APP TO LOADING STATE $("#pmi-9894 .ui-widget-detail").addClass("loading"); // REBUILD THE VIEW _this.BuildView({ "scrollView": true }); } }); // MOBILE SELECT CHANGE $(document).off("change", "#pmi-9894 .org-details-select").on("change", "#pmi-9894 .org-details-select", function(e) { e.preventDefault(); switchTabs({ "clickedTab": $("option:selected", this).attr("data-tab-id") }); }); // EMAIL FORM OPEN $(document).off("click keydown", "#pmi-9894 .staff-directory-email-form-button").on("click keydown", "#pmi-9894 .staff-directory-email-form-button", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); // SET THE HEADER TEXT $("#pmi-9894 .staff-directory-email-form-header").text($(this).text()); // OPEN THE EMAIL FORM _this.OpenEmailForm({ "HeaderText": $(this).text(), "EndPoint": $(this).attr("data-email-endpoint"), "ID": $(this).attr("data-id") }); } }); // EMAIL FORM CLOSE var closeButtonElements = "#staff-directory-email-9894 .staff-directory-email-form-cancel, #staff-directory-email-9894 .staff-directory-email-form-ok, #staff-directory-email-9894 .staff-directory-email-register, #staff-directory-email-9894 .staff-directory-get-email-cancel"; $(document).off("click keydown", closeButtonElements).on("click keydown", closeButtonElements, function(e) { if(_this.AllyClick(e)) { e.preventDefault(); // CLOSE THE EMAIL FORM CloseDialogOverlay("staff-directory-email-9894"); } }); // SEND EMAIL $(document).off("submit", "#staff-directory-email-9894 .staff-directory-email-form").on("submit", "#staff-directory-email-9894 .staff-directory-email-form", function(e) { e.preventDefault(); // UPDATE BUTTON ATTRIBUTES var sendButton = $(".staff-directory-email-form-send", this); var sendButtonText = $("span", sendButton).text(); $(sendButton).attr("disabled", "disabled"); $("span", sendButton).text("Working..."); var emailForm = $(this); var okButton = $(".staff-directory-email-form-ok", this); var cancelButton = $(".staff-directory-email-form-cancel", this); // PREP THE FIELDS var from = $.trim($(".staff-directory-email-form-from", this).val()); var subject = $.trim($(".staff-directory-email-form-subject", this).val()); var body = $.trim($(".staff-directory-email-form-body", this).val()); var endPoint = $(".staff-directory-email-form-endpoint", this).val(); var id = $(".staff-directory-email-form-account-id", this).val(); // SET UP THE EMAIL var apiEndPoint = ""; var to = ""; // EMAIL AN ORGANIZATION if(endPoint == "org") { Bb.WCM.API.BBComm.GetOrganization(id,false).then(function(data){to = data.emailAddress;callSendEmail(to,from,subject,body,sendButton,cancelButton,okButton);}); } // EMAIL A STAFF PERSON else {Bb.WCM.API.BBComm.GetAccount(id).then(function(data){to = data.directoryEmail;callSendEmail(to,from,subject,body,sendButton,cancelButton,okButton);}); } }); //HideEmail FUNCTION$(document).off("click", ".HideEmail").on("click", ".HideEmail", function(e) { var endPoint = $(this).attr("data-email-endpoint");var id = ""; // EMAIL AN ORGANIZATION if(endPoint == "org") {id = this.getAttribute("data-id"); //apiEndPoint = Bb.WCM.API.BBComm.GetOrganization(id,false);Bb.WCM.API.BBComm.GetOrganization(id,false).then(function(data){ emailAddress = data.emailAddress;document.location = "mailto:" + emailAddress}); } // EMAIL A STAFF PERSON else {id = this.getAttribute("data-account-id"); //apiEndPoint = BbComms9894.Account({ "accountID": id});Bb.WCM.API.BBComm.GetAccount(id).then(function(data){emailAddress = data.directoryEmail;document.location = "mailto:" + emailAddress}); } }); // CAPTCHA DIALOG OPEN $(document).off("click keydown", "#pmi-9894 .staff-directory-email-captcha-button").on("click keydown", "#pmi-9894 .staff-directory-email-captcha-button", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); var dialogHeader = "You are almost there!"; var dialogContent = "You are one step away from getting " + $(this).attr("data-name") + "'s email address."; // SET THE EMAIL FOR HEADER $("#pmi-9894 .staff-directory-email-form-header").text(dialogHeader); // OPEN THE EMAIL FORM _this.OpenCaptchaForm({ "HeaderText": dialogHeader, "ContentText": dialogContent, "EndPoint": $(this).attr("data-email-endpoint"), "ID": $(this).attr("data-id"), "Name":$(this).attr("data-name") }); } }); // GET EMAIL ADDRESS FROM CAPTCHA DIALOG $(document).off("click keydown", "#staff-directory-email-9894 .staff-directory-get-email").on("click keydown", "#staff-directory-email-9894 .staff-directory-get-email", function(e) { if(_this.AllyClick(e)) { e.preventDefault(); // UPDATE BUTTON ATTRIBUTES var button = $(this); var buttonText = $("span", this).text(); $(button).attr("disabled", "disabled"); $("span", button).text("Working..."); var endPoint = $(this).attr("data-endpoint"); var id = $(this).attr("data-account-id"); var apiEndPoint = "";var emailAddress = ""; var organizationName = $(this).attr("data-name");Bb.WCM.API.ReCaptcha.VerifyCaptcha(Token).then(function(response){var _response = JSON.parse(response); if(_response.Success == false){$("#captcha-email-address").text("ReCaptcha verify failed, please refresh the page !"); grecaptcha.reset();}else{if (_response.score < 0.5) {$("#captcha-email-address").text("User is not human being !"); grecaptcha.reset();}else {// EMAIL AN ORGANIZATIONif(endPoint == "org") {//apiEndPoint = Bb.WCM.API.BBComm.GetOrganization(id,false);Bb.WCM.API.BBComm.GetOrganization(id,false).then(function(data){emailAddress = data.emailAddress; // SHOW THE EMAIL ADDRESS _this.ShowEmailAddress({ "EmailAddress": emailAddress, "Organization": organizationName });}); }// EMAIL A STAFF PERSONelse {//apiEndPoint = BbComms9894.Account({ "accountID": id});Bb.WCM.API.BBComm.GetAccount(id).then(function(data){emailAddress = data.directoryEmail; // SHOW THE EMAIL ADDRESS _this.ShowEmailAddress({ "EmailAddress": emailAddress, "Organization": organizationName });});}}}}); } }); // TAB CLICK/KEYDOWN $(document).off("click keydown", "#pmi-9894 .org-details-tab").on("click keydown", "#pmi-9894 .org-details-tab", function(e) { if(e.type == "click") { e.preventDefault(); switchTabs({ "clickedTab": $(this) }); } if(e.type == "keydown") { // ONLY CONSUME IF NOT USING ALT KEY if (!e.altKey) { switch(e.keyCode) { // MOVE ONE STEP BACKWARDS case _this.KeyCodes.left: case _this.KeyCodes.up: if(!e.ctrlKey) { // CTRL+ARROW MOVES FOCUS FROM PANEL TO OPEN TAB - MAKE SURE THAT IS NOT BEING PRESSED TOO e.preventDefault(); e.stopPropagation(); // GET THE PREVIOUS TAB var prevTab; if($(this).is(":first-child")) { prevTab = $("#pmi-9894 .org-details-tab:last-child"); // LAST TAB } else { prevTab = $(this).prev(".org-details-tab"); // PREVIOUS TAB } // SWITCH THE TABS switchTabs({ "clickedTab": prevTab }); } break; // MOVE ONE STEP FORWARDS case _this.KeyCodes.right: case _this.KeyCodes.down: if(!e.ctrlKey) { // CTRL+ARROW MOVES FOCUS FROM PANEL TO OPEN TAB - MAKE SURE THAT IS NOT BEING PRESSED TOO e.preventDefault(); e.stopPropagation(); // GET THE NEXT TAB var nextTab; if($(this).is(":last-child")) { nextTab = $("#pmi-9894 .org-details-tab:first-child"); // FIRST TAB } else { nextTab = $(this).next(".org-details-tab"); // NEXT TAB } // SWITCH THE TABS switchTabs({ "clickedTab": nextTab }); } break; // JUMP TO FIRST TAB case _this.KeyCodes.home: e.preventDefault(); e.stopPropagation(); switchTabs({ "clickedTab": $("#pmi-9894 .org-details-tab:first-child") }); break; // JUMP TO LAST TAB case _this.KeyCodes.end: e.preventDefault(); e.stopPropagation(); switchTabs({ "clickedTab": $("#pmi-9894 .org-details-tab:last-child") }); break; } } } }); // SWITCH TABS FUNCTION function switchTabs(props) { // props.clickedTab// SWITCH TAB$("#pmi-9894 .org-details-tab").removeClass("active").attr("aria-selected", "false").attr("tabindex", "-1");$(props.clickedTab).addClass("active").attr("aria-selected", "true").attr("tabindex", "0").focus();// SWITCH PANEL$("#pmi-9894 .org-details-tab-panel").attr("aria-hidden", "true");$("#pmi-9894 .org-details-tab-panel[aria-labelledby='" + $(props.clickedTab).attr("id") + "']").attr("aria-hidden", "false"); // LOAD THE DATA IF IT IS NOT LOADED YET if($(props.clickedTab).attr("data-loaded") == "false") { switch($(props.clickedTab).attr("data-end-point")) { case "accounts": _this.BuildAccounts({ "tab": $(props.clickedTab) }); break; case "vips": _this.BuildVips({ "tab": $(props.clickedTab) }); break; } // MARK LOADED $(props.clickedTab).attr("data-loaded", "true"); }}function callSendEmail(to,from,subject,body,sendButton,cancelButton,okButton){ // SEND THE EMAIL SendEmail(to, from, subject, body, function(response) { // CONVERT STRING RESPONSE TO JSON response = JSON.parse(response.replace(/\[|\]/g, "")); // SUCCESSFUL if(response.success == "true") { // SHOW SUCCESS MESSAGE $(".staff-directory-form-fields", emailForm).append('' + '
' + '' + '
Thank You!
' + '
Your email has been successfully sent.
' + '
' + ''); } // ERROR else { // SHOW ERROR MESSAGE $(this).swalert({ alertText: "An error occurred when trying to send the email to " + to + ". Please refresh the page and try again. If you continue to experience this error, please contact the Blackboard WCM Support team with the following error message: " + response.errormessage, titleText: 'Uh Oh!', alertType: 'critical', buttonType: 'ok', onYes: function () {}, onNo: function () {}, onOk: function () {}, params: {} }); } // UPDATE BUTTON ATTRIBUTES $(sendButton).removeAttr("disabled"); $("span", sendButton).text(sendButtonText); $(sendButton).hide(); $(cancelButton).hide(); $(okButton).show(); })} }, "OpenEmailForm": function(props) { // props.HeaderText, props.EndPoint, props.ID OpenDialogOverlay("staff-directory-email-9894", { "LoadType": "H", "LoadContent":'
' + '
You must log in before sending an email. If you don\'t have an account yet, please register here.
' + '' + '
' }); }, "OpenCaptchaForm": function(props) { // props.HeaderText, props.ContentText, props.EndPoint, props.ID, props.Name OpenDialogOverlay("staff-directory-email-9894", { "LoadType": "H", "LoadContent": '
' + '
' + props.HeaderText + '
' + '
' + props.ContentText + '
' + '' + '' + '
' + '
' }); }, "ShowEmailAddress": function(props) { // props.Emailaddress, props.Organization OpenDialogOverlay("staff-directory-email-9894", { "LoadType": "H", "LoadContent": '
' + '
Email address of ' + props.Organization + '
' + '
' + props.EmailAddress + '
' + '' + '
' }); }, "GetStaffDirectoryTemplate": function() { var emailForm = ''; // EMAIL FORM OR CAPTCHA RETRIEVAL if(this.EmailMethod == "form" || this.EmailMethod == "captcha") { emailForm +='
' + '
' + '
' + '
' + '' + '
' + '
' + '
'; } return'
' + '
' + '
' + '
' + '
' + '' + '|' + 'Clear search filter' + '
' + '
' + '' + '
' + '
' + '
' + '
' + '
' + '
' + emailForm; }, "GenerateID": function() { var alphabet = ["A", "a", "B", "b", "C", "c", "D", "d", "E", "e", "F", "f", "G", "g", "H", "h", "I", "i", "J", "j", "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", "P", "p", "Q", "q", "R", "r", "S", "s", "T", "t", "U", "u", "V", "v", "W", "w", "X", "x", "Y", "y", "Z", "z"]; var letters = [], numbers = []; for(var i = 1; i <= 3; i++) { letters.push(alphabet[Math.floor(Math.random() * alphabet.length)]); // PUSH RANDOM LETTER } for(var i = 1; i <= 3; i++) { numbers.push(Math.floor((Math.random() * 10) + 1)); // RANDOM NUMBER BETWEEN 1 AND 10 } // COMBINE ARRAYS var combined = letters.concat(numbers); // RANDOMIZE LETTERS AND NUMBERS function sortRandom(a, b) { return 0.5 - Math.random(); } // JOIN LETTERS AND NUMBERS var id = combined.sort(sortRandom); id = id.join(""); // RETURN THE GENERATED ID return id; }, "CheckDevice": function() { // CHECK IF USER IS ON IOS if(navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) { $("html").addClass("ios"); } }, "CheckKey": function(props) { // props.object, props.key if(props.object.hasOwnProperty(props.key)) return true; return false; }, "AllyClick": function(event) { if(event.type == "click") { return true; } else if(event.type == "keydown" && (event.keyCode == this.KeyCodes.space || event.keyCode == this.KeyCodes.enter)) { return true; } else { return false; } }, };StaffDirectory9894.Init();});