Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Team planners
      • Boards
      • Meetings
      • News
      • Time and costs
    • Getting started
    • Introduction video
      Welcome to safe.openproject.com
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Team planners
    Team planners
  • Boards
    Boards
  • Meetings
    Meetings
  • Wiki
    Wiki
  • News
  • Members
    Members

Content

You are here:
  1. News
News
  1. Demo project
  2. News
  3. Test syntax highlighting

Test syntax highlighting

Added by Demo admin over 1 year ago

PHP

<?php

final class RateOfAdvancement
{
    public const ASSOCIATION_DIRECTLY = 'DIRECTLY';
    public const ASSOCIATION_INDIRECTLY = 'INDIRECTLY';
    public const ASSOCIATION_NOFICHES = 'NOFICHES';
     
    (...)
 
    public function __construct(int $countFiches, int $countValidated, int $countWip, string $typeAssociation)
    {
        $this->set($countFiches, $countValidated, $countWip, $typeAssociation);
        $this->refresh();
    }
 
    private function refresh(): void
    {
        $countTodo = $this->getCountFiches() - ($this->getCountValidated() + $this->getCountWip());
        if ($countTodo < 0) {
            throw new \InvalidArgumentException('The number of FicheSuiviAmr in todo can be negative !!!');
        }
 
        $this->countTodo = $countTodo;
        if (0 === $this->getCountFiches()) {
            $this->rate = null;
        } else {
            $this->rate = (($this->getCountValidated() + ($this->getCountWip() * 0.5)) / $this->getCountFiches()) * 100;
        }
    }

    (...)
}

Javascript

(function init() {
    window.addEventListener("DOMContentLoaded", (event) => {
        console.debug('[DEBUG] Zen-mode feature enable');

        // Register click on 'zen-mode-button' node element
        const zendModeButton = document.getElementById('zen-mode-button');
        if(zendModeButton !== null && zendModeButton !== undefined) {
            _registerZendModeButtonClick(zendModeButton);
                        console.log('[DEBUG] Zen-mode button found');

        }else{
            console.log('[DEBUG] Zen-mode button not found');
        }
    });
})();

Comments

Loading...