{"version":3,"sources":["../js/Filter.js"],"names":["g_oFilter","Filter","this","oFilters","oFilterValues","oMatchingFilters","g_iActiveFilterId","oActiveFilters","g_bFiltersAnimating","c_szFilter_Key_User","c_szFilter_Key_Role","c_szFilter_Key_AnnotationStatus","c_szFilter_Key_AnnotationColour","c_szFilter_Key_AnnotationContent","c_szFilter_Key_ReplyContent","c_szFilter_Value_Blue","c_szFilter_Value_Red","c_szFilter_Value_Green","c_szFilter_Value_Orange","c_szFilter_Value_Purple","c_szFilter_Value_Cyan","c_szFilter_Value_Yellow","c_szFilter_Value_Magenta","c_szFilter_Value_Grey","c_szFilter_Value_Initial","c_szFilter_Value_Approved","c_szFilter_Value_Rejected","c_szFilter_Value_Query","c_szFilter_Value_ToDo","c_szFilter_Message_Filter","c_szFilter_Message_Help","c_szFilter_Message_Reset","c_szFilter_Message_Active","c_szFilter_Message_Remove","c_szFilter_Message_IncludeExclude","c_szFilter_Message_Unavailable","c_szFilter_Message_NoFilters","c_szFilter_Message_AnnotationCount","c_szFilter_Message_UnableToFilter","prototype","setupFilters","oApproval","setupFilters_System","setupFilters_Custom","setupActiveFilterAvailibility","resetFilterOptions","renderActiveFilters","setupFilters_System_AnnotationColour","setupFilters_System_AnnotationStatus","undefined","approvers","i","length","oApprover","userDetails","FirstName","indexOf","push","szUserName","LastName","Key","Value","EmailAddress","role","j","approverData","oApproverData","Available","isFilterAvailable","toggleAnnotationFilters","$","css","height","slideDown","duration","easing","progress","resizeAnnotationListItems","complete","hide","slideUp","html","toString","show","updateFilterOptions","id","text","children","remove","toLowerCase","addFilterOption","getMatchesByFilters","getMatchingFilters","concat","getMatchesByValues","getMatchingValues","sort","sortFilters","isActiveFilter","key","value","removeQuotesFromValue","append","val","scrollTop","clickFilterOption","click","find","selectFilterOption","oItem","removeClass","addClass","selectNextFilterOption","next","first","scrollToSelectedFilterOption","selectPreviousFilterOption","prev","last","offset","top","addActiveFilter","addQuotesToValue","Id","Include","removeActiveFilter","iActiveFilterIndex","getActiveFilterIndex","splice","toggleActiveFilter","resetActiveFilters","bRebuildAnnotationsList","renderActiveFilter","oAnnotationCanvas","g_oViewer","getCanvas","g_oCompare","getAnnotationCanvasId","oArtworkCanvas","getLinkedArtworkCanvas","g_szCanvasId","g_oAnnotations","rebuildAnnotationList","oActiveFilter","szClass","szIcon","szTitle","updateActiveFilterMessage","applyAnnotationFilters","oAnnotations","oFilteredAnnotations","annotationMatchesFilters","replace","countFullAnnotations","oAnnotation","bMatchesFilters","oFilter","annotationMatchesFilter","bMatchesFilter","getActiveOrFilters","annotationMatchesFilter_AnnotationContent","annotationMatchesFilter_ReplyContent","annotationMatchesFilter_Colour","annotationMatchesFilter_Status","annotationMatchesFilter_Custom","g_szTextContent","g_oReplies","filter","reply","getStringColour","g_szColour","getStringStatuses","g_oStatuses","match","g_szAuthorEmail","isContentFilter","include","filterValue","getMatchesByFilter","values","oLowerCaseValues","map","getMatchesByValue","a","b","getFilterList","szList","g_iParentAnnotationId","document","on","event","target","parents","window"],"mappings":"AAaA,IAAIA,UAAY,IAEf,WACA,aAKA,SAASC,SAGRC,KAAKC,SAAW,GAGhBD,KAAKE,cAAgB,GAGrBF,KAAKG,iBAAmB,GAGxBH,KAAKI,kBAAoB,EAGzBJ,KAAKK,eAAiB,GAGtBL,KAAKM,qBAAsB,EAG3BN,KAAKO,oBAAsB,GAC3BP,KAAKQ,oBAAsB,GAC3BR,KAAKS,gCAAkC,GACvCT,KAAKU,gCAAkC,GACvCV,KAAKW,iCAAmC,GACxCX,KAAKY,4BAA8B,GAGnCZ,KAAKa,sBAAwB,GAC7Bb,KAAKc,qBAAuB,GAC5Bd,KAAKe,uBAAyB,GAC9Bf,KAAKgB,wBAA0B,GAC/BhB,KAAKiB,wBAA0B,GAC/BjB,KAAKkB,sBAAwB,GAC7BlB,KAAKmB,wBAA0B,GAC/BnB,KAAKoB,yBAA2B,GAChCpB,KAAKqB,sBAAwB,GAC7BrB,KAAKsB,yBAA2B,GAChCtB,KAAKuB,0BAA4B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OAAQ,KAAMA,QAAQ,OAAQ,MAMpDlF,EAAEsH,UAAUC,GAAG,QAAS,SAAUC,OAG6B,GAA1DxH,EAAEwH,MAAMC,QAAQC,QAAQ,wBAAwB5I,QAAkC,uBAAnB0I,MAAMC,OAAO1G,IAG/Ef,EAAE,wBAAwBS,SAO5BkH,OAAOhM,OAASA,OAvkCjB","file":"Filter-58e77dfbb0.js","sourcesContent":["/*\r\n* Copyright (c) 2020 SGS Europe. All rights reserved.\r\n*\r\n* This program is the CONFIDENTIAL and PROPRIETARY property of 2020 SGS Europe.\r\n* Any unauthorised use, reproduction, or transfer of this program is strictly\r\n* prohibited.\r\n*\r\n* File Name:\tFilter.js\r\n*\r\n* Description:\tJavaScript code for Filter module.\r\n*\r\n*/\r\n\r\nvar g_oFilter = {};\r\n\r\n(function () {\r\n\t\"use strict\";\r\n\r\n\t/**\r\n\t * Create the Filter object.\r\n\t */\r\n\tfunction Filter() {\r\n\r\n\t\t// The master list of filters.\r\n\t\tthis.oFilters = [];\r\n\r\n\t\t// The list of filter values.\r\n\t\tthis.oFilterValues = [];\r\n\r\n\t\t// The list of matching filters.\r\n\t\tthis.oMatchingFilters = [];\r\n\r\n\t\t// The id of the next active filter.\r\n\t\tthis.g_iActiveFilterId = 1;\r\n\r\n\t\t// The list of active filters.\r\n\t\tthis.oActiveFilters = [];\r\n\r\n\t\t// If a section is actively animating.\r\n\t\tthis.g_bFiltersAnimating = false;\r\n\r\n\t\t// Constant keys to be set.\r\n\t\tthis.c_szFilter_Key_User = \"\";\r\n\t\tthis.c_szFilter_Key_Role = \"\";\r\n\t\tthis.c_szFilter_Key_AnnotationStatus = \"\";\r\n\t\tthis.c_szFilter_Key_AnnotationColour = \"\";\r\n\t\tthis.c_szFilter_Key_AnnotationContent = \"\";\r\n\t\tthis.c_szFilter_Key_ReplyContent = \"\";\r\n\r\n\t\t// Constant values to be set.\r\n\t\tthis.c_szFilter_Value_Blue = \"\";\r\n\t\tthis.c_szFilter_Value_Red = \"\";\r\n\t\tthis.c_szFilter_Value_Green = \"\";\r\n\t\tthis.c_szFilter_Value_Orange = \"\";\r\n\t\tthis.c_szFilter_Value_Purple = \"\";\r\n\t\tthis.c_szFilter_Value_Cyan = \"\";\r\n\t\tthis.c_szFilter_Value_Yellow = \"\";\r\n\t\tthis.c_szFilter_Value_Magenta = \"\";\r\n\t\tthis.c_szFilter_Value_Grey = \"\";\r\n\t\tthis.c_szFilter_Value_Initial = \"\";\r\n\t\tthis.c_szFilter_Value_Approved = \"\";\r\n\t\tthis.c_szFilter_Value_Rejected = \"\";\r\n\t\tthis.c_szFilter_Value_Query = \"\";\r\n\t\tthis.c_szFilter_Value_ToDo = \"\";\r\n\r\n\t\t// Contant messages to be set.\r\n\t\tthis.c_szFilter_Message_Filter = \"\";\r\n\t\tthis.c_szFilter_Message_Help = \"\";\r\n\t\tthis.c_szFilter_Message_Reset = \"\";\r\n\t\tthis.c_szFilter_Message_Active = \"\";\r\n\t\tthis.c_szFilter_Message_Remove = \"\";\r\n\t\tthis.c_szFilter_Message_IncludeExclude = \"\";\r\n\t\tthis.c_szFilter_Message_Unavailable = \"\";\r\n\t\tthis.c_szFilter_Message_NoFilters = \"\";\r\n\t\tthis.c_szFilter_Message_AnnotationCount = \"\";\r\n\t\tthis.c_szFilter_Message_UnableToFilter = \"\";\r\n\t}\r\n\r\n\t/**\r\n\t * Setup the filters for an approval.\r\n\t * @param {object} oApproval - The approval to be used for setup.\r\n\t */\r\n\tFilter.prototype.setupFilters = function (oApproval) {\r\n\r\n\t\t// Reset the filters objects.\r\n\t\tg_oFilter.oFilters = [];\r\n\t\tg_oFilter.oFilterValues = [];\r\n\t\tg_oFilter.oMatchingFilters = [];\r\n\r\n\t\t// Setup the system filters.\r\n\t\tg_oFilter.setupFilters_System(oApproval);\r\n\r\n\t\t// Setup the custom filters.\r\n\t\tg_oFilter.setupFilters_Custom(oApproval);\r\n\r\n\t\t// Set the availibility of any existing filters.\r\n\t\tg_oFilter.setupActiveFilterAvailibility();\r\n\r\n\t\t// Set the filters to the inital list and render.\r\n\t\tg_oFilter.resetFilterOptions(\"divAnnListFilterBox\");\r\n\t\tg_oFilter.renderActiveFilters(false);\r\n\t};\r\n\r\n\t/**\r\n\t * Setup the system filter.\r\n\t * @param {object} oApproval - The approval to be used.\r\n\t */\r\n\tFilter.prototype.setupFilters_System = function (oApproval) {\r\n\t\t\r\n\t\t// Add the annotation colour system filter.\r\n\t\tg_oFilter.setupFilters_System_AnnotationColour();\r\n\r\n\t\t// Add the annotation status system filter.\r\n\t\tg_oFilter.setupFilters_System_AnnotationStatus();\r\n\r\n\t\t// If we have an approval and approvers.\r\n\t\tif (oApproval != null && oApproval.approvers != undefined) {\r\n\r\n\t\t\t// Loop through each of the approvers on the approval.\r\n\t\t\tfor (var i = 0; i < oApproval.approvers.length; i++) {\r\n\r\n\t\t\t\t// Extract the approver.\r\n\t\t\t\tvar oApprover = oApproval.approvers[i];\r\n\r\n\t\t\t\t// If this user has a first name.\r\n\t\t\t\tif (oApprover.userDetails.FirstName != \"\") {\r\n\r\n\t\t\t\t\t// If this does not exist in the filters.\r\n\t\t\t\t\tif (g_oFilter.oFilters.indexOf(g_oFilter.c_szFilter_Key_User) == -1) {\r\n\r\n\t\t\t\t\t\t// Add the filter.\r\n\t\t\t\t\t\tg_oFilter.oFilters.push(g_oFilter.c_szFilter_Key_User);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Determine the user name to be used as a filter value.\r\n\t\t\t\t\tvar szUserName = oApprover.userDetails.FirstName;\r\n\r\n\t\t\t\t\t// Add the last name if set.\r\n\t\t\t\t\tif (oApprover.userDetails.LastName != \"\") {\r\n\t\t\t\t\t\tszUserName += \" \" + oApprover.userDetails.LastName;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// If this user does not exist in the filter values.\r\n\t\t\t\t\tif (g_oFilter.oFilterValues.indexOf(szUserName) == -1) {\r\n\r\n\t\t\t\t\t\t// Add it to the list.\r\n\t\t\t\t\t\tg_oFilter.oFilterValues.push(szUserName);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add the user to the list of matches.\r\n\t\t\t\t\tg_oFilter.oMatchingFilters.push({\r\n\t\t\t\t\t\tKey: g_oFilter.c_szFilter_Key_User,\r\n\t\t\t\t\t\tValue: szUserName,\r\n\t\t\t\t\t\tEmailAddress: oApprover.userDetails.EmailAddress\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If this user has a role.\r\n\t\t\t\tif (oApprover.role != \"\") {\r\n\r\n\t\t\t\t\t// If this does not exist in the filters.\r\n\t\t\t\t\tif (g_oFilter.oFilters.indexOf(g_oFilter.c_szFilter_Key_Role) == -1) {\r\n\r\n\t\t\t\t\t\t// Add the filter.\r\n\t\t\t\t\t\tg_oFilter.oFilters.push(g_oFilter.c_szFilter_Key_Role);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// If this user does not exist in the filter values.\r\n\t\t\t\t\tif (g_oFilter.oFilterValues.indexOf(oApprover.role) == -1) {\r\n\r\n\t\t\t\t\t\t// Add it to the list.\r\n\t\t\t\t\t\tg_oFilter.oFilterValues.push(oApprover.role);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add the user to the list of matches.\r\n\t\t\t\t\tg_oFilter.oMatchingFilters.push({\r\n\t\t\t\t\t\tKey: g_oFilter.c_szFilter_Key_Role,\r\n\t\t\t\t\t\tValue: oApprover.role,\r\n\t\t\t\t\t\tEmailAddress: oApprover.userDetails.EmailAddress\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Setup the annotation colour system filters. \r\n\t */\r\n\tFilter.prototype.setupFilters_System_AnnotationColour = function () {\r\n\r\n\t\t// Add the annotation colour filter.\r\n\t\tg_oFilter.oFilters.push(g_oFilter.c_szFilter_Key_AnnotationColour);\r\n\r\n\t\t// Add the annotation colour values.\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Blue);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Red);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Green);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Orange);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Purple);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Cyan);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Yellow);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Magenta);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Grey);\r\n\r\n\t\t// Add each of the matches.\r\n\t\tg_oFilter.oMatchingFilters.push({\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Blue,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Red,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Green,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Orange,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Purple,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Cyan,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Yellow,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Magenta,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationColour,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Grey,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Setup the annotation status system filters.\r\n\t */\r\n\tFilter.prototype.setupFilters_System_AnnotationStatus = function () {\r\n\r\n\t\t// Add the status colour filter.\r\n\t\tg_oFilter.oFilters.push(g_oFilter.c_szFilter_Key_AnnotationStatus);\r\n\r\n\t\t// Add the annotation status values.\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Initial);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Approved);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Rejected);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_Query);\r\n\t\tg_oFilter.oFilterValues.push(g_oFilter.c_szFilter_Value_ToDo);\r\n\r\n\t\t// Add each of the matches.\r\n\t\tg_oFilter.oMatchingFilters.push({\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationStatus,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Initial,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationStatus,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Approved,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationStatus,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Rejected,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationStatus,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_Query,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t}, {\r\n\t\t\tKey: g_oFilter.c_szFilter_Key_AnnotationStatus,\r\n\t\t\tValue: g_oFilter.c_szFilter_Value_ToDo,\r\n\t\t\tEmailAddress: \"\"\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Setup the custom filters.\r\n\t * @param {object} oApproval - The approval to be used for setup.\r\n\t */\r\n\tFilter.prototype.setupFilters_Custom = function (oApproval) {\r\n\r\n\t\t// If we have an approval and approvers.\r\n\t\tif (oApproval != null && oApproval.approvers != undefined) {\r\n\r\n\t\t\t// Loop through each of the approvers on the approval.\r\n\t\t\tfor (var i = 0; i < oApproval.approvers.length; i++) {\r\n\r\n\t\t\t\t// Extract the approver.\r\n\t\t\t\tvar oApprover = oApproval.approvers[i];\r\n\r\n\t\t\t\t// Loop through each of the filter values.\r\n\t\t\t\tfor (var j = 0; j < oApprover.approverData.length; j++) {\r\n\r\n\t\t\t\t\t// Extract the approver data.\r\n\t\t\t\t\tvar oApproverData = oApprover.approverData[j];\r\n\r\n\t\t\t\t\t// If this filter is not in our list.\r\n\t\t\t\t\tif (g_oFilter.oFilters.indexOf(oApproverData.Key) == -1) {\r\n\r\n\t\t\t\t\t\t// Add it to the list.\r\n\t\t\t\t\t\tg_oFilter.oFilters.push(oApproverData.Key);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// If this value does not exist in the filter values.\r\n\t\t\t\t\tif (g_oFilter.oFilterValues.indexOf(oApproverData.Value) == -1) {\r\n\r\n\t\t\t\t\t\t// Add it to the list.\r\n\t\t\t\t\t\tg_oFilter.oFilterValues.push(oApproverData.Value);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add the match to the list against the user.\r\n\t\t\t\t\tg_oFilter.oMatchingFilters.push({\r\n\t\t\t\t\t\tKey: oApproverData.Key,\r\n\t\t\t\t\t\tValue: oApproverData.Value,\r\n\t\t\t\t\t\tEmailAddress: oApprover.userDetails.EmailAddress\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Setup the active filter availibility. \r\n\t */\r\n\tFilter.prototype.setupActiveFilterAvailibility = function () {\r\n\r\n\t\t// Loop through each of the active filters.\r\n\t\tfor (var i = 0; i < g_oFilter.oActiveFilters.length; i++) {\r\n\r\n\t\t\t// Set the availability of this filter.\r\n\t\t\tg_oFilter.oActiveFilters[i].Available = g_oFilter.isFilterAvailable(g_oFilter.oActiveFilters[i].Key, g_oFilter.oActiveFilters[i].Value);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Toggle the annotation filters section. \r\n\t */\r\n\tFilter.prototype.toggleAnnotationFilters = function () {\r\n\r\n\t\t// If we are not already animating the filters section.\r\n\t\tif (!g_oFilter.g_bFiltersAnimating) {\r\n\r\n\t\t\t// Set that the section is currently animating.\r\n\t\t\tg_oFilter.g_bFiltersAnimating = true;\r\n\r\n\t\t\t// If the user settings are currently shown.\r\n\t\t\tif ($(\"#divAnnFilters\").css(\"display\") == \"none\") {\r\n\r\n\t\t\t\t// Ensure the annotation divs are the correct height.\r\n\t\t\t\t$(\"#divAnnotationsContainer\").height($(\"#divViewerCell\").height());\r\n\t\t\t\t$(\"#divAnnDiv\").height($(\"#divViewerCell\").height());\r\n\r\n\t\t\t\t// Slide the div down.\r\n\t\t\t\t$(\"#divAnnFilters\").slideDown({\r\n\t\t\t\t\tduration: 200,\r\n\t\t\t\t\teasing: 'swing',\r\n\t\t\t\t\tprogress: function () {\r\n\r\n\t\t\t\t\t\t// Resize the annotations list items.\r\n\t\t\t\t\t\tresizeAnnotationListItems();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcomplete: function () {\r\n\r\n\t\t\t\t\t\t// Set that we are no longer animating.\r\n\t\t\t\t\t\tg_oFilter.g_bFiltersAnimating = false;\r\n\r\n\t\t\t\t\t\t// Hide the annotation number.\r\n\t\t\t\t\t\t$(\"#divFilterAnnotationsNumber\").hide();\r\n\r\n\t\t\t\t\t\t// Resize the annotations list items.\r\n\t\t\t\t\t\tresizeAnnotationListItems();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t// If the user settings are currently not shown.\r\n\t\t\telse {\r\n\r\n\t\t\t\t// Slide the div up.\r\n\t\t\t\t$(\"#divAnnFilters\").slideUp({\r\n\t\t\t\t\tduration: 200,\r\n\t\t\t\t\teasing: 'swing',\r\n\t\t\t\t\tprogress: function () {\r\n\r\n\t\t\t\t\t\t// Resize the annotations list items.\r\n\t\t\t\t\t\tresizeAnnotationListItems();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcomplete: function () {\r\n\r\n\t\t\t\t\t\t// Set that we are no longer animating.\r\n\t\t\t\t\t\tg_oFilter.g_bFiltersAnimating = false;\r\n\r\n\t\t\t\t\t\t// Populate and show the annotation number if required.\r\n\t\t\t\t\t\tif (g_oFilter.oActiveFilters.length > 0) {\r\n\t\t\t\t\t\t\t$(\"#divFilterAnnotationsNumber\").html(g_oFilter.oActiveFilters.length.toString());\r\n\t\t\t\t\t\t\t$(\"#divFilterAnnotationsNumber\").show();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Resize the annotations list items.\r\n\t\t\t\t\t\tresizeAnnotationListItems();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Update the filter options in the drop down.\r\n\t * @param {string} id - The id of the dropdown to update.\r\n\t * @param {string} text - The text that has been entered into the textbox.\r\n\t */\r\n\tFilter.prototype.updateFilterOptions = function (id, text) {\r\n\r\n\t\t// Remove all filters from the list.\r\n\t\t$(\"#\" + id).children().remove();\r\n\r\n\t\t// Always add an option for the annotation content, unless the text already starts with this.\r\n\t\tif (text.toLowerCase().indexOf(g_oFilter.c_szFilter_Key_AnnotationContent.toLowerCase()) !== 0) {\r\n\t\t\tg_oFilter.addFilterOption(id, g_oFilter.c_szFilter_Key_AnnotationContent, text);\r\n\t\t}\r\n\r\n\t\t// Always add an option for the reply content, unless the text already starts with this.\r\n\t\tif (text.toLowerCase().indexOf(g_oFilter.c_szFilter_Key_AnnotationContent.toLowerCase()) !== 0) {\r\n\t\t\tg_oFilter.addFilterOption(id, g_oFilter.c_szFilter_Key_ReplyContent, text);\r\n\t\t}\r\n\r\n\t\t// Get filter matches where the key contains the text.\r\n\t\tvar oMatchingFilters = g_oFilter.getMatchesByFilters(g_oFilter.getMatchingFilters(text));\r\n\r\n\t\t// Add filter matches where the value contains the text.\r\n\t\toMatchingFilters = oMatchingFilters.concat(g_oFilter.getMatchesByValues(g_oFilter.getMatchingValues(text)));\r\n\r\n\t\t// Sort the filters alphabetically.\r\n\t\toMatchingFilters.sort(g_oFilter.sortFilters);\r\n\r\n\t\t// Add each of the filter matches to the dropdown.\r\n\t\tfor (var i = 0; i < oMatchingFilters.length; i++) {\r\n\r\n\t\t\t// If this is not already an active filter.\r\n\t\t\tif (!g_oFilter.isActiveFilter(oMatchingFilters[i].Key, oMatchingFilters[i].Value)) {\r\n\r\n\t\t\t\t// Add the filter option.\r\n\t\t\t\tg_oFilter.addFilterOption(id, oMatchingFilters[i].Key, oMatchingFilters[i].Value);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Adds an option to a filter.\r\n\t * @param {string} id - The id of the dropdown.\r\n\t * @param {string} key - The key of the option.\r\n\t * @param {string} value - The value of the option.\r\n\t */\r\n\tFilter.prototype.addFilterOption = function (id, key, value) {\r\n\r\n\t\t// If this is not already a filter option.\r\n\t\tif ($('.filterdropdown__item[data-filterkey=\"' + g_oFilter.removeQuotesFromValue(key).toLowerCase() + '\"][data-filtervalue=\"' + g_oFilter.removeQuotesFromValue(value).toLowerCase() + '\"]').length == 0) {\r\n\t\t\t\r\n\t\t\t// Add the option to the filter.\r\n\t\t\t$(\"#\" + id).append(\r\n\t\t\t\t'