Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • T TYPO3.CMS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • accessibilityaccessibility
  • TYPO3.CMS
  • Repository
Switch branch/tag
  • TYPO3.CMS
  • ..
  • TypeScript
  • TypeScript
  • Backend.ts
Find file BlameHistoryPermalink
  • Oliver Hader's avatar
    [TASK] Avoid inline JavaScript generated by BackendUtility:viewOnClick · f16b4787
    Oliver Hader authored Jul 16, 2020 and Benni Mack's avatar Benni Mack committed Dec 10, 2020
    Inline JavaScript produced by BackendUtility:viewOnClick is substituted
    with markup based instructions and static JavaScript event handlers.
    
    // basically delivers window.open(generatedUri)
    BackendUtility::viewOnClick($pageId, $backPath, $rootLine, $section,
        $viewUri, $getVars, $switchFocus);
    
    can be substituted with e.g.
    
    \TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create($pageId, $viewUri)
        ->withRootLine($rootLine)
        ->withSection($section)
        ->withAdditionalQueryParameters($getVars)
        ->serializeDispatcherAttributes([
            PreviewUriBuilder::OPTION_SWITCH_FOCUS => $switchFocus,
        ]);
    
    which results in the following HTML data attributes
    (data can be retrieved as array of complete element as well)
    
    data-dispatch-action="TYPO3.WindowManager.localOpen"
    data-dispatch-args="["https://...",null,"previewWin"]"
    
    Resolves: #91123
    Releases: master
    Change-Id: Iedd9bfe60827977677ee68e2c948c63e359abf84
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64243
    
    
    Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    Tested-by: default avatarTYPO3com <noreply@typo3.com>
    Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
    f16b4787