/* * Config to provide global vars and configuration for visualisations and custom scripts * Martin Lewis-Dalgarno * December 2022 */ // Create a config to be passed into objects // NOTE - iconPath and urls are processed by template engine to render server side - may show as invalid JS in editor let config = { preload: { conventionId: 114, delegationId: 862, }, visualisations: { requestUrls: { getAllEventsCommitteeBySession: '/vis/getAllEventsCommitteeBySession/-1/', committeeMusicTreeJson: '/vis/committee_music_tree_json/-1', committeeMusicTreeJsonWithDocumentId: '/vis/committee_music_tree_json/-1/-2', getPersonConventionInvolvements: '/vis/getPersonConventionInvolvements/-1/', getAllConventionTrees: '/vis/getAllConventionTrees/-1/', getSearchTermResultInRadialTree: '/vis/getSearchTermResultInRadialTree/-1/-2', getSearchTermResultInRadialTreeCommittee: '/vis/getSearchTermResultInRadialTreeCommittee/-1/-2', getCommentarySessionMaps: '/vis/commentary_session_maps/-1', getConventionSessionMap: '/vis/convention_session_map/-1', sessionSearch: '/vis/session_search/-1/-2', sessionSearchWithCommitteeId: '/vis/session_search/-1/-2/-3', getTreesForCommittee: '/vis/getTreeForCommittee/-1', getTreesForCommitteeWithSessionId: '/vis/getTreeForCommittee/-1/-2', listResourcesJson: '/vis/list_resources_json/-1', getDocumentRelationshipsGraph: '/vis/document_relationships_graph/-1', getDocumentTree: '/vis/document_tree/-1', getKeywords: '/vis/getKeywords', getKeywordsInConvention: '/vis/getKeywordsInConvention/', getKeywordDescription: '/vis/get_keyword_description/-1', getListOfEventsBasedOnKeywordEventType: '/vis/getListOfEventsBasedOnKeywordEventType/', getKeyDocumentsByConvention: '/vis/key_documents/-1', documentsVisualizeHighlightRoute: '/vis/documents_visualize_highlight_route/-1/-2', getCommitteesAndSessions: '/vis/getCommitteesAndSessions', getSearchResultForDocumentFlow: '/vis/getSearchResultForDocumentFlow/-1/-2', getRelatedEvents: '/vis/getRelatedEvents/-1', getTextForProposal: '/vis/getTextForProposal', getEventItem: '/vis/getEventItem/-1', getTargetDocumentId: '/vis/getTargetDocumentId', getSearchTermResultInRadialTreeUpToEvent: '/vis/getSearchTermResultInRadialTreeUpToEvent/-1/-2', getPersonVotesCommitteeBySession: '/vis/getPersonVotesCommitteeBySession/-1/', getProjectionData: '/vis/projection_data/-1/', getResourceMaps: '/vis/resource_maps/-1', getHighlightsForEvent: '/vis/getHighlightsForEvent', getTreeWhenCurrentDocumentRowClicked: '/vis/getTreeWhenCurrentDocumentRowClicked', compareAncestorDocuments: '/vis/compare_ancestor_documents/-1', compareAncestorDocumentsWithUntil: '/vis/compare_ancestor_documents/-1/-2', getEventDataAll: '/vis/getEventDataAll/-1', getEventDataAllWithType: '/vis/getEventDataAll/-1/-2', getSubDecisionEventDataAll: '/vis/getSubDecisionEventDataAll/-1', getSessionEventDetailsNoTextWithPermission: '/vis/getSessionEventDetailsNoTextWithPermission/-1/-2', getResources: '/vis/getResources', getCommentaries: '/vis/getCommentaries', getPermissionCanEditTimeline: '/vis/getPermissionCanEditTimeline', getConventionSummaryJson: '/vis/convention_summary_json/-1', getSessionEventDetailsJSON: '/vis/getSessionEventDetailsJSON/-1', getSessionEventDetailsInAddEventJSON: '/vis/getSessionEventDetailsInAddEventJSON/-1/-2/-3', putKeywordsInDropdown: '/vis/putKeywordsInDropdown/', getValidProposalsWithoutTexts: '/vis/getValidProposalsWithoutTexts', getDocumentVersionObject: '/vis/getDocumentVersionObject', getTargetEventDetails: '/vis/getTargetEventDetails/-1/', getTargetEventDetailsFromSubdecision: '/vis/getTargetEventDetailsFromSubdecision/-1/', }, }, urls: { baseUrl: '/m2/', currentPath: '/m2/js/config.js', committee: { view_details: '/m2/committee/-1', }, votingRecord: '/m2/votingRecord/-1', eventExtraDescription: '/m2/event_exta_description/-1', }, pages: { library: { section: librarySection, // Passed from global setting in base2 template }, }, imgPath: 'img/', iconPath: '/m2/static/img/icons2', contentFilter: { elements: { searchInputClass: 'quill-filter-input', searchSelectClass: 'quill-filter-select', searchMultiSelectClass: 'quill-filter-multi-select', resultTotalClass: 'quill-filter-result-total', wrapperClass: 'quill-filter-wrapper', contentSwitchTriggerClass: 'quill-content-switch-trigger' } }, validation: { emailRegex: /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/, }, utilities: { elements: { jumpToBadgeClass: 'jump-to-badge', jumpToCodeClass: 'jump-to-code', chevronButtonClass: 'btn-chevron', selectVisibilityToggleClass: 'select-visibility-toggle', toggleContentTriggerClass: 'quill-toggle-content-trigger', toggleContentViewClass: 'quill-toggle-content-view', btnUpdateTotalClass: 'btn-update-filter-total', btnBoxSwitchClass: 'quill-box-select', btnToggleColsClass: 'quill-toggle-cols', heightMatchClass: 'quill-height-matcher', contactFormPrepopulateButtonClass: 'btn-contact-form-trigger', toggleHiddenClass: 'quill-toggle-hidden' }, jumpToUrlPath: 'https://www.quillproject.net/fetch/' }, notifications: { data: [], elements: { containerId: 'quill-notifications' } }, forms: { elements: { buttonSubmitClass: 'btn-quill-form', feedbackClass: 'invalid-feedback', linkApiClass: 'quill-api-link' } }, subMenu: { elements: { secondaryNavLinkClass: 'secondary-nav-link', secondaryNavClass: 'secondary-nav', dropdownOpenMenuClass: 'dropdown-open-menu', dropdownCloseLinkClass: 'dropdown-close-link', scrollToLinkClass: 'in-page-scroll-link' }, animateSpeed: 150, waitForAccordionOpenTime: 100 }, sidebar: { elements: { linkTriggerClass: 'sidebar-content-link', sidebarTitleId: 'sidebar-label', sidebarId: 'offcanvas-sidebar', sidebarContentClass: 'sidebar-content', }, }, visualisationHandler: { elements: { triggerClass: 'quill-visualisation-trigger', contextSwitchClass: 'quill-convention-context-switch' } }, iconHelp: { elements: { pageWrapperId: 'icon-help-pages', pageClass: 'icon-help-page', navButtonClass: 'icon-help-nav-button', toggleViewButtonId: 'icon-help-toggle-view' }, data: [ { title: 'Individuals and Opinion Rights', subtitle: 'Displayed with a round icon', icons: [ { label: 'Joining a committee', image: 'icon-people-join.svg', }, { label: 'Leaving a committee', image: 'icon-people-leave.svg', }, { label: 'Elected to a position', image: 'icon-people-vote.svg', }, { label: 'Roll-call', image: 'icon-people-attendance.svg', }, ] }, { title: 'Amending of Documents', subtitle: 'Displayed with parchment coloured, square icons', icons: [ { label: 'Create a proposal', image: 'icon-doc-subtype-script-add.svg' }, { label: 'Create a document (line by line revision)', image: 'icon-doc-subtype-script-amend.svg' }, { label: 'Document amendment proposed', image: 'icon-doc-amend.svg' }, { label: 'Document taken from another committee', image: 'icon-doc-subtype-script-import.svg' }, { label: 'Amendment taken from another committee', image: 'icon-doc-amend-import.svg' }, { label: 'Debate a proposal', image: 'icon-doc-debate.svg' } ] }, { title: 'Explicit Document Subtypes', subtitle: 'Displayed with parchment coloured, square backgrounds with specific icons', icons: [ { label: 'Legislative text', image: 'icon-doc-subtype-legislation-add.svg' }, { label: 'Formal resolutions', image: 'icon-doc-subtype-decision-add.svg' }, { label: 'Message to be sent elsewhere', image: 'icon-doc-subtype-message-add.svg' }, { label: 'Petition to be considered', image: 'icon-doc-subtype-petition-add.svg' }, { label: 'Rules & Order of Business', image: 'icon-doc-subtype-procedure-add.svg' } ] }, { title: 'Decisions Taken', subtitle: 'Diamond shaped, purple icons', icons: [ { label: 'Drop a proposal', image: 'icon-decision-drop.svg' }, { label: 'Refer a proposal to another committee', image: 'icon-decision-refer.svg' }, { label: 'Adopt a proposal', image: 'icon-decision-adopt.svg' }, { label: 'Other vote (continue debate)', image: 'icon-decision-forward.svg' }, { label: 'Reject a proposal', image: 'icon-decision-reject.svg' }, { label: 'Postpone a debate', image: 'icon-decision-postpone.svg' } ] }, { title: 'Procedural proposals', subtitle: 'How committees work rather than document amends and represented by blue, hexagon shaped icons', icons: [ { label: 'Procedural motion', image: 'icon-procedure-motion.svg' }, { label: 'Procedural motion with sub-decisions', image: 'icon-procedure-motion-with-subdecisions.svg' }, { label: 'Debate on a procedural motion', image: 'icon-procedure-debate.svg' } ] } ] } }