      1 var Ozone = Ozone || {};
      2 Ozone.layout = Ozone.layout || {};
      3 Ozone.ux = Ozone.ux || {};
      4 Ozone.util = Ozone.util || {};
      5
      6 /*
      7  * General Algorithm
      8  *
      9  * if queryString contains lang parameter swith to that locale
     10  * else check browser language setting
     11  *
     12  * Language switching is accomplished by incliuding a locale
     13  * specific javascript file
     14  */
     15 /**
     16  * @class
     17  * @description Provides utility methods for localization
     18  */
     19 Ozone.lang = {
     20 	languageSetting : 'en-US',
     21
     22 	regexLeadingTailingSpaceChars: /^\s+|\s+$/g,
     23
     24 	regexTrailingSpaceChars: /\s+$/,
     25
     26 	regexLeadingSpaceChars: /^\s+/,
     27
     28 	version : Ozone.version.owfversion + Ozone.version.language,
     29
     30 	urlDecode: function(string, overwrite){
     31         if (!string || !string.length) {
     32             return {};
     33         }
     34         var obj = {};
     35         var pairs = string.split('&');
     36         var pair, name, value;
     37         for (var i = 0, len = pairs.length; i < len; i++) {
     38             pair = pairs[i].split('=');
     39             name = decodeURIComponent(pair[0]);
     40             value = decodeURIComponent(pair[1]);
     41             if (overwrite !== true) {
     42                 if (typeof obj[name] == "undefined") {
     43                     obj[name] = value;
     44                 }
     45                 else
     46                     if (typeof obj[name] == "string") {
     47                         obj[name] = [obj[name]];
     48                         obj[name].push(value);
     49                     }
     50                     else {
     51                         obj[name].push(value);
     52                     }
     53             }
     54             else {
     55                 obj[name] = value;
     56             }
     57         }
     58         return obj;
     59     },
     60
     61     /**
     62      * @description Gets the language that is currently being used by OWF
     63      * @return Returns the ISO 639-1 language code for the language that is currently being used by OWF
     64      * @example
     65      * if (Ozone.lang.getLanguage() == 'es') {
     66      *   AnnouncingClockStrings.timeLabel = 'El tiempo es';
     67      * }
     68      *
     69      */
     70 	getLanguage : function() {
     71 	    var params = Ozone.lang.urlDecode(window.location.search.substring(1));
     72         if (params.lang) {
     73 			return params.lang;
     74 		}
     75         else {
     76
     77           //try to find it in the window.name
     78           if (Ozone.util.parseWindowNameData) {
     79
     80             var data = Ozone.util.parseWindowNameData();
     81             if (data != null && data.lang) {
     82               return data.lang;
     83             }
     84           }
     85         }
     86
     87         //just use default
     88         return Ozone.lang.languageSetting;
     89     }
     90 };
     91
     92 Ozone.layout.Menu = {
     93 	overflowMenuButtonTooltip : "Click to show more buttons"
     94 };
     95
     96 Ozone.layout.ConfigurationWindowString = {
     97 	setAsNew : "Save as new",
     98     setAsDefault : "Set as default",
     99     showCarousel : "Show Launch Menu",
    100     showShortcuts : "Show Shortcuts",
    101     showToolbar : "Show toolbar options",
    102     documentTitle : "Document Title",
    103
    104 	topSelector : 'Top',
    105     centerSelector : 'Center',
    106     accordionSelector : 'Accordion',
    107     toolbarButtons : 'Toolbar Buttons',
    108     clear : 'Clear',
    109     save : 'OK',
    110     cancel : 'Cancel',
    111     clearAll: 'Clear All',
    112
    113     column : 'Column',
    114     columns : 'Columns',
    115
    116     tab : 'Tab',
    117     tabs : 'Tabs'
    118 };
    119
    120 Ozone.layout.CreateViewWindowString = {
    121     createNew: 'Create new',
    122     createFromExisiting: 'Create from existing',
    123     importView: 'Import'
    124 };
    125
    126 Ozone.layout.ManageViewsWindowString = {
    127     languages: 'Language'
    128 };
    129
    130 Ozone.layout.ToolbarString = {
    131    configurationManager : 'Configuration Manager'
    132 };
    133
    134 Ozone.layout.DesktopWindowManagerString = {
    135     configureDashboard : 'Configure Dashboard',
    136     toggleCarousel : 'Toggle Launch Menu',
    137     welcomeMessage : 'Welcome'
    138 };
    139
    140 Ozone.layout.tooltipString = {
    141 	widgetLaunchMenuTitle: 			'Launch Menu',
    142 	manageDashboardsTitle: 			'Dashboard Settings',
    143 	manageDashboardsContent: 		'This screen allows users to rearrange, edit, and delete dashboards. It also allows users to set their language preference.',
    144 	createDashboardTitle: 			'Create Dashboard',
    145 	createDashboardContent: 		'This screen allows users to create blank dashboards, copy an existing dashboard, or import a dashboard from a shared configuration.',
    146 	addWidgetsTitle: 				'Launch Menu (Alt+Shift+L)',
    147 	addWidgetsContent: 				'This button opens or closes the Launch Menu, allowing users to add widgets to their current dashboard.',
    148 	dashboardSwitcherTitle:			'Switcher (Alt+Shift+C)',
    149 	dashboardSwitcherContent:		'This button opens or closes the Switcher, allowing users to switch between their dashboards.',
    150 	marketplaceWindowTitle:			'Marketplace (Alt+Shift+M)',
    151 	marketplaceWindowContent:		'This button opens the Marketplace window, allowing users to discover widgets in Marketplace and add them to their OWF instance.',
    152     metricWindowTitle:		    	'Metric (Alt+Shift+R)',
    153     metricWindowContent:      		'This button opens the Metric window, where widgets that monitor OWF and widget statistics are located.',
    154 	settingsTitle:					'Settings (Alt+Shift+S)',
    155 	settingsContent:				'This button opens the Settings window, allowing users to customize their widgets or change themes.',
    156 	adminToolsTitle:				'Administration (Alt+Shift+A)',
    157 	adminToolsContent:				'This button opens the Administration window, exposing administrators to functionality for managing groups, dashboards, widgets, and users.',
    158 	helpTitle:						'Help (Alt+Shift+H)',
    159 	helpContent:					'This button opens the Help window, allowing users to browse help files for assistance on using OWF.',
    160 	shareTitle: 					'Share Dashboard',
    161 	shareContent: 					'This feature allows a user to export their current dashboard so that other users can import it.',
    162 	customizeDashboardTitle:		'Customize Dashboard',
    163 	customizeDashboardContent: 		'This screen allows users to customize the current dashboard.',
    164 	eventingTitle:					'Dynamic Eventing',
    165 	eventingContent: 				'This screen allows users to manage dynamic widget eventing.',
    166     themeSelectorTitle:             'Change the styling of your OWF',
    167     themeSelectorContent:           'This screen allows users to change the background, window color and style for OWF.',
    168 	showBannerTitle: 				'Show/Hide Banner',
    169 	showBannerContent: 				'This button shows and hides the bottom two rows of the dashboard banner.',
    170 	carouselCloseContent: 			'This button closes the widget Launch Menu.',
    171 	carouselCloseTitle: 			'Close Launch Menu',
    172 	carouselManageWidgetsTitle:		'Widget Settings',
    173 	carouselManageWidgetsContent: 	'This screen allows users to customize their Launch Menu, controlling which widgets are visible and the order in which they appear. It also allows for the deletion of widgets and contains a link to the OWF Marketplace. The grouping tags of a widget can also be modified in this screen.',
    174 	adminWDEditTitle: 				'Edit Widget Definition',
    175 	adminWDEditContent: 			'Change the properties of a widget definition. Note that while properties such as URLs will propagate to already existing instances of a widget, malleable properties such as height will not be affected.',
    176 	adminWDDeleteTitle: 			'Delete Widget Definition',
    177 	adminWDDeleteContent: 			'Deletes the selected widget definition. In addition to removing the definition itself, all instances of this widget will be removed from all user dashboards.',
    178 	adminDashAddTitle:				'Add Dashboard',
    179 	adminPWDApplyTitle:				'Apply User Widgets',
    180     adminPWDApproveTitle:			'Approve User Widgets',
    181 	adminDashCopyTitle: 			'Copy Dashboard',
    182 	adminDashCopyContent: 			'Copy an existing dashboard to one or more users. Note that once copied, each dashboard instance is an independent entity. Changes made to the initial dashboard at a later date will not be copied.',
    183 	adminDashEditTitle: 			'Edit Dashboard',
    184 	adminDashEditContent: 			'Changes the properties of a dashboard. Note that dashboard state is represented as a JSON object, and any changes made to it must be valid JSON.',
    185 	adminDashDeleteTitle: 			'Delete Dashboard',
    186 	adminDashDeleteContent: 		'Deletes the selected dashboard. Note that if a user is currently using the dashboard, they will not be kicked out. However, it will not be available once they navigate away.',
    187 	adminPrefsCopyTitle: 			'Copy Preference',
    188 	adminPrefsCopyContent: 			'Copy an existing preference to one or more users. Note that once copied, each preference instance is an independent entity. Changes made to the initial preference at a later date will not be copied.',
    189 	adminPrefsEditTitle: 			'Edit Preference',
    190 	adminPrefsEditContent: 			'Changes the properties of a preference.',
    191 	adminPrefsDeleteTitle: 			'Delete Preference.',
    192 	adminPrefsDeleteContent: 		'Deletes the selected preference.',
    193 	adminUsersEditTitle: 			'Edit User',
    194 	adminUsersEditContent: 			'Changes the properties of a user. Note that this does not edit any user information in an underlying security implementation. Only the information that is stored in the framework itself will be changed.',
    195 	adminUsersDeleteTitle: 			'Delete User',
    196 	adminUsersDeleteContent:		'Deletes a given user from the framework. Note that this does not delete the user information in an underlying security implementation. Only the user information that is stored in the framework itself will be removed. In addition, it is possible that with certain security implementations such as x509 certificates, a user will be re-created by the framework if they successfully authenticate.',
    197 	adminUserWidgetsDeleteTitle: 	'Delete User Widget',
    198 	adminUserWidgetsDeleteContent: 'Removes access to this widget for a given user. Please note that this will not delete the underlying widget definition - other users will still have access.',
    199 	clearConnectionsTitle: 	'Clear All Connections',
    200 	clearConnectionsContent: 'Removes all directed dynamic eventing connections between the widgets on this dashboard.',
    201         bannerDockTitle:                        'Dock',
    202         bannerDockContent:                      'Dock toolbar to banner at top of page.',
    203         bannerUndockTitle:                      'Undock',
    204         bannerUndockContent:                    'Undock toolbar to floating position and hide banner.'
    205 };
    206
    207 Ozone.layout.admin = {
    208 	updateDashboardTitle: 			'Update Dashboard',
    209 	dashboardUpdatedContent: 		'Dashboard updated successfully.'
    210 };
    211
    212 Ozone.ux.DashboardMgmtString = {
    213     createDashboard : 'Create a Dashboard',
    214     selectDashboardDotDot : 'Select a dashboard...',
    215     deleteDashboard : 'Delete a Dashboard',
    216     importaDashboard : 'Import a Dashboard',
    217     exportDashboard : 'Export Current Dashboard',
    218     exportDashboardConfig : 'Export Dashboard Configuration',
    219     uploadConfig : 'Upload...',
    220     setAsDefault : 'Set as default',
    221     dashboards : 'Dashboards',
    222     title : 'Title',
    223     layout : 'Layout',
    224     description : 'Description',
    225     top : 'Top',
    226     bottom : 'Bottom',
    227     columns : 'Columns',
    228     arrangement : 'Arrangement',
    229     selectDashboard : 'Select Dashboard',
    230     accordion : 'Accordion',
    231     portal : 'Portal',
    232     tabbed : 'Tabbed',
    233     desktop : 'Desktop',
    234     fit : 'Fit',
    235 	tooltipManageDashboards: 'Dashboard Settings',
    236 	tooltipCreateDashboard: 'Create Dashboard',
    237
    238     ok : 'OK',
    239     reset : 'Reset',
    240     about: 'About',
    241     logout: 'Logout',
    242     importDashboard : 'Import Dashboard',
    243     dashboardTitle : 'Dashboard Title',
    244     enterDashboardTitle : 'Enter Dashboard Title...',
    245     browse : 'Browse...',
    246
    247 	loadDefaultMsg : 'Load Default Configuration?',
    248 	noDashboardSelectedMsg : 'No configuration was selected.  Do you want to load the default configuration?',
    249 	changeLanguage : 'Change Language',
    250 	es : 'Spanish',
    251 	en_US : 'English',
    252 	ko : 'Korean'
    253 };
    254
    255 Ozone.layout.AccordionWindowManagerString = {
    256     configureAccordion : 'Configure Accordion'
    257 };
    258
    259 Ozone.layout.PortalWindowManagerString = {
    260     configurePortlets : 'Configure Portlets'
    261 };
    262
    263 Ozone.layout.TabbedWindowManagerString = {
    264     configureTabs : '<span class="configureTabButton">Configure Tabs</span>'
    265 };
    266
    267 Ozone.util.ErrorMessageString = {
    268 	errorTitle : 'Error',
    269 	dashboardConfig : 'Dashboard Configuration',
    270 	widgetConfiguration : 'Widget Configuration',
    271 	noWidgets : 'There are no widgets to which you have access.',
    272 	configurationMsg : 'Failed to retrieve configuration data',
    273 	dashboardBlankMsg: 'Invalid Dashboard Name, it cannot be blank. <br />Please provide a valid Dashboard Name.',
    274 	dashboardInvalidEntryMsg: "Unable to update dashboard name(s) due <br/>to invalid characters.",
    275 	invalidForm : 'Invalid Form',
    276 	invalidFormMsg : 'Form is invalid.  Please make sure all required fields are completed.',
    277 	languagePreference : 'Language Preference',
    278 	languagePreferenceMsg : 'Error saving language preference',
    279 	settingSessionDataMsg : 'Error setting session data',
    280 	retrievingSessionDataMsg : 'Error retrieving session data',
    281 	saveUserPreferences : 'Error saving user preference',
    282 	storeErrorMsg : 'Store Error Message',
    283 	sendAndForget : 'Send and Forget',
    284 	userName : 'User Name',
    285 	updateDashboardMsg : 'Error updating dashboard',
    286 	saveUpdatedViews : 'Update Dashboards',
    287 	saveUpdatedViewsMsg : 'Error updating Dashboards',
    288 	saveUpdatedWidgets : 'Update Widgets',
    289 	saveUpdatedWidgetsMsg : 'Error updating widgets',
    290 	retrieveUpdatedWidgets : 'Retrieving Updated Widgets',
    291 	retrieveUpdatedWidgetsMsg : 'Error retrieving updated widgets',
    292 	invalidUrl: 'Invalid Url',
    293 	invalidUrlMsg: 'The dashboard can not be found. It may have been deleted. You will be redirected to your default dashboard.',
    294     invalidDashboard: 'Invalid Dashboard Id',
    295     invalidDashboardGotoDefaultMsg: 'The dashboard can not be found. It may have been deleted. You will be redirected to your default dashboard.',
    296     invalidDashboardMsg: 'The dashboard can not be found. It may have been deleted. You will be redirected to the previous dashboard',
    297 	invalidDashboardNameMsg: 'Dashboard name is invalid.  It cannot include start or end with a space.',
    298 	leadingOrTrailingWhiteSpacesMsg : 'Leading or trailing spaces around dashboard name are not allowed',
    299 	logoutError: 'Logout Error',
    300 	logoutErrorMsg: 'Please close your browser to ensure logout success.',
    301 	widgetName : 'Widget Name',
    302 	maximumLength : 'The maximum length for this field is {0}',
    303 	about : 'About',
    304 	aboutErrorMsg: 'Error retrieving application information.',
    305 	widgetNotApproved: 'This widget has not yet been approved for use.  Please see a system administrator for approval.',
    306     restrictedTagError: ' is a restricted tag.  You may not edit it or add it to other widgets',
    307     mpErrorTitle: 'Marketplace Error',
    308     mpErrorMsg: 'There has been an error accessing Marketplace. Please contact your System Administrator to verify that Marketplace connectivity has been correctly configured and that the Marketplace server is currently running.',
    309     oneSingleton: 'Only one instance of a Singleton is permitted'
    310 };
    311
    312 Ozone.layout.MessageBoxButtonText = {
    313 	ok: 'OK',
    314 	cancel : 'Cancel',
    315     yes : 'Yes',
    316     no : 'No'
    317 };
    318
    319 Ozone.layout.DialogMessages = {
    320 	update: 'Update',
    321 	updating: 'Updating...',
    322 	updated: 'Updated',
    323 	add: 'Add',
    324 	adding : 'Adding...',
    325 	added: 'Added',
    326 	added_colon: 'Added:',
    327     added_successfully: 'added successfully',
    328 	copy: 'Copy',
    329     copying : 'Copying...',
    330     copied: 'Copied',
    331     cancel: 'Cancel',
    332     ok: 'OK',
    333     error: 'Error',
    334     addWidget: 'Add Widget',
    335     editWidget: 'Edit Widget',
    336     removed_colon: 'Removed:',
    337     retained_colon: 'Retained:',
    338     applied_colon: 'Applied:',
    339     updated_successfully: 'updated successfully',
    340     added_for: 'added for',
    341     formInvalid_CheckFieldMessages: 'Form Invalid.<br />Check highlighted field messages (!).',
    342     formInvalid_SelectOneUser: 'Form Invalid.<br />You need to select at least 1 user.',
    343     formInvalid_SelectOneWidget: 'Form Invalid.<br />You need to select at least 1 widget.',
    344     view: 'Dashboard',
    345     view_status: 'Dashboard Status',
    346     view_dashboardNameField_label: 'Dashboard name',
    347     view_dashboardNameField_blankText: 'Please supply a Dashboard Name',
    348     view_dashboardStateField_label: 'Configuration',
    349     view_dashboardStateField_blankText: 'Please supply a Dashboard Configuration',
    350     view_dashboardGuidField_label: 'GUID',
    351     view_dashboardLayoutField_label: 'Layout',
    352     view_dashboardIsDefaultField_label: 'Default',
    353     formError_saveView: 'An error occurred while attempting to save a dashboard.',
    354     user: 'User',
    355     users_opt: 'user(s)',
    356     user_status: 'User Status',
    357     user_usernameField_label: 'User ID',
    358     user_usernameField_blankText: 'Please supply a User ID',
    359     user_userRealNameField_label: 'Name',
    360     user_userRealNameField_blankText: 'Please supply a name for the user',
    361     formError_saveUser: 'An error occurred while attempting to save a user.',
    362     preference: 'Preference',
    363     preference_preferenceNameField_label: 'Preference Name',
    364     preference_preferenceNameField_blankText: 'Please supply a Preference Name',
    365     preference_preferenceNamespaceField_label: 'Namespace',
    366     preference_preferenceNamespaceField_blankText: 'Please supply a Preference Namespace',
    367     preference_preferenceValueField_label: 'Value',
    368     preference_preferenceValueField_blankText: 'Please supply a Preference Value',
    369     preference_status: 'Preference Status',
    370     formError_savePreference: 'An error occurred while attempting to save a preference.',
    371     widgetDefinition: 'Widget Definition',
    372     widgetDefinition_status: 'Widget Status',
    373     widgetDefinition_widgetAccess: 'Widget Access',
    374     widgetDefinition_descriptorUrlField_blankText: 'Please supply a Widget Descriptor URL',
    375     widgetDefinition_displayNameField_label: 'Widget Name',
    376     widgetDefinition_widgetVersionField_label: 'Version',
    377     widgetDefinition_displayNameField_blankText: 'Please supply a Widget Name',
    378     widgetDefinition_widgetVersionField_blankText: 'Please supply a Widget Version',
    379     widgetDefinition_widgetGuidField_label: 'GUID',
    380     widgetDefinition_widgetUrlField_label: 'URL',
    381     widgetDefinition_widgetUrlField_blankText: 'Please supply a Widget URL',
    382     widgetDefinition_imageUrlSmallField_label: 'Container Icon URL',
    383     widgetDefinition_imageUrlSmallField_blankText: 'Please supply a Container Icon URL',
    384     widgetDefinition_imageLargeUrlField_label: 'Launch Menu Icon URL',
    385     widgetDefinition_imageLargeUrlField_blankText: 'Please supply a Launch Menu Icon URL',
    386     widgetDefinition_widthNumberField_label: 'Width',
    387     widgetDefinition_widthNumberField_blankText: 'Please supply a Widget width',
    388     widgetDefinition_heightNumberField_label: 'Height',
    389     widgetDefinition_heightNumberField_blankText: 'Please supply a Widget height' ,
    390     widgetDefinition_secureUrl_warningText: 'Entering a secure HTTPS address may prevent browser security warnings such as "This page contains unsecure content."' ,
    391     personWidgetDef_Apply: 'Apply',
    392     personWidgetDef_Order: 'Order',
    393     personWidgetDef_Widget: 'Widget',
    394     personWidgetDef_WidgetAccessApplied: 'Widget Access Applied',
    395     personWidgetDef_ApplyStatus: 'Apply Status',
    396     personWidgetDef_NoChangesNecessary: 'No changes were necessary',
    397     formError_savePersonDefWidgets: 'An error occurred while attempting to save user widget(s).',
    398     formError_saveWidgetDefinition: 'An error occurred while attempting to save the widget.',
    399     personWidgetDef_WidgetContainerPanelTitle: 'Widgets',
    400 	marketplaceWindow_AddWidget: 'An error occurred while attempting to add the widget from Marketplace.',
    401 	marketplaceWindow_currentUser: 'Could not retrieve current user name and id.',
    402     marketplaceWindow_AddSuccessful: 'The widget was added successfully from Marketplace',
    403 	widgetAdded: 'Selected widget is already added for this user',
    404 	marketplaceWindow_RequiredListingsAlertMsg: 'The widget you have launched will not work without some dependencies.  These widgets are listed below and will be additionally added to the launch menu.',
    405     fitPaneFullWarning: 'You are attempting to add a widget to a pane with a single-widget layout. Continuing will replace the existing widget.',
    406     dashboardLockTitle: 'Lock Dashboard',
    407     dashboardLockWarning: 'Locking this dashboard disables the Launch Menu. New widgets cannot be launched or added to this layout. Do you still want to lock this dashboard?',
    408     dashboardLockAlertTitle: 'Locked Dashboard',
    409     dashboardLockAlert: 'This dashboard is locked. Widgets cannot be added or removed from a locked dashboard.',
    410     closeBackgroundWidgetWarning: ' is a background widget. You won’t see it on your screen because it runs behind the scenes.<br/><br/>To close the widget, click OK.'
    411 };
    412
    413 Ozone.layout.ThemeSwitcherWindowConstants = {
    414     title: 'Theme Settings',
    415     header: 'Change the styling of your OWF',
    416     subheader: 'Select a theme below to change the background, window color, and style for OWF.',
    417     ok: 'OK',
    418     cancel: 'Cancel'
    419 };
    420