diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -10,7 +10,7 @@ 'conpherence.pkg.css' => '3c8a0668', 'conpherence.pkg.js' => '020aebcf', 'core.pkg.css' => 'a1c2d49b', - 'core.pkg.js' => 'a747b035', + 'core.pkg.js' => 'a568e834', 'differential.pkg.css' => '8d8360fb', 'differential.pkg.js' => '67e02996', 'diffusion.pkg.css' => '42c75c37', @@ -86,7 +86,7 @@ 'rsrc/css/application/paste/paste.css' => 'b37bcd38', 'rsrc/css/application/people/people-picture-menu-item.css' => 'fe8e07cf', 'rsrc/css/application/people/people-profile.css' => '2ea2daa1', - 'rsrc/css/application/phame/phame.css' => '799febf9', + 'rsrc/css/application/phame/phame.css' => 'bb442327', 'rsrc/css/application/pholio/pholio-edit.css' => '4df55b3b', 'rsrc/css/application/pholio/pholio-inline-comments.css' => '722b48c2', 'rsrc/css/application/pholio/pholio.css' => '88ef5ef1', @@ -217,7 +217,7 @@ 'rsrc/externals/javelin/core/init.js' => '98e6504a', 'rsrc/externals/javelin/core/init_node.js' => '16961339', 'rsrc/externals/javelin/core/install.js' => '5902260c', - 'rsrc/externals/javelin/core/util.js' => '22ae1776', + 'rsrc/externals/javelin/core/util.js' => 'edb4d8c9', 'rsrc/externals/javelin/docs/Base.js' => '5a401d7d', 'rsrc/externals/javelin/docs/onload.js' => 'ee58fb62', 'rsrc/externals/javelin/ext/fx/Color.js' => '78f811c9', @@ -259,7 +259,7 @@ 'rsrc/externals/javelin/lib/__tests__/JSON.js' => '710377ae', 'rsrc/externals/javelin/lib/__tests__/URI.js' => '6fff0c2b', 'rsrc/externals/javelin/lib/__tests__/behavior.js' => '8426ebeb', - 'rsrc/externals/javelin/lib/behavior.js' => 'fce5d170', + 'rsrc/externals/javelin/lib/behavior.js' => '1b6acc2a', 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '89a1ae3a', 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'a4356cde', 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'a241536a', @@ -571,7 +571,7 @@ 'herald-test-css' => 'e004176f', 'inline-comment-summary-css' => '81eb368d', 'javelin-aphlict' => '022516b4', - 'javelin-behavior' => 'fce5d170', + 'javelin-behavior' => '1b6acc2a', 'javelin-behavior-aphlict-dropdown' => 'e9a2940f', 'javelin-behavior-aphlict-listen' => '4e61fa88', 'javelin-behavior-aphlict-status' => 'c3703a16', @@ -729,7 +729,7 @@ 'javelin-typeahead-source' => '8badee71', 'javelin-typeahead-static-source' => '80bff3af', 'javelin-uri' => '2e255291', - 'javelin-util' => '22ae1776', + 'javelin-util' => 'edb4d8c9', 'javelin-vector' => 'e9c80beb', 'javelin-view' => '289bf236', 'javelin-view-html' => 'f8c4e135', @@ -798,7 +798,7 @@ 'phabricator-tooltip' => '83754533', 'phabricator-ui-example-css' => 'b4795059', 'phabricator-zindex-css' => '99c0f5eb', - 'phame-css' => '799febf9', + 'phame-css' => 'bb442327', 'pholio-css' => '88ef5ef1', 'pholio-edit-css' => '4df55b3b', 'pholio-inline-comments-css' => '722b48c2', @@ -1029,6 +1029,10 @@ 'javelin-stratcom', 'javelin-util', ), + '1b6acc2a' => array( + 'javelin-magical-init', + 'javelin-util', + ), '1c850a26' => array( 'javelin-install', 'javelin-util', @@ -2175,10 +2179,6 @@ 'phabricator-keyboard-shortcut', 'conpherence-thread-manager', ), - 'fce5d170' => array( - 'javelin-magical-init', - 'javelin-util', - ), 'fdc13e4e' => array( 'javelin-install', ), diff --git a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php --- a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php +++ b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php @@ -238,6 +238,7 @@ 'grey.button.gradient' => 'linear-gradient(to bottom, #ffffff, #f1f0f1)', 'grey.button.hover' => 'linear-gradient(to bottom, #ffffff, #eeebec)', + 'document.border' => '#dedee1', ); } diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php --- a/src/applications/phame/controller/post/PhamePostViewController.php +++ b/src/applications/phame/controller/post/PhamePostViewController.php @@ -24,7 +24,7 @@ $hero = $this->buildPhamePostHeader($post); - if (!$is_external) { + if (!$is_external && $viewer->isLoggedIn()) { $actions = $this->renderActions($post); $header->setPolicyObject($post); $header->setActionList($actions); @@ -136,7 +136,7 @@ ->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT))); $timeline->setQuoteRef($monogram); - if ($is_external) { + if ($is_external || !$viewer->isLoggedIn()) { $add_comment = null; } else { $add_comment = $this->buildCommentForm($post, $timeline); diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -304,6 +304,12 @@ )); } + // If we aren't showing the page chrome, skip rendering DarkConsole and the + // main menu, since they won't be visible on the page. + if (!$this->getShowChrome()) { + return; + } + if ($console) { require_celerity_resource('aphront-dark-console-css'); @@ -347,6 +353,7 @@ $menu->setApplicationMenu($application_menu); } + $this->menuContent = $menu->render(); } diff --git a/webroot/rsrc/css/application/phame/phame.css b/webroot/rsrc/css/application/phame/phame.css --- a/webroot/rsrc/css/application/phame/phame.css +++ b/webroot/rsrc/css/application/phame/phame.css @@ -284,6 +284,7 @@ text-align: center; background: {$page.content}; padding: 16px 0 24px; + border-top: 1px solid {$document.border}; } .device-phone .phame-mega-header { diff --git a/webroot/rsrc/css/phui/phui-document-pro.css b/webroot/rsrc/css/phui/phui-document-pro.css --- a/webroot/rsrc/css/phui/phui-document-pro.css +++ b/webroot/rsrc/css/phui/phui-document-pro.css @@ -56,7 +56,7 @@ .phui-document-container { background-color: {$page.content}; position: relative; - border-bottom: 1px solid #dedee1; + border-bottom: 1px solid {$document.border}; } .phui-document-view-pro-box, diff --git a/webroot/rsrc/externals/javelin/core/util.js b/webroot/rsrc/externals/javelin/core/util.js --- a/webroot/rsrc/externals/javelin/core/util.js +++ b/webroot/rsrc/externals/javelin/core/util.js @@ -295,9 +295,69 @@ * @return void */ JX.log = function(message) { + // "JX.log()" accepts "Error" in addition to "string". Only try to + // treat the argument as a "sprintf()" pattern if it's a string. + if (typeof message === 'string') { + message = JX.sprintf.apply(null, arguments); + } window.console.log(message); }; +JX.sprintf = function(pattern) { + var argv = Array.prototype.slice.call(arguments); + argv.reverse(); + + // Pop off the pattern argument. + argv.pop(); + + var len = pattern.length; + var output = ''; + for (var ii = 0; ii < len; ii++) { + var c = pattern.charAt(ii); + + if (c !== '%') { + output += c; + continue; + } + + ii++; + + var next = pattern.charAt(ii); + if (next === '%') { + // This is "%%" (that is, an escaped "%" symbol), so just add a literal + // "%" to the result. + output += '%'; + continue; + } + + if (next === 's') { + if (!argv.length) { + throw new Error( + 'Too few arguments to "JX.sprintf(...)" for pattern: ' + pattern); + } + + output += '' + argv.pop(); + + continue; + } + + if (next === '') { + throw new Error( + 'Pattern passed to "JX.sprintf(...)" ends with "%": ' + pattern); + } + + throw new Error( + 'Unknown conversion "%' + c + '" passed to "JX.sprintf(...)" in ' + + 'pattern: ' + pattern); + } + + if (argv.length) { + throw new Error( + 'Too many arguments to "JX.sprintf()" for pattern: ' + pattern); + } + + return output; +}; if (__DEV__) { window.alert = (function(native_alert) { diff --git a/webroot/rsrc/externals/javelin/lib/behavior.js b/webroot/rsrc/externals/javelin/lib/behavior.js --- a/webroot/rsrc/externals/javelin/lib/behavior.js +++ b/webroot/rsrc/externals/javelin/lib/behavior.js @@ -91,7 +91,14 @@ configs = [null]; } for (var ii = 0; ii < configs.length; ii++) { - JX.behavior._behaviors[name](configs[ii], JX.behavior._statics[name]); + try { + JX.behavior._behaviors[name](configs[ii], JX.behavior._statics[name]); + } catch (behavior_exception) { + JX.log( + 'JX.initBehaviors(...): behavior "%s" raised an error during setup.', + name); + JX.log(behavior_exception); + } } JX.behavior._initialized[name] = true; }