{"version":3,"sources":["../js/Settings.js"],"names":["Settings","oUserSettings","oConsumerSettings","this","g_oUserSettings","g_oConsumerSettings","c_iSkinType","SkinType","c_szDateFormat","DateFormat","c_szChangeRequiresReload","g_bSettingsAnimating","g_bIgnoreNextClickEvent","prototype","intialiseSettings","g_oSettings","applyLockedSettings","updateSettingsMenu","toggleSettingsMenu","g_oGreenlightMessages","closeBubbles","$","css","width","show","animate","right","hide","LockTextComparisonAccuracy","TextComparisonAccuracy","prop","LockTextComparisonCaseSensitivity","TextComparisonCaseSensitivity","LockTextComparisonBoldItalicDetection","TextComparisonBoldItalicDetection","LockTextComparisonWhitespaceDetection","TextComparisonWhitespaceDetection","LockTextComparisonAutoSelection","TextComparisonAutoSelection","TextComparisonAutoSelectionFuzzyThreshold","updateSettingScrollPreference","updateSettingZoomSpeed","updateSettingZoomIncrements","updateSettingAlignmentPreference","updateSettingHighlightPreference","updateSettingSkinType","updateSettingShowAnnotations","updateSettingShowAnnotationNumbers","updateSettingMeasurementPreference","updateSettingAnnotationColour","updateSettingOverprintColour","updateSettingDateFormat","updateSettingTextComparisonHighlightColour","updateSettingTextComparisonAccuracy","updateSettingTextComparisonCaseSensitivity","updateSettingTextComparisonBoldItalicDetection","updateSettingTextComparisonWhitespaceDetection","updateSettingTextComparisonAutoSelection","updateSettingTextComparisonFuzzyThreshold","bSyncSettings","ShowAnnotations","removeClass","addClass","syncSettings","ShowAnnotationNumbers","attr","val","ScrollPreference","ZoomSpeed","ZoomIncrements","AlignmentPreference","HighlightPreference","TextComparisonHighlightColour","updateSettingTextComparisonMinMatchWords","TextComparisonFullDocumentSelectionMinMatchWords","updateSettingTextComparisonMatchFromDocument","TextComparisonFullDocumentSelectionMatchFromDocument","UseMetricUnits","displayWarningBubble","OverprintColour","AnnotationColour","g_oAnnotations","annotationColourChangeUI","undefined","oJSON","SessionId","g_szSessionId","UserSettings","post","url","data","JSON","stringify","contentType","dataType","cache","success","oResponse","Success","displayErrorBubble","displayErrorContentHTML","Errors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zDV,SAASa,UAAUqC,6BAA+B,SAAUS,eAG3DtC,EAAE,4BAA4B6C,IAAInD,YAAYX,gBAAgB2E,iBAG9D1D,EAAE,6BAA6B6C,IAAInD,YAAYX,gBAAgB2E,iBAG3DpB,eACH5C,YAAYgD,gBAQd/D,SAASa,UAAUoC,8BAAgC,SAAUU,eAG5DtC,EAAE,6BAA6B6C,IAAInD,YAAYX,gBAAgB4E,kBAGhB,MAA3CC,eAAeC,0BAA+EC,MAA3CF,eAAeC,0BACrED,eAAeC,2BAIZvB,eACH5C,YAAYgD,gBAQd/D,SAASa,UAAUsC,wBAA0B,SAAUQ,eAGtDtC,EAAE,uBAAuB6C,IAAInD,YAAYX,gBAAgBK,YAGrDkD,gBACH5C,YAAYgD,eACZ5C,sBAAsB2D,qBAAqB/D,YAAYL,4BAOzDV,SAASa,UAAUkD,aAAe,WAEjC,IAAIqB,MAAQ,CACXC,UAAWC,cACXC,aAAcxE,YAAYX,iBAG3BiB,EAAEmE,KAAK,CACNC,IAAK,iCACLC,KAAMC,KAAKC,UAAUR,OACrBS,YAAa,kCACbC,SAAU,OACVC,OAAO,EACPC,QAAS,SAAUC,WAEbA,UAAUC,SACd/E,sBAAsBgF,mBAAmBC,wBAAwBH,UAAUI,aAS/EhF,EAAEiF,UAAUC,GAAG,QAAS,SAAUC,OAG5BzF,YAAYJ,sBAA4D,QAApCU,EAAE,gBAAgBC,IAAI,YAAyBP,YAAYH,wBAU3FG,YAAYH,0BAGpBG,YAAYH,yBAA0B,GAVgB,GAAlDS,EAAEmF,MAAMC,QAAQC,QAAQ,gBAAgBC,QAAkC,eAAnBH,MAAMC,OAAOG,IAGvE7F,YAAYG,uBAYZ2F,OAAO7G,SAAWA,SA3kBtB","file":"Settings-8591543346.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:\tSettings.js\r\n *\r\n * Description:\tGeneric Greenlight Settings code.\r\n */\r\n\r\n(function () {\r\n\r\n \"use strict\";\r\n\r\n /**\r\n\t * Creates a new Settings object.\r\n\t * @param {object} settings - The settings to be used.\r\n\t */\r\n\tfunction Settings(oUserSettings, oConsumerSettings) {\r\n\t\t\r\n\t\t// Set the settings.\r\n\t\tthis.g_oUserSettings = oUserSettings;\r\n\t\tthis.g_oConsumerSettings = oConsumerSettings;\r\n\r\n\t\t// These settings are set as constants, and require the viewer to be re-loaded for changes to take effect.\r\n\t\tthis.c_iSkinType = oUserSettings.SkinType;\r\n\t\tthis.c_szDateFormat = oUserSettings.DateFormat + \" HH:mm:ss\";\r\n\r\n\t\t// Constants to be set in the aspx page.\r\n\t\tthis.c_szChangeRequiresReload = \"\";\r\n\r\n\t\t// If the settings menu is in animation.\r\n\t\tthis.g_bSettingsAnimating = false;\r\n\r\n\t\t// If the next click event should not auto close the menu.\r\n\t\tthis.g_bIgnoreNextClickEvent = false;\r\n\t};\r\n\r\n\t/**\r\n\t * Initialises the settings.\r\n\t */\r\n\tSettings.prototype.intialiseSettings = function () {\r\n\r\n\t\t// Apply any locked settings.\r\n\t\tg_oSettings.applyLockedSettings();\r\n\r\n\t\t// Update the settings menu with the initial settings.\r\n\t\tg_oSettings.updateSettingsMenu();\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the settings menu.\r\n\t */\r\n\tSettings.prototype.toggleSettingsMenu = function () {\r\n\t\t// Close all active bubbles.\r\n\t\tg_oGreenlightMessages.closeBubbles();\r\n\r\n\t\t// If we are not already animating the settings menu.\r\n\t\tif (!g_oSettings.g_bSettingsAnimating) {\r\n\r\n\t\t\t// Set that the menu is currently animating.\r\n\t\t\tg_oSettings.g_bSettingsAnimating = true;\r\n\r\n\t\t\t// If the user settings are currently shown.\r\n\t\t\tif ($(\"#divSettings\").css(\"display\") == \"none\") {\r\n\r\n\t\t\t\t// Ensure the menu is just off screen.\r\n\t\t\t\t$(\"#divSettings\").css(\"right\", 1 - + $(\"#divSettings\").width());\r\n\r\n\t\t\t\t// Show the menu.\r\n\t\t\t\t$(\"#divSettings\").show();\r\n\r\n\t\t\t\t// Slide the menu in from the right.\r\n\t\t\t\t$(\"#divSettings\").animate({\r\n\t\t\t\t\tright: 7\r\n\t\t\t\t}, 'swing', function () {\r\n\r\n\t\t\t\t\t// Set that we are no longer animating.\r\n\t\t\t\t\tg_oSettings.g_bSettingsAnimating = false;\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 menu out to the right.\r\n\t\t\t\t$(\"#divSettings\").animate({\r\n\t\t\t\t\tright: 1 - + $(\"#divSettings\").width()\r\n\t\t\t\t}, 'swing', function () {\r\n\r\n\t\t\t\t\t// Hide the menu once the animation has finished.\r\n\t\t\t\t\t$(\"#divSettings\").hide();\r\n\r\n\t\t\t\t\t// Set that we are no longer animating.\r\n\t\t\t\t\tg_oSettings.g_bSettingsAnimating = false;\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 * Applies any locked settings.\r\n\t * @param {object} oUserSettings - The user settings.\r\n\t * @param {object} oConsumerSettings - The consumer settings.\r\n\t */\r\n\tSettings.prototype.applyLockedSettings = function () {\r\n\t\t\r\n\t\t// If the text comparison accuracy setting is locked, force the consumer setting and lock the option.\r\n\t\tif (g_oSettings.g_oConsumerSettings.LockTextComparisonAccuracy) {\r\n\t\t\tg_oSettings.g_oUserSettings.TextComparisonAccuracy = g_oSettings.g_oConsumerSettings.TextComparisonAccuracy;\r\n\t\t\t$(\"#setting_TextComparisonAccuracy\").prop(\"disabled\", \"disabled\");\r\n\t\t\t$(\"#setting_TextComparisonAccuracy_Lock\").css(\"display\", \"inline-block\");\r\n\t\t}\r\n\r\n\t\t// If the text comparison case sensitivity setting is locked, force the consumer setting and lock the option.\r\n\t\tif (g_oSettings.g_oConsumerSettings.LockTextComparisonCaseSensitivity) {\r\n\t\t\tg_oSettings.g_oUserSettings.TextComparisonCaseSensitivity = g_oSettings.g_oConsumerSettings.TextComparisonCaseSensitivity;\r\n\t\t\t$(\"#setting_TextComparisonCaseSensitivity\").prop(\"disabled\", \"disabled\");\r\n\t\t\t$(\"#setting_TextComparisonCaseSensitivity_Lock\").css(\"display\", \"inline-block\");\r\n\t\t}\r\n\r\n\t\t// If the text comparison bold italic setting is locked, force the consumer setting and lock the option.\r\n\t\tif (g_oSettings.g_oConsumerSettings.LockTextComparisonBoldItalicDetection) {\r\n\t\t\tg_oSettings.g_oUserSettings.TextComparisonBoldItalicDetection = g_oSettings.g_oConsumerSettings.TextComparisonBoldItalicDetection;\r\n\t\t\t$(\"#setting_TextComparisonBoldItalicDetection\").prop(\"disabled\", \"disabled\");\r\n\t\t\t$(\"#setting_TextComparisonBoldItalicDetection_Lock\").css(\"display\", \"inline-block\");\r\n\t\t}\r\n\r\n\t\t// If the text comparison whitespace setting is locked, force the consumer setting and lock the option.\r\n\t\tif (g_oSettings.g_oConsumerSettings.LockTextComparisonWhitespaceDetection) {\r\n\t\t\tg_oSettings.g_oUserSettings.TextComparisonWhitespaceDetection = g_oSettings.g_oConsumerSettings.TextComparisonWhitespaceDetection;\r\n\t\t\t$(\"#setting_TextComparisonWhitespaceDetection\").prop(\"disabled\", \"disabled\");\r\n\t\t\t$(\"#setting_TextComparisonWhitespaceDetection_Lock\").css(\"display\", \"inline-block\");\r\n\t\t}\r\n\r\n\t\t// If the text auto selection setting is locked, force the consumer setting and lock the option.\r\n\t\tif (g_oSettings.g_oConsumerSettings.LockTextComparisonAutoSelection) {\r\n\t\t\tg_oSettings.g_oUserSettings.TextComparisonAutoSelection = g_oSettings.g_oConsumerSettings.TextComparisonAutoSelection;\r\n\t\t\tg_oSettings.g_oUserSettings.TextComparisonAutoSelectionFuzzyThreshold = g_oSettings.g_oConsumerSettings.TextComparisonAutoSelectionFuzzyThreshold;\r\n\t\t\t$(\"#setting_TextComparisonAutoSelection\").prop(\"disabled\", \"disabled\");\r\n\t\t\t$(\"#setting_TextComparisonAutoSelection_Lock\").css(\"display\", \"inline-block\");\r\n\t\t\t$(\"#setting_TextComparisonAutoSelection_FuzzyThreshold\").prop(\"disabled\", \"disabled\");\r\n\t\t\t$(\"#setting_TextComparisonAutoSelection_FuzzyThreshold_Lock\").css(\"display\", \"inline-block\");\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the settings menu with the user settings.\r\n\t */\r\n\tSettings.prototype.updateSettingsMenu = function () {\r\n\r\n\t\t// Update the scroll preference.\r\n\t\tg_oSettings.updateSettingScrollPreference(false);\r\n\r\n\t\t// Update the zoom speed.\r\n\t\tg_oSettings.updateSettingZoomSpeed(false);\r\n\r\n\t\t// Update the zoom increment.\r\n\t\tg_oSettings.updateSettingZoomIncrements(false);\r\n\r\n\t\t// Update the alignment preference.\r\n\t\tg_oSettings.updateSettingAlignmentPreference(false);\r\n\r\n\t\t// Update the highlight preference.\r\n\t\tg_oSettings.updateSettingHighlightPreference(false);\r\n\r\n\t\t// Update the skin type.\r\n\t\tg_oSettings.updateSettingSkinType(false);\r\n\r\n\t\t// Update the show annotations setting.\r\n\t\tg_oSettings.updateSettingShowAnnotations(false);\r\n\r\n\t\t// Update the show annotation numbers setting.\r\n\t\tg_oSettings.updateSettingShowAnnotationNumbers(false);\r\n\r\n\t\t// Update the measurement units.\r\n\t\tg_oSettings.updateSettingMeasurementPreference(false);\r\n\r\n\t\t// Update the annotation colour.\r\n\t\tg_oSettings.updateSettingAnnotationColour(false);\r\n\t\t\r\n\t\t// Update the overprint colour.\r\n\t\tg_oSettings.updateSettingOverprintColour(false);\r\n\r\n\t\t// Update the date format.\r\n\t\tg_oSettings.updateSettingDateFormat(false);\r\n\r\n\t\t// Update the text comparison highlight colour.\r\n\t\tg_oSettings.updateSettingTextComparisonHighlightColour(false);\r\n\r\n\t\t// Update the text comparison accuracy.\r\n\t\tg_oSettings.updateSettingTextComparisonAccuracy(false);\r\n\r\n\t\t// Update the text comparison sensitivity.\r\n\t\tg_oSettings.updateSettingTextComparisonCaseSensitivity(false);\r\n\r\n\t\t// Update the text comparison bold italic detection.\r\n\t\tg_oSettings.updateSettingTextComparisonBoldItalicDetection(false);\r\n\r\n\t\t// Update the text comparison whitespace detection.\r\n\t\tg_oSettings.updateSettingTextComparisonWhitespaceDetection(false);\r\n\r\n\t\t// Update the text comparison Auto Selection.\r\n\t\tg_oSettings.updateSettingTextComparisonAutoSelection(false);\r\n\r\n\t\t// Update the text comparison Auto Selection Fuzzy Threshold.\r\n\t\tg_oSettings.updateSettingTextComparisonFuzzyThreshold(false);\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for showing annotations.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingShowAnnotations = function (bSyncSettings) {\r\n\r\n\t\t// Update the show annotations setting in the settings menu.\r\n\t\t$(\"#settings_ShowAnnotationsToggle\").prop('checked', g_oSettings.g_oUserSettings.ShowAnnotations);\r\n\r\n\t\t// Update the class of the hide annotations icon.\r\n\t\tif (g_oSettings.g_oUserSettings.ShowAnnotations) {\r\n\t\t\t$(\"#HideAnnotations\").removeClass(\"ShowAnnotations\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(\"#HideAnnotations\").addClass(\"ShowAnnotations\");\r\n\t\t}\r\n\t\t\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for showing annotation numbers.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingShowAnnotationNumbers = function (bSyncSettings) {\r\n\r\n\t\t// Update the show annotation numbers setting in the settings menu.\r\n\t\t$(\"#settings_ShowAnnotationNumbersToggle\").prop('checked', g_oSettings.g_oUserSettings.ShowAnnotationNumbers);\r\n\r\n\t\t// Update the annotation number icon in the annotation slideout.\r\n\t\t$(\"#btnShowAnnNumbers\").attr(\"src\", g_oSettings.g_oUserSettings.ShowAnnotationNumbers ? \"img/Show-Ann-Numbers_24.png\" : \"img/Hide-Ann-Numbers_24.png\");\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for scroll preference.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingScrollPreference = function (bSyncSettings) {\r\n\t\t\r\n\t\t// Update the scroll preference in the settings menu.\r\n\t\t$(\"#setting_ScrollPreference\").val(g_oSettings.g_oUserSettings.ScrollPreference);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for zoom speed.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingZoomSpeed = function (bSyncSettings) {\r\n\r\n\t\t// Update the zoom speed in the settings menu.\r\n\t\t$(\"#setting_ZoomSpeed\").val(g_oSettings.g_oUserSettings.ZoomSpeed);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for zoom increments.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingZoomIncrements = function (bSyncSettings) {\r\n\r\n\t\t// Update the zoom increments in the settings menu.\r\n\t\t$(\"#setting_ZoomIncrements\").val(g_oSettings.g_oUserSettings.ZoomIncrements);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for alignment preference.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingAlignmentPreference = function (bSyncSettings) {\r\n\r\n\t\t// Update the scroll preference in the settings menu.\r\n\t\t$(\"#setting_AlignmentPreference\").val(g_oSettings.g_oUserSettings.AlignmentPreference);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for highlight preference.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingHighlightPreference = function (bSyncSettings) {\r\n\r\n\t\t// Update the scroll preference in the settings menu.\r\n\t\t$(\"#setting_HighlightPreference\").val(g_oSettings.g_oUserSettings.HighlightPreference);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison highlight colour.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonHighlightColour = function (bSyncSettings) {\r\n\r\n\t\t// Update the highlight colour in the settings menu.\r\n\t\t$(\"#setting_TextComparisonHighlightColour\").val(g_oSettings.g_oUserSettings.TextComparisonHighlightColour);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison accuracy.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonAccuracy = function (bSyncSettings) {\r\n\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#setting_TextComparisonAccuracy\").val(g_oSettings.g_oUserSettings.TextComparisonAccuracy);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison sensitivity.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonCaseSensitivity = function (bSyncSettings) {\r\n\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#setting_TextComparisonCaseSensitivity\").val(g_oSettings.g_oUserSettings.TextComparisonCaseSensitivity);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison bold italic detection.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonBoldItalicDetection = function (bSyncSettings) {\r\n\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#setting_TextComparisonBoldItalicDetection\").val(g_oSettings.g_oUserSettings.TextComparisonBoldItalicDetection);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison whitespace detection.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonWhitespaceDetection = function (bSyncSettings) {\r\n\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#setting_TextComparisonWhitespaceDetection\").val(g_oSettings.g_oUserSettings.TextComparisonWhitespaceDetection);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison whitespace detection.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonAutoSelection = function (bSyncSettings) {\r\n\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#setting_TextComparisonAutoSelection\").val(g_oSettings.g_oUserSettings.TextComparisonAutoSelection);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison fuzzy threshold.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonFuzzyThreshold = function (bSyncSettings) {\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#setting_TextComparisonAutoSelection_FuzzyThreshold\").val(g_oSettings.g_oUserSettings.TextComparisonAutoSelectionFuzzyThreshold);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for text comparison fuzzy threshold.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonMinMatchWords = function (bSyncSettings) {\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#textComparison_FullDocumentSelection_inputMinMatchWords\").val(g_oSettings.g_oUserSettings.TextComparisonFullDocumentSelectionMinMatchWords);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t\t/**\r\n\t * Updates the setting for text comparison fuzzy threshold.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingTextComparisonMatchFromDocument = function (bSyncSettings) {\r\n\t\t// Update the preference in the settings menu.\r\n\t\t$(\"#textComparison_FullDocumentSelection_selMatchFromDocument\").val(g_oSettings.g_oUserSettings.TextComparisonFullDocumentSelectionMatchFromDocument);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for measurement preference.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingMeasurementPreference = function (bSyncSettings) {\r\n\r\n\t\t// Update the measurement preference in the settings menu.\r\n\t\t$(\"#settings_MeasurementPreference\").val(g_oSettings.g_oUserSettings.UseMetricUnits ? 1 : 0);\r\n\r\n\t\t// Update the unit icons.\r\n\t\t$(\"#TechToolsUnitsImg\").attr(\"src\", g_oSettings.g_oUserSettings.UseMetricUnits ? \"img/Measure-Metric_24.png\" : \"img/Measure-Imperial_24.png\");\r\n\t\t$(\"#OffsetUnitsImg\").attr(\"src\", g_oSettings.g_oUserSettings.UseMetricUnits ? \"img/Measure-Metric_24.png\" : \"img/Measure-Imperial_24.png\");\r\n\t\t$(\"#AlignmentUnitsImg_Viewer\").attr(\"src\", g_oSettings.g_oUserSettings.UseMetricUnits ? \"img/Measure-Metric_24.png\" : \"img/Measure-Imperial_24.png\");\r\n\t\t$(\"#AlignmentUnitsImg_Compare\").attr(\"src\", g_oSettings.g_oUserSettings.UseMetricUnits ? \"img/Measure-Metric_24.png\" : \"img/Measure-Imperial_24.png\");\r\n\t\t$(\"#GuidedUnitsImg_Compare\").attr(\"src\", g_oSettings.g_oUserSettings.UseMetricUnits ? \"img/Measure-Metric_24.png\" : \"img/Measure-Imperial_24.png\");\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for skin type.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingSkinType = function (bSyncSettings) {\r\n\r\n\t\t// Update the skin type in the settings menu.\r\n\t\t$(\"#setting_SkinType\").val(g_oSettings.g_oUserSettings.SkinType);\r\n\r\n\t\t// Sync the settings if required, and show the reload warning.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t\tg_oGreenlightMessages.displayWarningBubble(g_oSettings.c_szChangeRequiresReload);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the setting for the overprint colour.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingOverprintColour = function (bSyncSettings) {\r\n\r\n\t\t// Update the overprint colour in the settings menu.\r\n\t\t$(\"#setting_OverprintColour\").val(g_oSettings.g_oUserSettings.OverprintColour);\r\n\r\n\t\t// Update the overprint colour in the separations slideout.\r\n\t\t$(\"#clrSelectOverprintColour\").val(g_oSettings.g_oUserSettings.OverprintColour);\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for the annotation colour.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingAnnotationColour = function (bSyncSettings) {\r\n\r\n\t\t// Update the annotation colour in the settings menu.\r\n\t\t$(\"#setting_AnnotationColour\").val(g_oSettings.g_oUserSettings.AnnotationColour);\r\n\r\n\t\t// Update the annotation colour in the annotation drop down if loaded.\r\n\t\tif (g_oAnnotations.annotationColourChangeUI != null && g_oAnnotations.annotationColourChangeUI != undefined) {\r\n\t\t\tg_oAnnotations.annotationColourChangeUI();\r\n\t\t}\r\n\r\n\t\t// Sync the settings if required.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the setting for the date format.\r\n\t * @param {bool} bSyncSettings - If the settings should be synced to the database.\r\n\t */\r\n\tSettings.prototype.updateSettingDateFormat = function (bSyncSettings) {\r\n\r\n\t\t// Update the date format in the settings menu.\r\n\t\t$(\"#setting_DateFormat\").val(g_oSettings.g_oUserSettings.DateFormat);\r\n\r\n\t\t// Sync the settings if required, and show the reload warning.\r\n\t\tif (bSyncSettings) {\r\n\t\t\tg_oSettings.syncSettings();\r\n\t\t\tg_oGreenlightMessages.displayWarningBubble(g_oSettings.c_szChangeRequiresReload);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Syncs the settings to the database.\r\n\t */\r\n\tSettings.prototype.syncSettings = function () {\r\n\r\n\t\tvar oJSON = {\r\n\t\t\tSessionId: g_szSessionId,\r\n\t\t\tUserSettings: g_oSettings.g_oUserSettings\r\n\t\t};\r\n\r\n\t\t$.post({\r\n\t\t\turl: \"UserDetails/UpdateUserSettings\",\r\n\t\t\tdata: JSON.stringify(oJSON),\r\n\t\t\tcontentType: \"application/json; charset=utf-8\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tcache: false,\r\n\t\t\tsuccess: function (oResponse) {\r\n\t\t\t\t// Only need to display a message if this failed.\r\n\t\t\t\tif (!oResponse.Success) {\r\n\t\t\t\t\tg_oGreenlightMessages.displayErrorBubble(displayErrorContentHTML(oResponse.Errors));\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 *\tSetting Auto Closing.\r\n\t */\r\n\t$(document).on('click', function (event) {\r\n\r\n\t\t// If we are not already animating the settings menu, the settings menu is curreny open, and we want to close the menu.\r\n\t\tif (!g_oSettings.g_bSettingsAnimating && $(\"#divSettings\").css(\"display\") != \"none\" && !g_oSettings.g_bIgnoreNextClickEvent) {\r\n\r\n\t\t\t// If the click is outside of settings menu and not on the setting cog.\r\n\t\t\tif ($(event.target).parents(\"#divSettings\").length == 0 && event.target.id != \"divSettings\") {\r\n\r\n\t\t\t\t// Close the combo control.\r\n\t\t\t\tg_oSettings.toggleSettingsMenu();\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If we have ignored this click event.\r\n\t\telse if (g_oSettings.g_bIgnoreNextClickEvent) {\r\n\r\n\t\t\t// Set that we dont want to ignore the next one.\r\n\t\t\tg_oSettings.g_bIgnoreNextClickEvent = false;\r\n\t\t}\r\n\t});\r\n\r\n // Add the viewer object to the window.\r\n window.Settings = Settings;\r\n}());"]}