protected function getHead()
 {
     $framebust = null;
     if (!$this->getFrameable()) {
         $framebust = '(top == self) || top.location.replace(self.location.href);';
     }
     $viewport_tag = null;
     if ($this->getDeviceReady()) {
         $viewport_tag = phutil_tag('meta', array('name' => 'viewport', 'content' => 'width=device-width, ' . 'initial-scale=1, ' . 'maximum-scale=1'));
     }
     $icon_tag_76 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-76x76.png')));
     $icon_tag_120 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '120x120', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-120x120.png')));
     $icon_tag_152 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '152x152', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-152x152.png')));
     $apple_tag = phutil_tag('meta', array('name' => 'apple-mobile-web-app-status-bar-style', 'content' => 'black-translucent'));
     $referrer_tag = phutil_tag('meta', array('name' => 'referrer', 'content' => 'never'));
     $response = CelerityAPI::getStaticResourceResponse();
     if ($this->getRequest()) {
         $viewer = $this->getRequest()->getViewer();
         if ($viewer) {
             $postprocessor_key = $viewer->getPreference(PhabricatorUserPreferences::PREFERENCE_RESOURCE_POSTPROCESSOR);
             if (strlen($postprocessor_key)) {
                 $response->setPostProcessorKey($postprocessor_key);
             }
         }
     }
     $developer = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
     return hsprintf('%s%s%s%s%s%s%s%s', $viewport_tag, $icon_tag_76, $icon_tag_120, $icon_tag_152, $apple_tag, $referrer_tag, CelerityStaticResourceResponse::renderInlineScript($framebust . jsprintf('window.__DEV__=%d;', $developer ? 1 : 0)), $response->renderResourcesOfType('css'));
 }
 protected function getHead()
 {
     $framebust = null;
     if (!$this->getFrameable()) {
         $framebust = '(top == self) || top.location.replace(self.location.href);';
     }
     $viewport_tag = null;
     if ($this->getDeviceReady()) {
         $viewport_tag = phutil_tag('meta', array('name' => 'viewport', 'content' => 'width=device-width, ' . 'initial-scale=1, ' . 'maximum-scale=1'));
     }
     $mask_icon = phutil_tag('link', array('rel' => 'mask-icon', 'color' => '#3D4B67', 'href' => celerity_get_resource_uri('/rsrc/favicons/mask-icon.svg')));
     $icon_tag_76 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-76x76.png')));
     $icon_tag_120 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '120x120', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-120x120.png')));
     $icon_tag_152 = phutil_tag('link', array('rel' => 'apple-touch-icon', 'sizes' => '152x152', 'href' => celerity_get_resource_uri('/rsrc/favicons/apple-touch-icon-152x152.png')));
     $favicon_tag = phutil_tag('link', array('id' => 'favicon', 'rel' => 'shortcut icon', 'href' => celerity_get_resource_uri('/rsrc/favicons/favicon.ico')));
     $referrer_tag = phutil_tag('meta', array('name' => 'referrer', 'content' => 'never'));
     $response = CelerityAPI::getStaticResourceResponse();
     if ($this->getRequest()) {
         $viewer = $this->getRequest()->getViewer();
         if ($viewer) {
             $postprocessor_key = $viewer->getUserSetting(PhabricatorAccessibilitySetting::SETTINGKEY);
             if (strlen($postprocessor_key)) {
                 $response->setPostProcessorKey($postprocessor_key);
             }
         }
     }
     $developer = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
     return hsprintf('%s%s%s%s%s%s%s%s%s', $viewport_tag, $mask_icon, $icon_tag_76, $icon_tag_120, $icon_tag_152, $favicon_tag, $referrer_tag, CelerityStaticResourceResponse::renderInlineScript($framebust . jsprintf('window.__DEV__=%d;', $developer ? 1 : 0)), $response->renderResourcesOfType('css'));
 }
 protected function getHead()
 {
     $framebust = null;
     if (!$this->getFrameable()) {
         $framebust = '(top == self) || top.location.replace(self.location.href);';
     }
     $viewport_tag = null;
     if ($this->getDeviceReady()) {
         $viewport_tag = phutil_tag('meta', array('name' => 'viewport', 'content' => 'width=device-width, ' . 'initial-scale=1, ' . 'maximum-scale=1'));
     }
     $icon_tag = phutil_tag('link', array('rel' => 'apple-touch-icon', 'href' => celerity_get_resource_uri('/rsrc/image/apple-touch-icon.png')));
     $apple_tag = phutil_tag('meta', array('name' => 'apple-mobile-web-app-status-bar-style', 'content' => 'black-translucent'));
     $referrer_tag = phutil_tag('meta', array('name' => 'referrer', 'content' => 'never'));
     $response = CelerityAPI::getStaticResourceResponse();
     $developer = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
     return hsprintf('%s%s%s%s%s%s', $viewport_tag, $icon_tag, $apple_tag, $referrer_tag, CelerityStaticResourceResponse::renderInlineScript($framebust . jsprintf('window.__DEV__=%d;', $developer ? 1 : 0)), $response->renderResourcesOfType('css'));
 }
Exemple #4
0
 private function renderDisqusComments()
 {
     $disqus_shortname = PhabricatorEnv::getEnvConfig('disqus.shortname');
     if (!$disqus_shortname) {
         return null;
     }
     $post = $this->getPost();
     $disqus_thread = phutil_tag('div', array('id' => 'disqus_thread'));
     // protip - try some  var disqus_developer = 1; action to test locally
     $disqus_js = CelerityStaticResourceResponse::renderInlineScript(jsprintf(' var disqus_shortname = %s;' . ' var disqus_identifier = %s;' . ' var disqus_url = %s;' . ' var disqus_title = %s;' . '(function() {' . ' var dsq = document.createElement("script");' . ' dsq.type = "text/javascript";' . ' dsq.async = true;' . ' dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";' . '(document.getElementsByTagName("head")[0] ||' . ' document.getElementsByTagName("body")[0]).appendChild(dsq);' . '})();', $disqus_shortname, $post->getPHID(), $this->getSkin()->getURI('post/' . $this->getPost()->getPhameTitle()), $post->getTitle()));
     return phutil_tag('div', array('class' => 'phame-comments-disqus'), array($disqus_thread, $disqus_js));
 }