Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/PhabricatorStandardPageView.php
| Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | if ($this->getApplicationMenu()) { | ||||
| $menu->setApplicationMenu($this->getApplicationMenu()); | $menu->setApplicationMenu($this->getApplicationMenu()); | ||||
| } | } | ||||
| $this->menuContent = $menu->render(); | $this->menuContent = $menu->render(); | ||||
| } | } | ||||
| protected function getHead() { | protected function getHead() { | ||||
| $monospaced = PhabricatorEnv::getEnvConfig('style.monospace'); | $monospaced = null; | ||||
| $monospaced_win = PhabricatorEnv::getEnvConfig('style.monospace.windows'); | |||||
| $request = $this->getRequest(); | $request = $this->getRequest(); | ||||
| if ($request) { | if ($request) { | ||||
| $user = $request->getUser(); | $user = $request->getUser(); | ||||
| if ($user) { | if ($user) { | ||||
| $pref = $user->loadPreferences()->getPreference( | $monospaced = $user->loadPreferences()->getPreference( | ||||
| PhabricatorUserPreferences::PREFERENCE_MONOSPACED); | PhabricatorUserPreferences::PREFERENCE_MONOSPACED); | ||||
| $monospaced = nonempty($pref, $monospaced); | |||||
| $monospaced_win = nonempty($pref, $monospaced_win); | |||||
| } | } | ||||
| } | } | ||||
| $response = CelerityAPI::getStaticResourceResponse(); | $response = CelerityAPI::getStaticResourceResponse(); | ||||
| $font_css = null; | $font_css = null; | ||||
| if (!empty($monospaced)) { | if (!empty($monospaced)) { | ||||
| $font_css = hsprintf( | $font_css = hsprintf( | ||||
| '<style type="text/css">'. | '<style type="text/css">'. | ||||
| '.PhabricatorMonospaced, '. | '.PhabricatorMonospaced, '. | ||||
| '.phabricator-remarkup .remarkup-code-block '. | '.phabricator-remarkup .remarkup-code-block '. | ||||
| '.remarkup-code { font: %s !important; } '. | '.remarkup-code { font: %s !important; } '. | ||||
| '</style>', $monospaced); | '</style>', $monospaced); | ||||
| } | } | ||||
| $font_css_win = null; | |||||
| if (!empty($monospaced_win)) { | |||||
| $font_css_win = hsprintf( | |||||
| '<style type="text/css">'. | |||||
| '.platform-windows .PhabricatorMonospaced, '. | |||||
| '.platform-windows .phabricator-remarkup '. | |||||
| '.remarkup-code-block .remarkup-code { font: %s !important; }'. | |||||
| '</style>', $monospaced_win); | |||||
| } | |||||
| return hsprintf( | return hsprintf( | ||||
| '%s%s%s%s', | '%s%s%s', | ||||
| parent::getHead(), | parent::getHead(), | ||||
| $font_css, | $font_css, | ||||
| $font_css_win, | |||||
| $response->renderSingleResource('javelin-magical-init', 'phabricator')); | $response->renderSingleResource('javelin-magical-init', 'phabricator')); | ||||
| } | } | ||||
| public function setGlyph($glyph) { | public function setGlyph($glyph) { | ||||
| $this->glyph = $glyph; | $this->glyph = $glyph; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines | |||||