From 05692182010dbf4757ae314b91ece9e2a1254d91 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 18 May 2013 17:04:22 -0700 Subject: [PATCH] Use `JsShrink` if `jsxmin` is not available Summary: If `jsxmin` is not available, use a pure PHP implementation instead (JsShrink). Test Plan: - Ran `arc lint --lintall` on all JS and fixed every relevant warning. - Forced minification on and browsed around the site using JS behaviors. Didn't hit anything problematic. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5670 --- .arcconfig | 3 +- externals/JsShrink/jsShrink.php | 45 ++ externals/JsShrink/readme.txt | 23 + src/__celerity_resource_map__.php | 476 +++++++++--------- .../celerity/CelerityResourceTransformer.php | 19 +- .../lint/PhabricatorLintEngine.php | 27 +- .../lint/linter/PhabricatorJavelinLinter.php | 17 +- support/aphlict/server/aphlict_server.js | 14 +- support/jshint/jshintconfig | 5 + webroot/rsrc/externals/javelin/core/Event.js | 2 +- webroot/rsrc/externals/javelin/core/init.js | 16 +- webroot/rsrc/externals/javelin/core/util.js | 6 +- .../externals/javelin/ext/reactor/dom/RDOM.js | 1 + .../externals/javelin/ext/view/HTMLView.js | 6 +- .../rsrc/externals/javelin/ext/view/View.js | 11 +- .../javelin/ext/view/ViewInterpreter.js | 4 +- .../javelin/ext/view/ViewPlaceholder.js | 6 +- .../javelin/ext/view/ViewRenderer.js | 1 + .../ext/view/__tests__/ViewRenderer.js | 4 +- webroot/rsrc/externals/javelin/lib/DOM.js | 16 +- webroot/rsrc/externals/javelin/lib/Mask.js | 2 +- webroot/rsrc/externals/javelin/lib/Request.js | 4 +- .../rsrc/externals/javelin/lib/Resource.js | 5 +- webroot/rsrc/externals/javelin/lib/URI.js | 2 +- webroot/rsrc/externals/javelin/lib/Vector.js | 8 +- .../rsrc/externals/javelin/lib/Workflow.js | 2 +- .../externals/javelin/lib/__tests__/URI.js | 2 +- .../rsrc/externals/javelin/lib/behavior.js | 1 + .../lib/control/tokenizer/Tokenizer.js | 2 +- .../source/TypeaheadOnDemandSource.js | 1 - .../source/TypeaheadPreloadedSource.js | 1 - .../typeahead/source/TypeaheadSource.js | 5 +- webroot/rsrc/externals/raphael/g.raphael.js | 1 + .../rsrc/externals/raphael/g.raphael.line.js | 1 + webroot/rsrc/externals/raphael/raphael.js | 1 + .../aphlict/behavior-aphlict-dropdown.js | 8 +- .../aphlict/behavior-aphlict-listen.js | 20 +- .../conpherence/behavior-widget-pane.js | 22 +- .../rsrc/js/application/countdown/timer.js | 1 - .../DifferentialInlineCommentEditor.js | 10 +- .../differential/behavior-comment-jump.js | 4 +- .../differential/behavior-comment-preview.js | 5 +- .../differential/behavior-dropdown-menus.js | 2 +- .../behavior-edit-inline-comments.js | 4 +- .../differential/behavior-keyboard-nav.js | 7 +- .../differential/behavior-populate.js | 2 +- .../behavior-show-all-comments.js | 2 +- .../diffusion/behavior-audit-preview.js | 2 +- .../diffusion/behavior-commit-graph.js | 30 +- .../application/diffusion/behavior-jump-to.js | 1 - .../maniphest/behavior-batch-editor.js | 2 +- .../maniphest/behavior-batch-selector.js | 12 +- .../maniphest/behavior-task-preview.js | 2 +- .../behavior-transaction-controls.js | 2 +- .../maniphest/behavior-transaction-preview.js | 2 +- .../application/phame/phame-post-preview.js | 12 +- .../pholio/behavior-pholio-mock-view.js | 18 +- .../phriction/phriction-document-preview.js | 2 +- .../js/application/ponder/behavior-votebox.js | 4 +- .../releeph/releeph-preview-branch.js | 9 +- .../releeph/releeph-request-state-change.js | 6 +- .../releeph/releeph-request-typeahead.js | 7 +- .../slowvote/behavior-slowvote-embed.js | 2 +- .../behavior-transaction-comment-form.js | 2 +- .../uiexample/JavelinViewExample.js | 2 - .../uiexample/ReactorButtonExample.js | 4 +- .../uiexample/ReactorCheckboxExample.js | 2 - .../uiexample/ReactorFocusExample.js | 2 - .../uiexample/ReactorInputExample.js | 3 - .../uiexample/ReactorMouseoverExample.js | 2 - .../uiexample/ReactorRadioExample.js | 2 - .../uiexample/ReactorSelectExample.js | 4 +- .../uiexample/ReactorSendClassExample.js | 2 - .../uiexample/ReactorSendPropertiesExample.js | 2 - .../application/uiexample/gesture-example.js | 10 +- .../uiexample/notification-example.js | 1 - webroot/rsrc/js/core/DragAndDropFileUpload.js | 4 +- webroot/rsrc/js/core/FileUpload.js | 7 +- webroot/rsrc/js/core/Hovercard.js | 6 +- webroot/rsrc/js/core/Prefab.js | 4 +- webroot/rsrc/js/core/ToolTip.js | 16 +- webroot/rsrc/js/core/behavior-active-nav.js | 11 +- .../rsrc/js/core/behavior-fancy-datepicker.js | 19 +- .../js/core/behavior-global-drag-and-drop.js | 2 +- webroot/rsrc/js/core/behavior-hovercard.js | 2 +- .../js/core/behavior-lightbox-attachments.js | 2 +- .../rsrc/js/core/behavior-object-selector.js | 4 +- webroot/rsrc/js/core/behavior-oncopy.js | 4 +- .../rsrc/js/core/behavior-phabricator-nav.js | 10 +- .../behavior-phabricator-remarkup-assist.js | 14 +- webroot/rsrc/js/core/behavior-refresh-csrf.js | 3 +- .../rsrc/js/core/behavior-reveal-content.js | 5 +- .../rsrc/js/core/behavior-search-typeahead.js | 7 +- webroot/rsrc/js/core/phtize.js | 1 + 94 files changed, 598 insertions(+), 501 deletions(-) create mode 100644 externals/JsShrink/jsShrink.php create mode 100644 externals/JsShrink/readme.txt create mode 100644 support/jshint/jshintconfig diff --git a/.arcconfig b/.arcconfig index 1e949e42ce..2d7555dc10 100644 --- a/.arcconfig +++ b/.arcconfig @@ -6,5 +6,6 @@ "phutil_libraries" : { "phabricator" : "src/" }, - "lint.xhpast.naminghook" : "PhabricatorSymbolNameLinter" + "lint.xhpast.naminghook" : "PhabricatorSymbolNameLinter", + "lint.jshint.config" : "support/jshint/jshintconfig" } diff --git a/externals/JsShrink/jsShrink.php b/externals/JsShrink/jsShrink.php new file mode 100644 index 0000000000..36f1c39335 --- /dev/null +++ b/externals/JsShrink/jsShrink.php @@ -0,0 +1,45 @@ + + +Usage JavaScript: + + + +Note: +Google Closure Compiler is much more powerful and efficient tool. +JsShrink was created for those looking for PHP or JavaScript only solution. +Most other JS minifiers are not able to process valid JavaScript code: +http://php.vrana.cz/minifikace-javascriptu.php#srovnani diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 4cfe033d0d..929b412f44 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -981,7 +981,7 @@ celerity_register_resource_map(array( ), 'differential-inline-comment-editor' => array( - 'uri' => '/res/e0ad34ac/rsrc/js/application/differential/DifferentialInlineCommentEditor.js', + 'uri' => '/res/37e0564f/rsrc/js/application/differential/DifferentialInlineCommentEditor.js', 'type' => 'js', 'requires' => array( @@ -1161,17 +1161,18 @@ celerity_register_resource_map(array( ), 'javelin-behavior' => array( - 'uri' => '/res/adf7368b/rsrc/externals/javelin/lib/behavior.js', + 'uri' => '/res/15482715/rsrc/externals/javelin/lib/behavior.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-magical-init', + 1 => 'javelin-util', ), 'disk' => '/rsrc/externals/javelin/lib/behavior.js', ), 'javelin-behavior-aphlict-dropdown' => array( - 'uri' => '/res/2418f448/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js', + 'uri' => '/res/b3be58e8/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js', 'type' => 'js', 'requires' => array( @@ -1186,7 +1187,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-aphlict-listen' => array( - 'uri' => '/res/6dde3f43/rsrc/js/application/aphlict/behavior-aphlict-listen.js', + 'uri' => '/res/7487f207/rsrc/js/application/aphlict/behavior-aphlict-listen.js', 'type' => 'js', 'requires' => array( @@ -1277,7 +1278,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-audit-preview' => array( - 'uri' => '/res/3048b073/rsrc/js/application/diffusion/behavior-audit-preview.js', + 'uri' => '/res/d8f31e46/rsrc/js/application/diffusion/behavior-audit-preview.js', 'type' => 'js', 'requires' => array( @@ -1347,7 +1348,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-conpherence-widget-pane' => array( - 'uri' => '/res/a9bcb950/rsrc/js/application/conpherence/behavior-widget-pane.js', + 'uri' => '/res/d2063fd4/rsrc/js/application/conpherence/behavior-widget-pane.js', 'type' => 'js', 'requires' => array( @@ -1363,13 +1364,12 @@ celerity_register_resource_map(array( ), 'javelin-behavior-countdown-timer' => array( - 'uri' => '/res/7468acb7/rsrc/js/application/countdown/timer.js', + 'uri' => '/res/3c52aac2/rsrc/js/application/countdown/timer.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', 1 => 'javelin-dom', - 2 => 'javelin-util', ), 'disk' => '/rsrc/js/application/countdown/timer.js', ), @@ -1427,12 +1427,12 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-comment-jump' => array( - 'uri' => '/res/b580229b/rsrc/js/application/differential/behavior-comment-jump.js', + 'uri' => '/res/8ffb4222/rsrc/js/application/differential/behavior-comment-jump.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', - 1 => 'javelin-util', + 1 => 'javelin-stratcom', 2 => 'javelin-dom', ), 'disk' => '/rsrc/js/application/differential/behavior-comment-jump.js', @@ -1451,7 +1451,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-dropdown-menus' => array( - 'uri' => '/res/4e3f1e2f/rsrc/js/application/differential/behavior-dropdown-menus.js', + 'uri' => '/res/f04cf682/rsrc/js/application/differential/behavior-dropdown-menus.js', 'type' => 'js', 'requires' => array( @@ -1467,7 +1467,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-edit-inline-comments' => array( - 'uri' => '/res/70c1f3a3/rsrc/js/application/differential/behavior-edit-inline-comments.js', + 'uri' => '/res/86f459a4/rsrc/js/application/differential/behavior-edit-inline-comments.js', 'type' => 'js', 'requires' => array( @@ -1482,7 +1482,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-feedback-preview' => array( - 'uri' => '/res/5fbce8db/rsrc/js/application/differential/behavior-comment-preview.js', + 'uri' => '/res/4421fac6/rsrc/js/application/differential/behavior-comment-preview.js', 'type' => 'js', 'requires' => array( @@ -1497,7 +1497,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-keyboard-navigation' => array( - 'uri' => '/res/89e93cc9/rsrc/js/application/differential/behavior-keyboard-nav.js', + 'uri' => '/res/22ed93ba/rsrc/js/application/differential/behavior-keyboard-nav.js', 'type' => 'js', 'requires' => array( @@ -1510,7 +1510,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-populate' => array( - 'uri' => '/res/526c2615/rsrc/js/application/differential/behavior-populate.js', + 'uri' => '/res/bb9a29f4/rsrc/js/application/differential/behavior-populate.js', 'type' => 'js', 'requires' => array( @@ -1527,7 +1527,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-differential-show-all-comments' => array( - 'uri' => '/res/5a26be1a/rsrc/js/application/differential/behavior-show-all-comments.js', + 'uri' => '/res/8801848d/rsrc/js/application/differential/behavior-show-all-comments.js', 'type' => 'js', 'requires' => array( @@ -1602,7 +1602,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-diffusion-commit-graph' => array( - 'uri' => '/res/62bd2035/rsrc/js/application/diffusion/behavior-commit-graph.js', + 'uri' => '/res/536b8483/rsrc/js/application/diffusion/behavior-commit-graph.js', 'type' => 'js', 'requires' => array( @@ -1614,14 +1614,13 @@ celerity_register_resource_map(array( ), 'javelin-behavior-diffusion-jump-to' => array( - 'uri' => '/res/7c42e1ba/rsrc/js/application/diffusion/behavior-jump-to.js', + 'uri' => '/res/bade44bd/rsrc/js/application/diffusion/behavior-jump-to.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', - 1 => 'javelin-util', - 2 => 'javelin-vector', - 3 => 'javelin-dom', + 1 => 'javelin-vector', + 2 => 'javelin-dom', ), 'disk' => '/rsrc/js/application/diffusion/behavior-jump-to.js', ), @@ -1663,7 +1662,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-fancy-datepicker' => array( - 'uri' => '/res/9b67a0f4/rsrc/js/core/behavior-fancy-datepicker.js', + 'uri' => '/res/f5c13e07/rsrc/js/core/behavior-fancy-datepicker.js', 'type' => 'js', 'requires' => array( @@ -1677,7 +1676,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-global-drag-and-drop' => array( - 'uri' => '/res/528e18ed/rsrc/js/core/behavior-global-drag-and-drop.js', + 'uri' => '/res/ee8e9c39/rsrc/js/core/behavior-global-drag-and-drop.js', 'type' => 'js', 'requires' => array( @@ -1724,7 +1723,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-lightbox-attachments' => array( - 'uri' => '/res/f2b17609/rsrc/js/core/behavior-lightbox-attachments.js', + 'uri' => '/res/72b4d3a8/rsrc/js/core/behavior-lightbox-attachments.js', 'type' => 'js', 'requires' => array( @@ -1763,7 +1762,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-maniphest-batch-editor' => array( - 'uri' => '/res/00accaec/rsrc/js/application/maniphest/behavior-batch-editor.js', + 'uri' => '/res/81b2b86f/rsrc/js/application/maniphest/behavior-batch-editor.js', 'type' => 'js', 'requires' => array( @@ -1778,7 +1777,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-maniphest-batch-selector' => array( - 'uri' => '/res/f8cf3b84/rsrc/js/application/maniphest/behavior-batch-selector.js', + 'uri' => '/res/c33cb5e3/rsrc/js/application/maniphest/behavior-batch-selector.js', 'type' => 'js', 'requires' => array( @@ -1791,7 +1790,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-maniphest-description-preview' => array( - 'uri' => '/res/8acd6f07/rsrc/js/application/maniphest/behavior-task-preview.js', + 'uri' => '/res/58ba0ec2/rsrc/js/application/maniphest/behavior-task-preview.js', 'type' => 'js', 'requires' => array( @@ -1819,7 +1818,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-maniphest-transaction-controls' => array( - 'uri' => '/res/62465554/rsrc/js/application/maniphest/behavior-transaction-controls.js', + 'uri' => '/res/e8498688/rsrc/js/application/maniphest/behavior-transaction-controls.js', 'type' => 'js', 'requires' => array( @@ -1844,7 +1843,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-maniphest-transaction-preview' => array( - 'uri' => '/res/855c9f0c/rsrc/js/application/maniphest/behavior-transaction-preview.js', + 'uri' => '/res/9447a3f9/rsrc/js/application/maniphest/behavior-transaction-preview.js', 'type' => 'js', 'requires' => array( @@ -1870,7 +1869,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-active-nav' => array( - 'uri' => '/res/326866c1/rsrc/js/core/behavior-active-nav.js', + 'uri' => '/res/9c8d3df8/rsrc/js/core/behavior-active-nav.js', 'type' => 'js', 'requires' => array( @@ -1922,7 +1921,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-gesture-example' => array( - 'uri' => '/res/da636e19/rsrc/js/application/uiexample/gesture-example.js', + 'uri' => '/res/91d1e7f2/rsrc/js/application/uiexample/gesture-example.js', 'type' => 'js', 'requires' => array( @@ -1935,7 +1934,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-hovercards' => array( - 'uri' => '/res/ed56d3c4/rsrc/js/core/behavior-hovercard.js', + 'uri' => '/res/4fe6b436/rsrc/js/core/behavior-hovercard.js', 'type' => 'js', 'requires' => array( @@ -1975,7 +1974,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-nav' => array( - 'uri' => '/res/ede26aac/rsrc/js/core/behavior-phabricator-nav.js', + 'uri' => '/res/afabcf16/rsrc/js/core/behavior-phabricator-nav.js', 'type' => 'js', 'requires' => array( @@ -1985,25 +1984,26 @@ celerity_register_resource_map(array( 3 => 'javelin-dom', 4 => 'javelin-magical-init', 5 => 'javelin-vector', + 6 => 'javelin-request', + 7 => 'javelin-util', ), 'disk' => '/rsrc/js/core/behavior-phabricator-nav.js', ), 'javelin-behavior-phabricator-notification-example' => array( - 'uri' => '/res/a6d51998/rsrc/js/application/uiexample/notification-example.js', + 'uri' => '/res/7c50cefd/rsrc/js/application/uiexample/notification-example.js', 'type' => 'js', 'requires' => array( 0 => 'phabricator-notification', 1 => 'javelin-stratcom', 2 => 'javelin-behavior', - 3 => 'javelin-uri', ), 'disk' => '/rsrc/js/application/uiexample/notification-example.js', ), 'javelin-behavior-phabricator-object-selector' => array( - 'uri' => '/res/31145104/rsrc/js/core/behavior-object-selector.js', + 'uri' => '/res/461f95f7/rsrc/js/core/behavior-object-selector.js', 'type' => 'js', 'requires' => array( @@ -2016,7 +2016,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-oncopy' => array( - 'uri' => '/res/c5839892/rsrc/js/core/behavior-oncopy.js', + 'uri' => '/res/cd3a9345/rsrc/js/core/behavior-oncopy.js', 'type' => 'js', 'requires' => array( @@ -2027,7 +2027,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-remarkup-assist' => array( - 'uri' => '/res/ddfb4eba/rsrc/js/core/behavior-phabricator-remarkup-assist.js', + 'uri' => '/res/6d9c05d9/rsrc/js/core/behavior-phabricator-remarkup-assist.js', 'type' => 'js', 'requires' => array( @@ -2043,7 +2043,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-reveal-content' => array( - 'uri' => '/res/5f9da91f/rsrc/js/core/behavior-reveal-content.js', + 'uri' => '/res/fef525ef/rsrc/js/core/behavior-reveal-content.js', 'type' => 'js', 'requires' => array( @@ -2055,7 +2055,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-search-typeahead' => array( - 'uri' => '/res/2662f34f/rsrc/js/core/behavior-search-typeahead.js', + 'uri' => '/res/b39896d5/rsrc/js/core/behavior-search-typeahead.js', 'type' => 'js', 'requires' => array( @@ -2084,7 +2084,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phabricator-transaction-comment-form' => array( - 'uri' => '/res/acc3ada1/rsrc/js/application/transactions/behavior-transaction-comment-form.js', + 'uri' => '/res/7591a57f/rsrc/js/application/transactions/behavior-transaction-comment-form.js', 'type' => 'js', 'requires' => array( @@ -2124,7 +2124,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phame-post-preview' => array( - 'uri' => '/res/ac4c503a/rsrc/js/application/phame/phame-post-preview.js', + 'uri' => '/res/181d1cbe/rsrc/js/application/phame/phame-post-preview.js', 'type' => 'js', 'requires' => array( @@ -2137,7 +2137,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-pholio-mock-view' => array( - 'uri' => '/res/ecf5f969/rsrc/js/application/pholio/behavior-pholio-mock-view.js', + 'uri' => '/res/0632e7d9/rsrc/js/application/pholio/behavior-pholio-mock-view.js', 'type' => 'js', 'requires' => array( @@ -2158,7 +2158,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-phriction-document-preview' => array( - 'uri' => '/res/f1665ecd/rsrc/js/application/phriction/phriction-document-preview.js', + 'uri' => '/res/e2fe02de/rsrc/js/application/phriction/phriction-document-preview.js', 'type' => 'js', 'requires' => array( @@ -2184,7 +2184,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-ponder-votebox' => array( - 'uri' => '/res/9d091af3/rsrc/js/application/ponder/behavior-votebox.js', + 'uri' => '/res/d8c973a2/rsrc/js/application/ponder/behavior-votebox.js', 'type' => 'js', 'requires' => array( @@ -2211,7 +2211,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-refresh-csrf' => array( - 'uri' => '/res/424ccc57/rsrc/js/core/behavior-refresh-csrf.js', + 'uri' => '/res/6c54100f/rsrc/js/core/behavior-refresh-csrf.js', 'type' => 'js', 'requires' => array( @@ -2224,28 +2224,27 @@ celerity_register_resource_map(array( ), 'javelin-behavior-releeph-preview-branch' => array( - 'uri' => '/res/a77ebc86/rsrc/js/application/releeph/releeph-preview-branch.js', + 'uri' => '/res/f694854d/rsrc/js/application/releeph/releeph-preview-branch.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', 1 => 'javelin-dom', - 2 => 'javelin-stratcom', - 3 => 'javelin-uri', - 4 => 'javelin-util', + 2 => 'javelin-uri', + 3 => 'javelin-request', ), 'disk' => '/rsrc/js/application/releeph/releeph-preview-branch.js', ), 'javelin-behavior-releeph-request-state-change' => array( - 'uri' => '/res/38f96ba8/rsrc/js/application/releeph/releeph-request-state-change.js', + 'uri' => '/res/07ecde0c/rsrc/js/application/releeph/releeph-request-state-change.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', 1 => 'javelin-dom', 2 => 'javelin-stratcom', - 3 => 'javelin-util', + 3 => 'javelin-request', 4 => 'phabricator-keyboard-shortcut', 5 => 'phabricator-notification', ), @@ -2253,20 +2252,15 @@ celerity_register_resource_map(array( ), 'javelin-behavior-releeph-request-typeahead' => array( - 'uri' => '/res/b52096e2/rsrc/js/application/releeph/releeph-request-typeahead.js', + 'uri' => '/res/2c2350a0/rsrc/js/application/releeph/releeph-request-typeahead.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', - 1 => 'javelin-util', - 2 => 'javelin-dom', - 3 => 'javelin-typeahead', - 4 => 'javelin-tokenizer', - 5 => 'javelin-typeahead-preloaded-source', - 6 => 'javelin-typeahead-ondemand-source', - 7 => 'javelin-dom', - 8 => 'javelin-stratcom', - 9 => 'javelin-util', + 1 => 'javelin-dom', + 2 => 'javelin-typeahead', + 3 => 'javelin-typeahead-ondemand-source', + 4 => 'javelin-dom', ), 'disk' => '/rsrc/js/application/releeph/releeph-request-typeahead.js', ), @@ -2285,12 +2279,12 @@ celerity_register_resource_map(array( ), 'javelin-behavior-slowvote-embed' => array( - 'uri' => '/res/eef0818f/rsrc/js/application/slowvote/behavior-slowvote-embed.js', + 'uri' => '/res/8e85e20d/rsrc/js/application/slowvote/behavior-slowvote-embed.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', - 1 => 'javelin-util', + 1 => 'javelin-request', 2 => 'javelin-stratcom', 3 => 'javelin-dom', ), @@ -2334,13 +2328,14 @@ celerity_register_resource_map(array( ), 'javelin-behavior-view-placeholder' => array( - 'uri' => '/res/faaf0af7/rsrc/externals/javelin/ext/view/ViewPlaceholder.js', + 'uri' => '/res/6abdb85b/rsrc/externals/javelin/ext/view/ViewPlaceholder.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-behavior', 1 => 'javelin-dom', 2 => 'javelin-view-renderer', + 3 => 'javelin-install', ), 'disk' => '/rsrc/externals/javelin/ext/view/ViewPlaceholder.js', ), @@ -2380,7 +2375,7 @@ celerity_register_resource_map(array( ), 'javelin-dom' => array( - 'uri' => '/res/64689b54/rsrc/externals/javelin/lib/DOM.js', + 'uri' => '/res/175211d6/rsrc/externals/javelin/lib/DOM.js', 'type' => 'js', 'requires' => array( @@ -2407,7 +2402,7 @@ celerity_register_resource_map(array( ), 'javelin-event' => array( - 'uri' => '/res/0a4efce8/rsrc/externals/javelin/core/Event.js', + 'uri' => '/res/5f70f4d0/rsrc/externals/javelin/core/Event.js', 'type' => 'js', 'requires' => array( @@ -2463,7 +2458,7 @@ celerity_register_resource_map(array( ), 'javelin-magical-init' => array( - 'uri' => '/res/7af6987f/rsrc/externals/javelin/core/init.js', + 'uri' => '/res/7c6c8d5a/rsrc/externals/javelin/core/init.js', 'type' => 'js', 'requires' => array( @@ -2472,7 +2467,7 @@ celerity_register_resource_map(array( ), 'javelin-mask' => array( - 'uri' => '/res/5c40c29f/rsrc/externals/javelin/lib/Mask.js', + 'uri' => '/res/465cf513/rsrc/externals/javelin/lib/Mask.js', 'type' => 'js', 'requires' => array( @@ -2494,15 +2489,16 @@ celerity_register_resource_map(array( ), 'javelin-reactor-dom' => array( - 'uri' => '/res/477f5d3b/rsrc/externals/javelin/ext/reactor/dom/RDOM.js', + 'uri' => '/res/5e03117e/rsrc/externals/javelin/ext/reactor/dom/RDOM.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-dom', 1 => 'javelin-dynval', - 2 => 'javelin-reactornode', - 3 => 'javelin-install', - 4 => 'javelin-util', + 2 => 'javelin-reactor', + 3 => 'javelin-reactornode', + 4 => 'javelin-install', + 5 => 'javelin-util', ), 'disk' => '/rsrc/externals/javelin/ext/reactor/dom/RDOM.js', ), @@ -2533,7 +2529,7 @@ celerity_register_resource_map(array( ), 'javelin-request' => array( - 'uri' => '/res/a9fbc4ae/rsrc/externals/javelin/lib/Request.js', + 'uri' => '/res/687bdcfc/rsrc/externals/javelin/lib/Request.js', 'type' => 'js', 'requires' => array( @@ -2549,14 +2545,13 @@ celerity_register_resource_map(array( ), 'javelin-resource' => array( - 'uri' => '/res/1020e732/rsrc/externals/javelin/lib/Resource.js', + 'uri' => '/res/33a3bb57/rsrc/externals/javelin/lib/Resource.js', 'type' => 'js', 'requires' => array( - 0 => 'javelin-magical-init', - 1 => 'javelin-stratcom', - 2 => 'javelin-util', - 3 => 'javelin-uri', + 0 => 'javelin-util', + 1 => 'javelin-uri', + 2 => 'javelin-install', ), 'disk' => '/rsrc/externals/javelin/lib/Resource.js', ), @@ -2575,7 +2570,7 @@ celerity_register_resource_map(array( ), 'javelin-tokenizer' => array( - 'uri' => '/res/2c55cb68/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js', + 'uri' => '/res/7c117141/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js', 'type' => 'js', 'requires' => array( @@ -2623,35 +2618,33 @@ celerity_register_resource_map(array( ), 'javelin-typeahead-ondemand-source' => array( - 'uri' => '/res/9ab98c3d/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js', + 'uri' => '/res/4e5add88/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', 1 => 'javelin-util', - 2 => 'javelin-stratcom', - 3 => 'javelin-request', - 4 => 'javelin-typeahead-source', + 2 => 'javelin-request', + 3 => 'javelin-typeahead-source', ), 'disk' => '/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js', ), 'javelin-typeahead-preloaded-source' => array( - 'uri' => '/res/ffc234d1/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js', + 'uri' => '/res/147900c7/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', 1 => 'javelin-util', - 2 => 'javelin-stratcom', - 3 => 'javelin-request', - 4 => 'javelin-typeahead-source', + 2 => 'javelin-request', + 3 => 'javelin-typeahead-source', ), 'disk' => '/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js', ), 'javelin-typeahead-source' => array( - 'uri' => '/res/df206a51/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js', + 'uri' => '/res/13289259/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js', 'type' => 'js', 'requires' => array( @@ -2675,7 +2668,7 @@ celerity_register_resource_map(array( ), 'javelin-uri' => array( - 'uri' => '/res/a1e5cbb3/rsrc/externals/javelin/lib/URI.js', + 'uri' => '/res/75aa4597/rsrc/externals/javelin/lib/URI.js', 'type' => 'js', 'requires' => array( @@ -2687,7 +2680,7 @@ celerity_register_resource_map(array( ), 'javelin-util' => array( - 'uri' => '/res/322fc289/rsrc/externals/javelin/core/util.js', + 'uri' => '/res/90222113/rsrc/externals/javelin/core/util.js', 'type' => 'js', 'requires' => array( @@ -2696,7 +2689,7 @@ celerity_register_resource_map(array( ), 'javelin-vector' => array( - 'uri' => '/res/c8c64ab7/rsrc/externals/javelin/lib/Vector.js', + 'uri' => '/res/58ea3dd7/rsrc/externals/javelin/lib/Vector.js', 'type' => 'js', 'requires' => array( @@ -2707,7 +2700,7 @@ celerity_register_resource_map(array( ), 'javelin-view' => array( - 'uri' => '/res/3022e596/rsrc/externals/javelin/ext/view/View.js', + 'uri' => '/res/38daaec0/rsrc/externals/javelin/ext/view/View.js', 'type' => 'js', 'requires' => array( @@ -2718,33 +2711,37 @@ celerity_register_resource_map(array( ), 'javelin-view-html' => array( - 'uri' => '/res/1b6e621c/rsrc/externals/javelin/ext/view/HTMLView.js', + 'uri' => '/res/0d225e8c/rsrc/externals/javelin/ext/view/HTMLView.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', + 1 => 'javelin-dom', + 2 => 'javelin-view-visitor', + 3 => 'javelin-util', ), 'disk' => '/rsrc/externals/javelin/ext/view/HTMLView.js', ), 'javelin-view-interpreter' => array( - 'uri' => '/res/39fe3ad3/rsrc/externals/javelin/ext/view/ViewInterpreter.js', + 'uri' => '/res/b0c07f96/rsrc/externals/javelin/ext/view/ViewInterpreter.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-view', 1 => 'javelin-install', + 2 => 'javelin-dom', ), 'disk' => '/rsrc/externals/javelin/ext/view/ViewInterpreter.js', ), 'javelin-view-renderer' => array( - 'uri' => '/res/d2119b79/rsrc/externals/javelin/ext/view/ViewRenderer.js', + 'uri' => '/res/fe0d2f60/rsrc/externals/javelin/ext/view/ViewRenderer.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', + 1 => 'javelin-util', ), 'disk' => '/rsrc/externals/javelin/ext/view/ViewRenderer.js', ), @@ -2761,7 +2758,7 @@ celerity_register_resource_map(array( ), 'javelin-workflow' => array( - 'uri' => '/res/73e8d0e2/rsrc/externals/javelin/lib/Workflow.js', + 'uri' => '/res/8274d65f/rsrc/externals/javelin/lib/Workflow.js', 'type' => 'js', 'requires' => array( @@ -2994,7 +2991,7 @@ celerity_register_resource_map(array( ), 'phabricator-drag-and-drop-file-upload' => array( - 'uri' => '/res/3991c1b6/rsrc/js/core/DragAndDropFileUpload.js', + 'uri' => '/res/396d3b3b/rsrc/js/core/DragAndDropFileUpload.js', 'type' => 'js', 'requires' => array( @@ -3042,7 +3039,7 @@ celerity_register_resource_map(array( ), 'phabricator-file-upload' => array( - 'uri' => '/res/ee9664fd/rsrc/js/core/FileUpload.js', + 'uri' => '/res/c9605008/rsrc/js/core/FileUpload.js', 'type' => 'js', 'requires' => array( @@ -3090,7 +3087,7 @@ celerity_register_resource_map(array( ), 'phabricator-hovercard' => array( - 'uri' => '/res/2cf2c195/rsrc/js/core/Hovercard.js', + 'uri' => '/res/7fb94260/rsrc/js/core/Hovercard.js', 'type' => 'js', 'requires' => array( @@ -3237,7 +3234,7 @@ celerity_register_resource_map(array( ), 'phabricator-phtize' => array( - 'uri' => '/res/50a80ff1/rsrc/js/core/phtize.js', + 'uri' => '/res/dc655a81/rsrc/js/core/phtize.js', 'type' => 'js', 'requires' => array( @@ -3256,7 +3253,7 @@ celerity_register_resource_map(array( ), 'phabricator-prefab' => array( - 'uri' => '/res/513c4313/rsrc/js/core/Prefab.js', + 'uri' => '/res/511859ca/rsrc/js/core/Prefab.js', 'type' => 'js', 'requires' => array( @@ -3414,7 +3411,7 @@ celerity_register_resource_map(array( ), 'phabricator-tooltip' => array( - 'uri' => '/res/1dc73d91/rsrc/js/core/ToolTip.js', + 'uri' => '/res/a23bc887/rsrc/js/core/ToolTip.js', 'type' => 'js', 'requires' => array( @@ -3445,143 +3442,124 @@ celerity_register_resource_map(array( ), 'phabricator-uiexample-javelin-view' => array( - 'uri' => '/res/a2ce2cfc/rsrc/js/application/uiexample/JavelinViewExample.js', + 'uri' => '/res/2da87384/rsrc/js/application/uiexample/JavelinViewExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', + 1 => 'javelin-dom', ), 'disk' => '/rsrc/js/application/uiexample/JavelinViewExample.js', ), 'phabricator-uiexample-reactor-button' => array( - 'uri' => '/res/142127f6/rsrc/js/application/uiexample/ReactorButtonExample.js', + 'uri' => '/res/6bfe4f05/rsrc/js/application/uiexample/ReactorButtonExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', + 1 => 'javelin-dom', 2 => 'javelin-util', - 3 => 'javelin-dom', + 3 => 'javelin-dynval', 4 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorButtonExample.js', ), 'phabricator-uiexample-reactor-checkbox' => array( - 'uri' => '/res/c75cb9e9/rsrc/js/application/uiexample/ReactorCheckboxExample.js', + 'uri' => '/res/3e8b30ac/rsrc/js/application/uiexample/ReactorCheckboxExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', + 1 => 'javelin-dom', + 2 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorCheckboxExample.js', ), 'phabricator-uiexample-reactor-focus' => array( - 'uri' => '/res/3cc992eb/rsrc/js/application/uiexample/ReactorFocusExample.js', + 'uri' => '/res/d8f3b56e/rsrc/js/application/uiexample/ReactorFocusExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', + 1 => 'javelin-dom', + 2 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorFocusExample.js', ), 'phabricator-uiexample-reactor-input' => array( - 'uri' => '/res/4953da16/rsrc/js/application/uiexample/ReactorInputExample.js', + 'uri' => '/res/936352d9/rsrc/js/application/uiexample/ReactorInputExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', - 5 => 'javelin-view-html', - 6 => 'javelin-view-interpreter', - 7 => 'javelin-view-renderer', + 1 => 'javelin-reactor-dom', + 2 => 'javelin-view-html', + 3 => 'javelin-view-interpreter', + 4 => 'javelin-view-renderer', ), 'disk' => '/rsrc/js/application/uiexample/ReactorInputExample.js', ), 'phabricator-uiexample-reactor-mouseover' => array( - 'uri' => '/res/52a355b6/rsrc/js/application/uiexample/ReactorMouseoverExample.js', + 'uri' => '/res/031a9f4f/rsrc/js/application/uiexample/ReactorMouseoverExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', + 1 => 'javelin-dom', + 2 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorMouseoverExample.js', ), 'phabricator-uiexample-reactor-radio' => array( - 'uri' => '/res/ae87f3af/rsrc/js/application/uiexample/ReactorRadioExample.js', + 'uri' => '/res/208c58e3/rsrc/js/application/uiexample/ReactorRadioExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', + 1 => 'javelin-dom', + 2 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorRadioExample.js', ), 'phabricator-uiexample-reactor-select' => array( - 'uri' => '/res/23cb448a/rsrc/js/application/uiexample/ReactorSelectExample.js', + 'uri' => '/res/1b68a6db/rsrc/js/application/uiexample/ReactorSelectExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', + 1 => 'javelin-dom', + 2 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorSelectExample.js', ), 'phabricator-uiexample-reactor-sendclass' => array( - 'uri' => '/res/8cd34264/rsrc/js/application/uiexample/ReactorSendClassExample.js', + 'uri' => '/res/00cb3131/rsrc/js/application/uiexample/ReactorSendClassExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', + 1 => 'javelin-dom', + 2 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorSendClassExample.js', ), 'phabricator-uiexample-reactor-sendproperties' => array( - 'uri' => '/res/18af54aa/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js', + 'uri' => '/res/392f1e02/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js', 'type' => 'js', 'requires' => array( 0 => 'javelin-install', - 1 => 'javelin-view', - 2 => 'javelin-util', - 3 => 'javelin-dom', - 4 => 'javelin-reactor-dom', + 1 => 'javelin-dom', + 2 => 'javelin-reactor-dom', ), 'disk' => '/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js', ), @@ -3772,7 +3750,7 @@ celerity_register_resource_map(array( ), 'raphael-core' => array( - 'uri' => '/res/0939b925/rsrc/externals/raphael/raphael.js', + 'uri' => '/res/5dc5e17c/rsrc/externals/raphael/raphael.js', 'type' => 'js', 'requires' => array( @@ -3781,7 +3759,7 @@ celerity_register_resource_map(array( ), 'raphael-g' => array( - 'uri' => '/res/e14432ce/rsrc/externals/raphael/g.raphael.js', + 'uri' => '/res/229b89a1/rsrc/externals/raphael/g.raphael.js', 'type' => 'js', 'requires' => array( @@ -3790,7 +3768,7 @@ celerity_register_resource_map(array( ), 'raphael-g-line' => array( - 'uri' => '/res/2c9e6746/rsrc/externals/raphael/g.raphael.line.js', + 'uri' => '/res/96da30f7/rsrc/externals/raphael/g.raphael.line.js', 'type' => 'js', 'requires' => array( @@ -4070,7 +4048,7 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/bdba44f0/core.pkg.css', 'type' => 'css', ), - '26980a1c' => + '25aa6fec' => array( 'name' => 'core.pkg.js', 'symbols' => @@ -4111,7 +4089,7 @@ celerity_register_resource_map(array( 33 => 'javelin-behavior-global-drag-and-drop', 34 => 'javelin-behavior-phabricator-reveal-content', ), - 'uri' => '/res/pkg/26980a1c/core.pkg.js', + 'uri' => '/res/pkg/25aa6fec/core.pkg.js', 'type' => 'js', ), '4ccfeb47' => @@ -4147,7 +4125,7 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/dd27a69b/differential.pkg.css', 'type' => 'css', ), - '77e07ff4' => + '9488bb69' => array( 'name' => 'differential.pkg.js', 'symbols' => @@ -4173,7 +4151,7 @@ celerity_register_resource_map(array( 18 => 'javelin-behavior-differential-toggle-files', 19 => 'javelin-behavior-differential-user-select', ), - 'uri' => '/res/pkg/77e07ff4/differential.pkg.js', + 'uri' => '/res/pkg/9488bb69/differential.pkg.js', 'type' => 'js', ), 'c8ce2d88' => @@ -4187,7 +4165,7 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/c8ce2d88/diffusion.pkg.css', 'type' => 'css', ), - 'f96657b8' => + 96909266 => array( 'name' => 'diffusion.pkg.js', 'symbols' => @@ -4196,10 +4174,10 @@ celerity_register_resource_map(array( 1 => 'javelin-behavior-diffusion-commit-graph', 2 => 'javelin-behavior-audit-preview', ), - 'uri' => '/res/pkg/f96657b8/diffusion.pkg.js', + 'uri' => '/res/pkg/96909266/diffusion.pkg.js', 'type' => 'js', ), - '202a3dd0' => + '565e00f7' => array( 'name' => 'javelin.pkg.js', 'symbols' => @@ -4224,7 +4202,7 @@ celerity_register_resource_map(array( 17 => 'javelin-typeahead-ondemand-source', 18 => 'javelin-tokenizer', ), - 'uri' => '/res/pkg/202a3dd0/javelin.pkg.js', + 'uri' => '/res/pkg/565e00f7/javelin.pkg.js', 'type' => 'js', ), '6b1fccc6' => @@ -4240,7 +4218,7 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/6b1fccc6/maniphest.pkg.css', 'type' => 'css', ), - 'f85eb6d8' => + '1621e522' => array( 'name' => 'maniphest.pkg.js', 'symbols' => @@ -4251,7 +4229,7 @@ celerity_register_resource_map(array( 3 => 'javelin-behavior-maniphest-transaction-expand', 4 => 'javelin-behavior-maniphest-subpriority-editor', ), - 'uri' => '/res/pkg/f85eb6d8/maniphest.pkg.js', + 'uri' => '/res/pkg/1621e522/maniphest.pkg.js', 'type' => 'js', ), ), @@ -4270,7 +4248,7 @@ celerity_register_resource_map(array( 'aphront-typeahead-control-css' => 'bdba44f0', 'differential-changeset-view-css' => 'dd27a69b', 'differential-core-view-css' => 'dd27a69b', - 'differential-inline-comment-editor' => '77e07ff4', + 'differential-inline-comment-editor' => '9488bb69', 'differential-local-commits-view-css' => 'dd27a69b', 'differential-results-table-css' => 'dd27a69b', 'differential-revision-add-comment-css' => 'dd27a69b', @@ -4283,112 +4261,112 @@ celerity_register_resource_map(array( 'diffusion-icons-css' => 'c8ce2d88', 'global-drag-and-drop-css' => 'bdba44f0', 'inline-comment-summary-css' => 'dd27a69b', - 'javelin-aphlict' => '26980a1c', - 'javelin-behavior' => '202a3dd0', - 'javelin-behavior-aphlict-dropdown' => '26980a1c', - 'javelin-behavior-aphlict-listen' => '26980a1c', - 'javelin-behavior-aphront-basic-tokenizer' => '26980a1c', - 'javelin-behavior-aphront-drag-and-drop' => '77e07ff4', - 'javelin-behavior-aphront-drag-and-drop-textarea' => '77e07ff4', - 'javelin-behavior-aphront-form-disable-on-submit' => '26980a1c', - 'javelin-behavior-audit-preview' => 'f96657b8', + 'javelin-aphlict' => '25aa6fec', + 'javelin-behavior' => '565e00f7', + 'javelin-behavior-aphlict-dropdown' => '25aa6fec', + 'javelin-behavior-aphlict-listen' => '25aa6fec', + 'javelin-behavior-aphront-basic-tokenizer' => '25aa6fec', + 'javelin-behavior-aphront-drag-and-drop' => '9488bb69', + 'javelin-behavior-aphront-drag-and-drop-textarea' => '9488bb69', + 'javelin-behavior-aphront-form-disable-on-submit' => '25aa6fec', + 'javelin-behavior-audit-preview' => '96909266', 'javelin-behavior-dark-console' => '4ccfeb47', - 'javelin-behavior-device' => '26980a1c', - 'javelin-behavior-differential-accept-with-errors' => '77e07ff4', - 'javelin-behavior-differential-add-reviewers-and-ccs' => '77e07ff4', - 'javelin-behavior-differential-comment-jump' => '77e07ff4', - 'javelin-behavior-differential-diff-radios' => '77e07ff4', - 'javelin-behavior-differential-dropdown-menus' => '77e07ff4', - 'javelin-behavior-differential-edit-inline-comments' => '77e07ff4', - 'javelin-behavior-differential-feedback-preview' => '77e07ff4', - 'javelin-behavior-differential-keyboard-navigation' => '77e07ff4', - 'javelin-behavior-differential-populate' => '77e07ff4', - 'javelin-behavior-differential-show-more' => '77e07ff4', - 'javelin-behavior-differential-toggle-files' => '77e07ff4', - 'javelin-behavior-differential-user-select' => '77e07ff4', - 'javelin-behavior-diffusion-commit-graph' => 'f96657b8', - 'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8', + 'javelin-behavior-device' => '25aa6fec', + 'javelin-behavior-differential-accept-with-errors' => '9488bb69', + 'javelin-behavior-differential-add-reviewers-and-ccs' => '9488bb69', + 'javelin-behavior-differential-comment-jump' => '9488bb69', + 'javelin-behavior-differential-diff-radios' => '9488bb69', + 'javelin-behavior-differential-dropdown-menus' => '9488bb69', + 'javelin-behavior-differential-edit-inline-comments' => '9488bb69', + 'javelin-behavior-differential-feedback-preview' => '9488bb69', + 'javelin-behavior-differential-keyboard-navigation' => '9488bb69', + 'javelin-behavior-differential-populate' => '9488bb69', + 'javelin-behavior-differential-show-more' => '9488bb69', + 'javelin-behavior-differential-toggle-files' => '9488bb69', + 'javelin-behavior-differential-user-select' => '9488bb69', + 'javelin-behavior-diffusion-commit-graph' => '96909266', + 'javelin-behavior-diffusion-pull-lastmodified' => '96909266', 'javelin-behavior-error-log' => '4ccfeb47', - 'javelin-behavior-global-drag-and-drop' => '26980a1c', - 'javelin-behavior-history-install' => '26980a1c', - 'javelin-behavior-konami' => '26980a1c', - 'javelin-behavior-lightbox-attachments' => '26980a1c', - 'javelin-behavior-load-blame' => '77e07ff4', - 'javelin-behavior-maniphest-batch-selector' => 'f85eb6d8', - 'javelin-behavior-maniphest-subpriority-editor' => 'f85eb6d8', - 'javelin-behavior-maniphest-transaction-controls' => 'f85eb6d8', - 'javelin-behavior-maniphest-transaction-expand' => 'f85eb6d8', - 'javelin-behavior-maniphest-transaction-preview' => 'f85eb6d8', - 'javelin-behavior-phabricator-active-nav' => '26980a1c', - 'javelin-behavior-phabricator-autofocus' => '26980a1c', - 'javelin-behavior-phabricator-gesture' => '26980a1c', - 'javelin-behavior-phabricator-keyboard-shortcuts' => '26980a1c', - 'javelin-behavior-phabricator-nav' => '26980a1c', - 'javelin-behavior-phabricator-object-selector' => '77e07ff4', - 'javelin-behavior-phabricator-oncopy' => '26980a1c', - 'javelin-behavior-phabricator-remarkup-assist' => '26980a1c', - 'javelin-behavior-phabricator-reveal-content' => '26980a1c', - 'javelin-behavior-phabricator-search-typeahead' => '26980a1c', - 'javelin-behavior-phabricator-tooltips' => '26980a1c', - 'javelin-behavior-phabricator-watch-anchor' => '26980a1c', - 'javelin-behavior-refresh-csrf' => '26980a1c', - 'javelin-behavior-repository-crossreference' => '77e07ff4', - 'javelin-behavior-toggle-class' => '26980a1c', - 'javelin-behavior-workflow' => '26980a1c', - 'javelin-dom' => '202a3dd0', - 'javelin-event' => '202a3dd0', - 'javelin-install' => '202a3dd0', - 'javelin-json' => '202a3dd0', - 'javelin-mask' => '202a3dd0', - 'javelin-request' => '202a3dd0', - 'javelin-resource' => '202a3dd0', - 'javelin-stratcom' => '202a3dd0', - 'javelin-tokenizer' => '202a3dd0', - 'javelin-typeahead' => '202a3dd0', - 'javelin-typeahead-normalizer' => '202a3dd0', - 'javelin-typeahead-ondemand-source' => '202a3dd0', - 'javelin-typeahead-preloaded-source' => '202a3dd0', - 'javelin-typeahead-source' => '202a3dd0', - 'javelin-uri' => '202a3dd0', - 'javelin-util' => '202a3dd0', - 'javelin-vector' => '202a3dd0', - 'javelin-workflow' => '202a3dd0', + 'javelin-behavior-global-drag-and-drop' => '25aa6fec', + 'javelin-behavior-history-install' => '25aa6fec', + 'javelin-behavior-konami' => '25aa6fec', + 'javelin-behavior-lightbox-attachments' => '25aa6fec', + 'javelin-behavior-load-blame' => '9488bb69', + 'javelin-behavior-maniphest-batch-selector' => '1621e522', + 'javelin-behavior-maniphest-subpriority-editor' => '1621e522', + 'javelin-behavior-maniphest-transaction-controls' => '1621e522', + 'javelin-behavior-maniphest-transaction-expand' => '1621e522', + 'javelin-behavior-maniphest-transaction-preview' => '1621e522', + 'javelin-behavior-phabricator-active-nav' => '25aa6fec', + 'javelin-behavior-phabricator-autofocus' => '25aa6fec', + 'javelin-behavior-phabricator-gesture' => '25aa6fec', + 'javelin-behavior-phabricator-keyboard-shortcuts' => '25aa6fec', + 'javelin-behavior-phabricator-nav' => '25aa6fec', + 'javelin-behavior-phabricator-object-selector' => '9488bb69', + 'javelin-behavior-phabricator-oncopy' => '25aa6fec', + 'javelin-behavior-phabricator-remarkup-assist' => '25aa6fec', + 'javelin-behavior-phabricator-reveal-content' => '25aa6fec', + 'javelin-behavior-phabricator-search-typeahead' => '25aa6fec', + 'javelin-behavior-phabricator-tooltips' => '25aa6fec', + 'javelin-behavior-phabricator-watch-anchor' => '25aa6fec', + 'javelin-behavior-refresh-csrf' => '25aa6fec', + 'javelin-behavior-repository-crossreference' => '9488bb69', + 'javelin-behavior-toggle-class' => '25aa6fec', + 'javelin-behavior-workflow' => '25aa6fec', + 'javelin-dom' => '565e00f7', + 'javelin-event' => '565e00f7', + 'javelin-install' => '565e00f7', + 'javelin-json' => '565e00f7', + 'javelin-mask' => '565e00f7', + 'javelin-request' => '565e00f7', + 'javelin-resource' => '565e00f7', + 'javelin-stratcom' => '565e00f7', + 'javelin-tokenizer' => '565e00f7', + 'javelin-typeahead' => '565e00f7', + 'javelin-typeahead-normalizer' => '565e00f7', + 'javelin-typeahead-ondemand-source' => '565e00f7', + 'javelin-typeahead-preloaded-source' => '565e00f7', + 'javelin-typeahead-source' => '565e00f7', + 'javelin-uri' => '565e00f7', + 'javelin-util' => '565e00f7', + 'javelin-vector' => '565e00f7', + 'javelin-workflow' => '565e00f7', 'lightbox-attachment-css' => 'bdba44f0', 'maniphest-task-summary-css' => '6b1fccc6', 'maniphest-transaction-detail-css' => '6b1fccc6', - 'phabricator-busy' => '26980a1c', + 'phabricator-busy' => '25aa6fec', 'phabricator-content-source-view-css' => 'dd27a69b', 'phabricator-core-buttons-css' => 'bdba44f0', 'phabricator-core-css' => 'bdba44f0', 'phabricator-crumbs-view-css' => 'bdba44f0', 'phabricator-directory-css' => 'bdba44f0', - 'phabricator-drag-and-drop-file-upload' => '77e07ff4', - 'phabricator-dropdown-menu' => '26980a1c', - 'phabricator-file-upload' => '26980a1c', + 'phabricator-drag-and-drop-file-upload' => '9488bb69', + 'phabricator-dropdown-menu' => '25aa6fec', + 'phabricator-file-upload' => '25aa6fec', 'phabricator-filetree-view-css' => 'bdba44f0', 'phabricator-flag-css' => 'bdba44f0', 'phabricator-form-view-css' => 'bdba44f0', 'phabricator-header-view-css' => 'bdba44f0', 'phabricator-jump-nav' => 'bdba44f0', - 'phabricator-keyboard-shortcut' => '26980a1c', - 'phabricator-keyboard-shortcut-manager' => '26980a1c', + 'phabricator-keyboard-shortcut' => '25aa6fec', + 'phabricator-keyboard-shortcut-manager' => '25aa6fec', 'phabricator-main-menu-view' => 'bdba44f0', - 'phabricator-menu-item' => '26980a1c', + 'phabricator-menu-item' => '25aa6fec', 'phabricator-nav-view-css' => 'bdba44f0', - 'phabricator-notification' => '26980a1c', + 'phabricator-notification' => '25aa6fec', 'phabricator-notification-css' => 'bdba44f0', 'phabricator-notification-menu-css' => 'bdba44f0', 'phabricator-object-item-list-view-css' => 'bdba44f0', 'phabricator-object-selector-css' => 'dd27a69b', - 'phabricator-phtize' => '26980a1c', - 'phabricator-prefab' => '26980a1c', + 'phabricator-phtize' => '25aa6fec', + 'phabricator-prefab' => '25aa6fec', 'phabricator-project-tag-css' => '6b1fccc6', 'phabricator-remarkup-css' => 'bdba44f0', - 'phabricator-shaped-request' => '77e07ff4', + 'phabricator-shaped-request' => '9488bb69', 'phabricator-side-menu-view-css' => 'bdba44f0', 'phabricator-standard-page-view' => 'bdba44f0', - 'phabricator-textareautils' => '26980a1c', - 'phabricator-tooltip' => '26980a1c', + 'phabricator-textareautils' => '25aa6fec', + 'phabricator-tooltip' => '25aa6fec', 'phabricator-transaction-view-css' => 'bdba44f0', 'phabricator-zindex-css' => 'bdba44f0', 'sprite-apps-large-css' => 'bdba44f0', diff --git a/src/infrastructure/celerity/CelerityResourceTransformer.php b/src/infrastructure/celerity/CelerityResourceTransformer.php index 180de4941b..922f41dab8 100644 --- a/src/infrastructure/celerity/CelerityResourceTransformer.php +++ b/src/infrastructure/celerity/CelerityResourceTransformer.php @@ -30,6 +30,9 @@ final class CelerityResourceTransformer { return $this; } + /** + * @phutil-external-symbol function jsShrink + */ public function transformResource($path, $data) { $type = self::getResourceType($path); @@ -70,17 +73,25 @@ final class CelerityResourceTransformer { $data = trim($data); break; case 'js': - $root = dirname(phutil_get_library_root('phabricator')); - $bin = $root.'/externals/javelin/support/jsxmin/jsxmin'; - if (@file_exists($bin)) { - $future = new ExecFuture('%s __DEV__:0', $bin); + // If `jsxmin` is available, use it. jsxmin is the Javelin minifier and + // produces the smallest output, but is complicated to build. + if (Filesystem::binaryExists('jsxmin')) { + $future = new ExecFuture('jsxmin __DEV__:0'); $future->write($data); list($err, $result) = $future->resolve(); if (!$err) { $data = $result; + break; } } + + // If `jsxmin` is not available, use `JsShrink`, which doesn't compress + // quite as well but is always available. + $root = dirname(phutil_get_library_root('phabricator')); + require_once $root.'/externals/JsShrink/jsShrink.php'; + $data = jsShrink($data); + break; } diff --git a/src/infrastructure/lint/PhabricatorLintEngine.php b/src/infrastructure/lint/PhabricatorLintEngine.php index 5248891b0e..1b247698f8 100644 --- a/src/infrastructure/lint/PhabricatorLintEngine.php +++ b/src/infrastructure/lint/PhabricatorLintEngine.php @@ -37,16 +37,35 @@ class PhabricatorLintEngine extends PhutilLintEngine { $javelin_linter = new PhabricatorJavelinLinter(); $linters[] = $javelin_linter; + $jshint_linter = new ArcanistJSHintLinter(); + $linters[] = $jshint_linter; + foreach ($paths as $path) { + if (!preg_match('/\.js$/', $path)) { + continue; + } + + if (strpos($path, 'externals/JsShrink') !== false) { + // Ignore warnings in JsShrink tests. + continue; + } + + if (strpos($path, 'externals/raphael') !== false) { + // Ignore Raphael. + continue; + } + + $jshint_linter->addPath($path); + $jshint_linter->addData($path, $this->loadData($path)); + if (strpos($path, 'support/aphlict/') !== false) { // This stuff is Node.js, not Javelin, so don't apply the Javelin // linter. continue; } - if (preg_match('/\.js$/', $path)) { - $javelin_linter->addPath($path); - $javelin_linter->addData($path, $this->loadData($path)); - } + + $javelin_linter->addPath($path); + $javelin_linter->addData($path, $this->loadData($path)); } return $linters; diff --git a/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php b/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php index 3fa5a2052d..a1f9cd9974 100644 --- a/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php +++ b/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php @@ -78,7 +78,7 @@ final class PhabricatorJavelinLinter extends ArcanistLinter { } private function shouldIgnorePath($path) { - return preg_match('@/__tests__/|externals/javelinjs/src/docs/@', $path); + return preg_match('@/__tests__/|externals/javelin/docs/@', $path); } public function lintPath($path) { @@ -167,12 +167,17 @@ final class PhabricatorJavelinLinter extends ArcanistLinter { continue; } - $symbol_path = 'webroot'.$symbol_info['disk']; - list($ignored, $req_install) = $this->getUsedAndInstalledSymbolsForPath( - $symbol_path); - if (array_intersect_key($req_install, $external_classes)) { - $need = array_diff_key($need, $req_install); + if (preg_match('/\\.css$/', $symbol_info['disk'])) { + // If JS requires CSS, just assume everything is fine. unset($requires[$key]); + } else { + $symbol_path = 'webroot'.$symbol_info['disk']; + list($ignored, $req_install) = $this->getUsedAndInstalledSymbolsForPath( + $symbol_path); + if (array_intersect_key($req_install, $external_classes)) { + $need = array_diff_key($need, $req_install); + unset($requires[$key]); + } } } diff --git a/support/aphlict/server/aphlict_server.js b/support/aphlict/server/aphlict_server.js index 8ac4f137e9..09869e9f99 100755 --- a/support/aphlict/server/aphlict_server.js +++ b/support/aphlict/server/aphlict_server.js @@ -35,7 +35,7 @@ function parse_command_line_arguments(argv) { return config; } -if (process.getuid() != 0) { +if (process.getuid() !== 0) { console.log( "ERROR: "+ "This server must be run as root because it needs to bind to privileged "+ @@ -118,8 +118,8 @@ var MAX_ID = 9007199254740991;//2^53 -1 // you want to write something pretty be my guest function generate_id() { - if (typeof generate_id.current_id == 'undefined' - || generate_id.current_id > MAX_ID) { + if (typeof generate_id.current_id == 'undefined' || + generate_id.current_id > MAX_ID) { generate_id.current_id = 0; } return generate_id.current_id++; @@ -132,15 +132,15 @@ var send_server = net.createServer(function(socket) { socket.on('connect', function() { clients[client_id] = socket; current_connections++; - log(client_name + 'connected\t\t(' - + current_connections + ' current connections)'); + log(client_name + 'connected\t\t(' + + current_connections + ' current connections)'); }); socket.on('close', function() { delete clients[client_id]; current_connections--; - log(client_name + 'closed\t\t(' - + current_connections + ' current connections)'); + log(client_name + 'closed\t\t(' + + current_connections + ' current connections)'); }); socket.on('timeout', function() { diff --git a/support/jshint/jshintconfig b/support/jshint/jshintconfig new file mode 100644 index 0000000000..e753307f4a --- /dev/null +++ b/support/jshint/jshintconfig @@ -0,0 +1,5 @@ +{ + "expr" : true, + "loopfunc" : true, + "sub" : true +} diff --git a/webroot/rsrc/externals/javelin/core/Event.js b/webroot/rsrc/externals/javelin/core/Event.js index 0ef0f19709..51e3cfd897 100644 --- a/webroot/rsrc/externals/javelin/core/Event.js +++ b/webroot/rsrc/externals/javelin/core/Event.js @@ -337,7 +337,7 @@ JX.install('Event', { JX.Event.prototype.toString = function() { var path = '['+this.getPath().join(', ')+']'; return 'Event<'+this.getType()+', '+path+', '+this.getTarget()+'>'; - } + }; } } }); diff --git a/webroot/rsrc/externals/javelin/core/init.js b/webroot/rsrc/externals/javelin/core/init.js index a5aadd5a39..cab62d34f8 100644 --- a/webroot/rsrc/externals/javelin/core/init.js +++ b/webroot/rsrc/externals/javelin/core/init.js @@ -32,7 +32,7 @@ return; } holding_queues[name] = []; - JX[name] = function() { holding_queues[name].push(arguments); } + JX[name] = function() { holding_queues[name].push(arguments); }; } JX.flushHoldingQueue = function(name, fn) { @@ -40,7 +40,7 @@ fn.apply(null, holding_queues[name][ii]); } holding_queues[name] = {}; - } + }; makeHoldingQueue('install'); makeHoldingQueue('behavior'); @@ -107,7 +107,7 @@ return false; } } - } + }; JX.enableDispatch = function(target, type) { if (__DEV__) { @@ -165,7 +165,8 @@ } } - for (var ii = 0; ii < document_events.length; ++ii) { + var ii; + for (ii = 0; ii < document_events.length; ++ii) { JX.enableDispatch(root, document_events[ii]); } @@ -182,7 +183,7 @@ ]; - for (var ii = 0; ii < window_events.length; ++ii) { + for (ii = 0; ii < window_events.length; ++ii) { JX.enableDispatch(window, window_events[ii]); } @@ -212,7 +213,7 @@ '<\/sc' + 'ript\>'); + '><\/sc' + 'ript' + '>'); } JX.onload = function(func) { @@ -221,5 +222,6 @@ } else { onload.push(func); } - } + }; + })(); diff --git a/webroot/rsrc/externals/javelin/core/util.js b/webroot/rsrc/externals/javelin/core/util.js index c6b9f50ccc..cf29f246a5 100644 --- a/webroot/rsrc/externals/javelin/core/util.js +++ b/webroot/rsrc/externals/javelin/core/util.js @@ -247,7 +247,7 @@ JX.bind = function(context, func, more) { return function() { return func.apply(context || window, bound.concat(JX.$A(arguments))); - } + }; }; @@ -320,7 +320,7 @@ if (__DEV__) { */ JX.log = function(message) { window.console.log(message); - } + }; window.alert = (function(native_alert) { var recent_alerts = []; @@ -349,7 +349,7 @@ if (__DEV__) { native_alert(msg); } in_alert = false; - } + }; })(window.alert); } diff --git a/webroot/rsrc/externals/javelin/ext/reactor/dom/RDOM.js b/webroot/rsrc/externals/javelin/ext/reactor/dom/RDOM.js index c9cde5ae8b..48b7b9687f 100644 --- a/webroot/rsrc/externals/javelin/ext/reactor/dom/RDOM.js +++ b/webroot/rsrc/externals/javelin/ext/reactor/dom/RDOM.js @@ -3,6 +3,7 @@ * @provides javelin-reactor-dom * @requires javelin-dom * javelin-dynval + * javelin-reactor * javelin-reactornode * javelin-install * javelin-util diff --git a/webroot/rsrc/externals/javelin/ext/view/HTMLView.js b/webroot/rsrc/externals/javelin/ext/view/HTMLView.js index 115aa4fff8..aea6f7c7bd 100644 --- a/webroot/rsrc/externals/javelin/ext/view/HTMLView.js +++ b/webroot/rsrc/externals/javelin/ext/view/HTMLView.js @@ -5,7 +5,9 @@ * * @provides javelin-view-html * @requires javelin-install - * javelin-view + * javelin-dom + * javelin-view-visitor + * javelin-util */ JX.install('HTMLView', { @@ -26,7 +28,7 @@ JX.install('HTMLView', { validate: function(view, children) { var spec = this._getHTMLSpec(); - if (!view.getName() in spec) { + if (!(view.getName() in spec)) { throw new Error("invalid tag"); } diff --git a/webroot/rsrc/externals/javelin/ext/view/View.js b/webroot/rsrc/externals/javelin/ext/view/View.js index a016ce531a..39d608a715 100644 --- a/webroot/rsrc/externals/javelin/ext/view/View.js +++ b/webroot/rsrc/externals/javelin/ext/view/View.js @@ -82,8 +82,11 @@ JX.install('View', { var result = []; var should_repack = false; - for(var ii = 0; ii < this._childKeys.length; ii++) { - var key = this._childKeys[ii]; + var ii; + var key; + + for (ii = 0; ii < this._childKeys.length; ii++) { + key = this._childKeys[ii]; if (this._rawChildren[key] === undefined) { should_repack = true; } else { @@ -93,8 +96,8 @@ JX.install('View', { if (should_repack) { var new_child_keys = []; - for(var ii = 0; ii < this._childKeys.length; ii++) { - var key = this._childKeys[ii]; + for (ii = 0; ii < this._childKeys.length; ii++) { + key = this._childKeys[ii]; if (this._rawChildren[key] !== undefined) { new_child_keys.push(key); } diff --git a/webroot/rsrc/externals/javelin/ext/view/ViewInterpreter.js b/webroot/rsrc/externals/javelin/ext/view/ViewInterpreter.js index cd89d68676..743071e101 100644 --- a/webroot/rsrc/externals/javelin/ext/view/ViewInterpreter.js +++ b/webroot/rsrc/externals/javelin/ext/view/ViewInterpreter.js @@ -42,7 +42,7 @@ * @provides javelin-view-interpreter * @requires javelin-view * javelin-install - * + * javelin-dom */ JX.install('ViewInterpreter', { @@ -65,7 +65,7 @@ JX.install('ViewInterpreter', { result.addChildren(children); return result; - } + }; } } }); diff --git a/webroot/rsrc/externals/javelin/ext/view/ViewPlaceholder.js b/webroot/rsrc/externals/javelin/ext/view/ViewPlaceholder.js index a0c3d67797..7a2b79cfc2 100644 --- a/webroot/rsrc/externals/javelin/ext/view/ViewPlaceholder.js +++ b/webroot/rsrc/externals/javelin/ext/view/ViewPlaceholder.js @@ -48,6 +48,7 @@ * @requires javelin-behavior * javelin-dom * javelin-view-renderer + * javelin-install */ @@ -72,11 +73,12 @@ JX.install('ViewPlaceholder', { statics: { register: function(wait_on_token, token, cb) { var ready_q = []; + var waiting; if (!wait_on_token || wait_on_token in JX.ViewPlaceholder.ready) { ready_q.push({token: token, cb: cb}); } else { - var waiting = JX.ViewPlaceholder.waiting; + waiting = JX.ViewPlaceholder.waiting; waiting[wait_on_token] = waiting[wait_on_token] || []; waiting[wait_on_token].push({token: token, cb: cb}); } @@ -84,7 +86,7 @@ JX.install('ViewPlaceholder', { while(ready_q.length) { var ready = ready_q.shift(); - var waiting = JX.ViewPlaceholder.waiting[ready.token]; + waiting = JX.ViewPlaceholder.waiting[ready.token]; if (waiting) { for (var ii = 0; ii < waiting.length; ii++) { ready_q.push(waiting[ii]); diff --git a/webroot/rsrc/externals/javelin/ext/view/ViewRenderer.js b/webroot/rsrc/externals/javelin/ext/view/ViewRenderer.js index f919484448..3f11a3bec0 100644 --- a/webroot/rsrc/externals/javelin/ext/view/ViewRenderer.js +++ b/webroot/rsrc/externals/javelin/ext/view/ViewRenderer.js @@ -1,6 +1,7 @@ /** * @provides javelin-view-renderer * @requires javelin-install + * javelin-util */ JX.install('ViewRenderer', { diff --git a/webroot/rsrc/externals/javelin/ext/view/__tests__/ViewRenderer.js b/webroot/rsrc/externals/javelin/ext/view/__tests__/ViewRenderer.js index a4d874365a..1e8729e5c4 100644 --- a/webroot/rsrc/externals/javelin/ext/view/__tests__/ViewRenderer.js +++ b/webroot/rsrc/externals/javelin/ext/view/__tests__/ViewRenderer.js @@ -13,11 +13,11 @@ describe('JX.ViewRenderer', function() { parent.addChild(child); child.render = function(_) { child_rendered = true; - } + }; parent.render = function(rendered_children) { child_rendered_first = child_rendered; - } + }; JX.ViewRenderer.render(parent); expect(child_rendered_first).toBe(true); diff --git a/webroot/rsrc/externals/javelin/lib/DOM.js b/webroot/rsrc/externals/javelin/lib/DOM.js index b2bf50b65c..95496f4887 100644 --- a/webroot/rsrc/externals/javelin/lib/DOM.js +++ b/webroot/rsrc/externals/javelin/lib/DOM.js @@ -102,8 +102,8 @@ JX.install('HTML', { var tags = ['legend', 'thead', 'tbody', 'tfoot', 'column', 'colgroup', 'caption', 'tr', 'th', 'td', 'option']; var evil_stuff = new RegExp('^\\s*<(' + tags.join('|') + ')\\b', 'i'); - var match = null; - if (match = str.match(evil_stuff)) { + var match = str.match(evil_stuff); + if (match) { JX.$E( 'new JX.HTML("<' + match[1] + '>..."): ' + 'call initializes an HTML object with an invalid partial fragment ' + @@ -725,8 +725,10 @@ JX.install('DOM', { * @return void */ show : function() { + var ii; + if (__DEV__) { - for (var ii = 0; ii < arguments.length; ++ii) { + for (ii = 0; ii < arguments.length; ++ii) { if (!arguments[ii]) { JX.$E( 'JX.DOM.show(...): ' + @@ -735,7 +737,7 @@ JX.install('DOM', { } } - for (var ii = 0; ii < arguments.length; ++ii) { + for (ii = 0; ii < arguments.length; ++ii) { arguments[ii].style.display = ''; } }, @@ -750,8 +752,10 @@ JX.install('DOM', { * @return void */ hide : function() { + var ii; + if (__DEV__) { - for (var ii = 0; ii < arguments.length; ++ii) { + for (ii = 0; ii < arguments.length; ++ii) { if (!arguments[ii]) { JX.$E( 'JX.DOM.hide(...): ' + @@ -760,7 +764,7 @@ JX.install('DOM', { } } - for (var ii = 0; ii < arguments.length; ++ii) { + for (ii = 0; ii < arguments.length; ++ii) { arguments[ii].style.display = 'none'; } }, diff --git a/webroot/rsrc/externals/javelin/lib/Mask.js b/webroot/rsrc/externals/javelin/lib/Mask.js index 6bb3b192ee..881c52fedc 100644 --- a/webroot/rsrc/externals/javelin/lib/Mask.js +++ b/webroot/rsrc/externals/javelin/lib/Mask.js @@ -71,7 +71,7 @@ JX.install('Mask', { document.body.appendChild(self._mask); } - self._adjustType(mask_type) + self._adjustType(mask_type); JX.Mask._stack.push(mask_type); }, diff --git a/webroot/rsrc/externals/javelin/lib/Request.js b/webroot/rsrc/externals/javelin/lib/Request.js index 8763151906..d7438b6d3f 100644 --- a/webroot/rsrc/externals/javelin/lib/Request.js +++ b/webroot/rsrc/externals/javelin/lib/Request.js @@ -201,7 +201,7 @@ JX.install('Request', { 'JX.Request("'+this.getURI()+'", ...): '+ 'server returned an empty response.'); } - if (expect_guard && xport.responseText.indexOf('for (;;);') != 0) { + if (expect_guard && xport.responseText.indexOf('for (;;);') !== 0) { JX.$E( 'JX.Request("'+this.getURI()+'", ...): '+ 'server returned an invalid response.'); @@ -405,7 +405,7 @@ JX.install('Request', { recurse(obj, ii); } } else if (obj && typeof obj == 'object') { - if (obj.__html != null) { + if (('__html' in obj) && (obj.__html !== null)) { parent[index] = JX.$H(obj.__html); } else { for (var key in obj) { diff --git a/webroot/rsrc/externals/javelin/lib/Resource.js b/webroot/rsrc/externals/javelin/lib/Resource.js index a5baf58202..7c93804bbf 100644 --- a/webroot/rsrc/externals/javelin/lib/Resource.js +++ b/webroot/rsrc/externals/javelin/lib/Resource.js @@ -1,9 +1,8 @@ /** * @provides javelin-resource - * @requires javelin-magical-init - * javelin-stratcom - * javelin-util + * @requires javelin-util * javelin-uri + * javelin-install * * @javelin */ diff --git a/webroot/rsrc/externals/javelin/lib/URI.js b/webroot/rsrc/externals/javelin/lib/URI.js index 35e614fc7a..e22982cc6b 100644 --- a/webroot/rsrc/externals/javelin/lib/URI.js +++ b/webroot/rsrc/externals/javelin/lib/URI.js @@ -54,7 +54,7 @@ JX.install('URI', { _defaultQuerySerializer : function(obj) { var kv_pairs = []; for (var key in obj) { - if (obj[key] != null) { + if (obj[key] !== null) { var value = encodeURIComponent(obj[key]); kv_pairs.push(encodeURIComponent(key) + (value ? '=' + value : '')); } diff --git a/webroot/rsrc/externals/javelin/lib/Vector.js b/webroot/rsrc/externals/javelin/lib/Vector.js index beedbb8278..20361a15e5 100644 --- a/webroot/rsrc/externals/javelin/lib/Vector.js +++ b/webroot/rsrc/externals/javelin/lib/Vector.js @@ -164,13 +164,9 @@ JX.install('Vector', { */ setDim : function(node) { node.style.width = - (this.x === null) - ? '' - : (parseInt(this.x, 10) + 'px'); + (this.x === null) ? '' : (parseInt(this.x, 10) + 'px'); node.style.height = - (this.y === null) - ? '' - : (parseInt(this.y, 10) + 'px'); + (this.y === null) ? '' : (parseInt(this.y, 10) + 'px'); return this; }, diff --git a/webroot/rsrc/externals/javelin/lib/Workflow.js b/webroot/rsrc/externals/javelin/lib/Workflow.js index 2238be9197..7e594e3944 100644 --- a/webroot/rsrc/externals/javelin/lib/Workflow.js +++ b/webroot/rsrc/externals/javelin/lib/Workflow.js @@ -282,7 +282,7 @@ JX.install('Workflow', { JX.Workflow._pop(); e.prevent(); - }; + } JX.Stratcom.listen('keydown', null, close_dialog_when_user_presses_escape); } diff --git a/webroot/rsrc/externals/javelin/lib/__tests__/URI.js b/webroot/rsrc/externals/javelin/lib/__tests__/URI.js index 56639a161f..62387c3b9e 100644 --- a/webroot/rsrc/externals/javelin/lib/__tests__/URI.js +++ b/webroot/rsrc/externals/javelin/lib/__tests__/URI.js @@ -262,7 +262,7 @@ describe('Javelin URI', function() { expect(uri.toString()).toEqual('/?clown=town'); }); - it('can remove non existant query data', function() { + it('can remove non existent query data', function() { var uri = JX.$U('/?key=value'); uri.addQueryParams({'magic' : null}); expect(uri.getQueryParams()).toEqual({ diff --git a/webroot/rsrc/externals/javelin/lib/behavior.js b/webroot/rsrc/externals/javelin/lib/behavior.js index 9568fe2f90..8741b9c423 100644 --- a/webroot/rsrc/externals/javelin/lib/behavior.js +++ b/webroot/rsrc/externals/javelin/lib/behavior.js @@ -1,6 +1,7 @@ /** * @provides javelin-behavior * @requires javelin-magical-init + * javelin-util * * @javelin-installs JX.behavior * @javelin-installs JX.initBehaviors diff --git a/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js b/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js index 04b90e26a8..bfcac0aaaa 100644 --- a/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js +++ b/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js @@ -345,7 +345,7 @@ JX.install('Tokenizer', { case 'delete': if (!this._focus.value.length) { var tok; - while (tok = this._tokens.pop()) { + while ((tok = this._tokens.pop())) { if (this._remove(tok, true)) { break; } diff --git a/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js b/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js index 13284ea693..9d11c6aabf 100644 --- a/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js +++ b/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js @@ -1,7 +1,6 @@ /** * @requires javelin-install * javelin-util - * javelin-stratcom * javelin-request * javelin-typeahead-source * @provides javelin-typeahead-ondemand-source diff --git a/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js b/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js index 866b974eac..ace130610a 100644 --- a/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js +++ b/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js @@ -1,7 +1,6 @@ /** * @requires javelin-install * javelin-util - * javelin-stratcom * javelin-request * javelin-typeahead-source * @provides javelin-typeahead-preloaded-source diff --git a/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js b/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js index 70f9ccbd6b..95e4b52f15 100644 --- a/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js +++ b/webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js @@ -282,7 +282,8 @@ JX.install('TypeaheadSource', { sortHits : function(value, hits) { var objs = []; - for (var ii = 0; ii < hits.length; ii++) { + var ii; + for (ii = 0; ii < hits.length; ii++) { objs.push(this._raw[hits[ii]]); } @@ -299,7 +300,7 @@ JX.install('TypeaheadSource', { handler(value, objs, default_comparator); hits.splice(0, hits.length); - for (var ii = 0; ii < objs.length; ii++) { + for (ii = 0; ii < objs.length; ii++) { hits.push(objs[ii].id); } }, diff --git a/webroot/rsrc/externals/raphael/g.raphael.js b/webroot/rsrc/externals/raphael/g.raphael.js index 676f60860a..70936409ad 100644 --- a/webroot/rsrc/externals/raphael/g.raphael.js +++ b/webroot/rsrc/externals/raphael/g.raphael.js @@ -1,6 +1,7 @@ /** * @provides raphael-g * @do-not-minify + * @nolint */ /*! * g.Raphael 0.5 - Charting library, based on Raphaël diff --git a/webroot/rsrc/externals/raphael/g.raphael.line.js b/webroot/rsrc/externals/raphael/g.raphael.line.js index 2c8925ddc2..fe8892e190 100644 --- a/webroot/rsrc/externals/raphael/g.raphael.line.js +++ b/webroot/rsrc/externals/raphael/g.raphael.line.js @@ -1,6 +1,7 @@ /** * @provides raphael-g-line * @do-not-minify + * @nolint */ /*! * g.Raphael 0.5 - Charting library, based on Raphaël diff --git a/webroot/rsrc/externals/raphael/raphael.js b/webroot/rsrc/externals/raphael/raphael.js index fbd1fab40d..c70fa44f72 100644 --- a/webroot/rsrc/externals/raphael/raphael.js +++ b/webroot/rsrc/externals/raphael/raphael.js @@ -1,6 +1,7 @@ /** * @provides raphael-core * @do-not-minify + * @nolint */ // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël 2.0.1 - JavaScript Vector Library │ \\ diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js index 5fd59a0f5f..0017cb5489 100644 --- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js +++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js @@ -29,12 +29,10 @@ JX.behavior('aphlict-dropdown', function(config) { return; } request = new JX.Request('/notification/panel/', function(response) { - var display = (response.number > 999) - ? "\u221E" - : response.number; + var display = (response.number > 999) ? "\u221E" : response.number; JX.DOM.setContent(count, display); - if (response.number == 0) { + if (response.number === 0) { JX.DOM.alterClass(bubble, 'alert-unread', false); } else { JX.DOM.alterClass(bubble, 'alert-unread', true); @@ -102,7 +100,7 @@ JX.behavior('aphlict-dropdown', function(config) { visible = !visible; e.kill(); } - ) + ); JX.Stratcom.listen('notification-panel-update', null, function() { dirty = true; diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js index c57d496cb7..19198f8be0 100644 --- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js +++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js @@ -29,9 +29,7 @@ JX.behavior('aphlict-listen', function(config) { .send(); } else if (__DEV__) { if (config.debug) { - var details = message - ? JX.JSON.stringify(message) - : ''; + var details = message ? JX.JSON.stringify(message) : ''; new JX.Notification() .setContent('(Aphlict) [' + type + '] ' + details) @@ -65,7 +63,7 @@ JX.behavior('aphlict-listen', function(config) { .setContent('Page updated, click to reload.') .alterClassName('jx-notification-alert', true) .setDuration(0); - reload.listen('activate', function(e) { JX.$U().go(); }) + reload.listen('activate', function(e) { JX.$U().go(); }); reload.show(); showing_reload = true; @@ -80,11 +78,11 @@ JX.behavior('aphlict-listen', function(config) { // Add Flash object to page JX.$(config.containerID).innerHTML = - '' - + '' - + '' - + '' - + '' - + ''; //Evan sanctioned + '' + + '' + + '' + + '' + + '' + + ''; //Evan sanctioned }); diff --git a/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js b/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js index a9ddb485e7..bf4d89b969 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js +++ b/webroot/rsrc/js/application/conpherence/behavior-widget-pane.js @@ -21,15 +21,19 @@ JX.behavior('conpherence-widget-pane', function(config) { var root = JX.DOM.find(document, 'div', 'conpherence-layout'); var widgetPane = JX.DOM.find(root, 'div', 'conpherence-widget-pane'); + var i; + var tag_data; + var node; + for (var widget in config.widgetRegistery) { // device-only widgets are *always shown* on the desktop if (config.widgetRegistery[widget] == config.devicesOnly) { if (is_desktop) { JX.$(widget).style.display = 'block'; if (config.widgetExtraNodes[widget]) { - for (var i in config.widgetExtraNodes[widget]) { - var tag_data = config.widgetExtraNodes[widget][i]; - var node = JX.DOM.find(root, tag_data.tagname, tag_data.sigil); + for (i in config.widgetExtraNodes[widget]) { + tag_data = config.widgetExtraNodes[widget][i]; + node = JX.DOM.find(root, tag_data.tagname, tag_data.sigil); node.style.display = tag_data.desktopstyle; } } @@ -48,9 +52,9 @@ JX.behavior('conpherence-widget-pane', function(config) { widgetPane.style.height = '100%'; } if (config.widgetExtraNodes[widget]) { - for (var i in config.widgetExtraNodes[widget]) { - var tag_data = config.widgetExtraNodes[widget][i]; - var node = JX.DOM.find(root, tag_data.tagname, tag_data.sigil); + for (i in config.widgetExtraNodes[widget]) { + tag_data = config.widgetExtraNodes[widget][i]; + node = JX.DOM.find(root, tag_data.tagname, tag_data.sigil); node.style.display = tag_data.showstyle; } } @@ -75,9 +79,9 @@ JX.behavior('conpherence-widget-pane', function(config) { ); JX.$(widget).style.display = 'none'; if (config.widgetExtraNodes[widget]) { - for (var i in config.widgetExtraNodes[widget]) { - var tag_data = config.widgetExtraNodes[widget][i]; - var node = JX.DOM.find(root, tag_data.tagname, tag_data.sigil); + for (i in config.widgetExtraNodes[widget]) { + tag_data = config.widgetExtraNodes[widget][i]; + node = JX.DOM.find(root, tag_data.tagname, tag_data.sigil); node.style.display = tag_data.hidestyle; } } diff --git a/webroot/rsrc/js/application/countdown/timer.js b/webroot/rsrc/js/application/countdown/timer.js index 1b404b4609..69a3e2265a 100644 --- a/webroot/rsrc/js/application/countdown/timer.js +++ b/webroot/rsrc/js/application/countdown/timer.js @@ -2,7 +2,6 @@ * @provides javelin-behavior-countdown-timer * @requires javelin-behavior * javelin-dom - * javelin-util */ JX.behavior('countdown-timer', function(config) { diff --git a/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js b/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js index 08339e1585..b0a2ec8e3b 100644 --- a/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js +++ b/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js @@ -162,8 +162,9 @@ JX.install('DifferentialInlineCommentEditor', { return; } + var textarea; try { - var textarea = JX.DOM.find( + textarea = JX.DOM.find( document.body, // TODO: use getDialogRootNode() when available 'textarea', 'differential-inline-comment-edit-textarea'); @@ -180,16 +181,15 @@ JX.install('DifferentialInlineCommentEditor', { // If the user hasn't edited the text (i.e., no change from original for // 'edit' or no text at all), don't offer them an undo. - if (text == this.getOriginalText() || text == '') { + if (text == this.getOriginalText() || text === '') { return; } // Save the text so we can 'undo' back to it. this._undoText = text; - var template = this.getOnRight() - ? this.getTemplates().r - : this.getTemplates().l; + var templates = this.getTemplates(); + var template = this.getOnRight() ? templates.r : templates.l; template = JX.$N('div', JX.$H(template)); // NOTE: Operation order matters here; we can't remove anything until diff --git a/webroot/rsrc/js/application/differential/behavior-comment-jump.js b/webroot/rsrc/js/application/differential/behavior-comment-jump.js index f4d5f91228..9c971df11e 100644 --- a/webroot/rsrc/js/application/differential/behavior-comment-jump.js +++ b/webroot/rsrc/js/application/differential/behavior-comment-jump.js @@ -1,7 +1,7 @@ /** * @provides javelin-behavior-differential-comment-jump * @requires javelin-behavior - * javelin-util + * javelin-stratcom * javelin-dom */ @@ -20,7 +20,7 @@ JX.behavior('differential-comment-jump', function(config) { } } JX.Stratcom.invoke('differential-toggle-file-request', null, { - element: jumpto, + element: jumpto }); JX.DOM.scrollTo(jumpto); e.kill(); diff --git a/webroot/rsrc/js/application/differential/behavior-comment-preview.js b/webroot/rsrc/js/application/differential/behavior-comment-preview.js index 6a90ec95b5..c7b789d566 100644 --- a/webroot/rsrc/js/application/differential/behavior-comment-preview.js +++ b/webroot/rsrc/js/application/differential/behavior-comment-preview.js @@ -13,7 +13,8 @@ JX.behavior('differential-feedback-preview', function(config) { var action = JX.$(config.action); var content = JX.$(config.content); var previewTokenizers = {}; - for (var field in config.previewTokenizers) { + var field; + for (field in config.previewTokenizers) { var tokenizer = JX.$(config.previewTokenizers[field]); previewTokenizers[field] = JX.Stratcom.getData(tokenizer).tokenizer; } @@ -46,7 +47,7 @@ JX.behavior('differential-feedback-preview', function(config) { JX.DOM.listen(content, 'keydown', null, trigger); JX.DOM.listen(action, 'change', null, trigger); - for (var field in previewTokenizers) { + for (field in previewTokenizers) { previewTokenizers[field].listen('change', trigger); } diff --git a/webroot/rsrc/js/application/differential/behavior-dropdown-menus.js b/webroot/rsrc/js/application/differential/behavior-dropdown-menus.js index e199bca5fa..00d8419ba0 100644 --- a/webroot/rsrc/js/application/differential/behavior-dropdown-menus.js +++ b/webroot/rsrc/js/application/differential/behavior-dropdown-menus.js @@ -57,7 +57,7 @@ JX.behavior('differential-dropdown-menus', function(config) { var visible_item = new JX.PhabricatorMenuItem('', function () { JX.Stratcom.invoke('differential-toggle-file', null, { - diff: JX.DOM.scry(JX.$(data.containerID), 'table', 'differential-diff'), + diff: JX.DOM.scry(JX.$(data.containerID), 'table', 'differential-diff') }); }); menu.addItem(visible_item); diff --git a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js index 07183a7389..1ab0edae23 100644 --- a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js +++ b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js @@ -197,7 +197,7 @@ JX.behavior('differential-edit-inline-comments', function(config) { var node = e.getNode('differential-inline-comment'); handle_inline_action(node, op); - } + }; var handle_inline_action = function(node, op) { var data = JX.Stratcom.getData(node); @@ -243,7 +243,7 @@ JX.behavior('differential-edit-inline-comments', function(config) { .start(); set_link_state(true); - } + }; for (var op in {'edit' : 1, 'delete' : 1, 'reply' : 1}) { JX.Stratcom.listen( diff --git a/webroot/rsrc/js/application/differential/behavior-keyboard-nav.js b/webroot/rsrc/js/application/differential/behavior-keyboard-nav.js index ef9baae675..98d0b73a04 100644 --- a/webroot/rsrc/js/application/differential/behavior-keyboard-nav.js +++ b/webroot/rsrc/js/application/differential/behavior-keyboard-nav.js @@ -130,9 +130,12 @@ JX.behavior('differential-keyboard-navigation', function(config) { selection_end = blocks[focus][1]; manager.scrollTo(selection_begin); - (refreshFocus = function() { + + refreshFocus = function() { manager.focusOn(selection_begin, selection_end); - })(); + }; + + refreshFocus(); return; } else { diff --git a/webroot/rsrc/js/application/differential/behavior-populate.js b/webroot/rsrc/js/application/differential/behavior-populate.js index 42ba3832f7..3add4c3b1a 100644 --- a/webroot/rsrc/js/application/differential/behavior-populate.js +++ b/webroot/rsrc/js/application/differential/behavior-populate.js @@ -97,7 +97,7 @@ JX.behavior('differential-populate', function(config) { var diff; try { diff = JX.$(meta.id); - } catch (e) { + } catch (ex) { // Already loaded. } if (diff) { diff --git a/webroot/rsrc/js/application/differential/behavior-show-all-comments.js b/webroot/rsrc/js/application/differential/behavior-show-all-comments.js index cb0a927fda..6bd9f825a1 100644 --- a/webroot/rsrc/js/application/differential/behavior-show-all-comments.js +++ b/webroot/rsrc/js/application/differential/behavior-show-all-comments.js @@ -42,7 +42,7 @@ JX.behavior('differential-show-all-comments', function(config) { try { var target = JX.$(window.location.hash.replace(/^#/, '')); window.scrollTo(0, target.offsetTop); - } catch (e) { + } catch (ex) { } } }); diff --git a/webroot/rsrc/js/application/diffusion/behavior-audit-preview.js b/webroot/rsrc/js/application/diffusion/behavior-audit-preview.js index fa2b6dddfe..7f7ebb904f 100644 --- a/webroot/rsrc/js/application/diffusion/behavior-audit-preview.js +++ b/webroot/rsrc/js/application/diffusion/behavior-audit-preview.js @@ -21,7 +21,7 @@ JX.behavior('audit-preview', function(config) { action: action.value, content: content.value }; - } + }; var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); var trigger = JX.bind(request, request.trigger); diff --git a/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js b/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js index b5306381d7..e9ab4b12bb 100644 --- a/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js +++ b/webroot/rsrc/js/application/diffusion/behavior-commit-graph.js @@ -20,7 +20,7 @@ JX.behavior('diffusion-commit-graph', function(config) { '#00cccc', '#00cc33', '#66cc00', - '#cc9900', + '#cc9900' ]; return colors[c % colors.length]; } @@ -48,9 +48,9 @@ JX.behavior('diffusion-commit-graph', function(config) { var data = JX.Stratcom.getData(nodes[ii]); var cell = 12; // Width of each thread. - function xpos(col) { + var xpos = function(col) { return (col * cell) + (cell / 2); - } + }; var h = 26; var w = cell * config.count; @@ -71,8 +71,11 @@ JX.behavior('diffusion-commit-graph', function(config) { // a parent). We use this to figure out where to draw the join/split lines. var origin = null; - for (var jj = 0; jj < data.line.length; jj++) { - var c = data.line.charAt(jj); + var jj; + var x; + var c; + for (jj = 0; jj < data.line.length; jj++) { + c = data.line.charAt(jj); switch (c) { case 'o': case '^': @@ -84,9 +87,9 @@ JX.behavior('diffusion-commit-graph', function(config) { // Draw all the join lines. These start at some column at the top of the // canvas and join the commit's column. They indicate branching. - for (var jj = 0; jj < data.join.length; jj++) { + for (jj = 0; jj < data.join.length; jj++) { var join = data.join[jj]; - var x = xpos(join); + x = xpos(join); cxt.beginPath(); cxt.moveTo(x, 0); cxt.bezierCurveTo(x, h/4, origin, h/4, origin, h/2); @@ -96,9 +99,9 @@ JX.behavior('diffusion-commit-graph', function(config) { // Draw all the split lines. These start at the commit and end at some // column on the bottom of the canvas. They indicate merging. - for (var jj = 0; jj < data.split.length; jj++) { + for (jj = 0; jj < data.split.length; jj++) { var split = data.split[jj]; - var x = xpos(split); + x = xpos(split); cxt.beginPath(); cxt.moveTo(origin, h/2); cxt.bezierCurveTo(origin, 3*h/4, x, 3*h/4, x, h); @@ -108,13 +111,16 @@ JX.behavior('diffusion-commit-graph', function(config) { // Draw the vertical lines (a branch with no activity at this commit) and // the commit circles. - for (var jj = 0; jj < data.line.length; jj++) { - var c = data.line.charAt(jj); + for (jj = 0; jj < data.line.length; jj++) { + c = data.line.charAt(jj); switch (c) { case 'o': case '^': - origin = xpos(jj); case '|': + if (c == 'o' || c == '^') { + origin = xpos(jj); + } + cxt.beginPath(); cxt.moveTo(xpos(jj), (c == '^' ? h/2 : 0)); cxt.lineTo(xpos(jj), h); diff --git a/webroot/rsrc/js/application/diffusion/behavior-jump-to.js b/webroot/rsrc/js/application/diffusion/behavior-jump-to.js index 6c51dc814a..852502e88f 100644 --- a/webroot/rsrc/js/application/diffusion/behavior-jump-to.js +++ b/webroot/rsrc/js/application/diffusion/behavior-jump-to.js @@ -1,7 +1,6 @@ /** * @provides javelin-behavior-diffusion-jump-to * @requires javelin-behavior - * javelin-util * javelin-vector * javelin-dom */ diff --git a/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js b/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js index 7581318730..538a1f944e 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js +++ b/webroot/rsrc/js/application/maniphest/behavior-batch-editor.js @@ -79,7 +79,7 @@ JX.behavior('maniphest-batch-editor', function(config) { vfunc = function() { return status_select.value; }; break; } - }; + } JX.DOM.listen(action_select, 'change', null, update); update(); diff --git a/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js b/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js index d5aaa60d98..c66a49e66e 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js +++ b/webroot/rsrc/js/application/maniphest/behavior-batch-selector.js @@ -14,11 +14,11 @@ JX.behavior('maniphest-batch-selector', function(config) { var get_id = function(task) { return JX.Stratcom.getData(task).taskID; - } + }; var is_selected = function(task) { return (get_id(task) in selected); - } + }; // Change the selected state of a task. @@ -50,7 +50,7 @@ JX.behavior('maniphest-batch-selector', function(config) { for (var ii = 0; ii < inputs.length; ii++) { change(inputs[ii], to); } - } + }; // Clear any document text selection after toggling a task via shift click, // since errant clicks tend to start selecting various ranges otherwise. @@ -65,7 +65,7 @@ JX.behavior('maniphest-batch-selector', function(config) { } else if (document.selection) { document.selection.empty(); } - } + }; // Update the status text showing how many tasks are selected, and the button // state. @@ -73,7 +73,7 @@ JX.behavior('maniphest-batch-selector', function(config) { var update = function() { var count = JX.keys(selected).length; var status; - if (count == 0) { + if (count === 0) { status = 'Shift-Click to Select Tasks'; } else if (status == 1) { status = '1 Selected Task'; @@ -83,7 +83,7 @@ JX.behavior('maniphest-batch-selector', function(config) { JX.DOM.setContent(JX.$(config.status), status); var submit = JX.$(config.submit); - var disable = (count == 0); + var disable = (count === 0); submit.disabled = disable; JX.DOM.alterClass(submit, 'disabled', disable); }; diff --git a/webroot/rsrc/js/application/maniphest/behavior-task-preview.js b/webroot/rsrc/js/application/maniphest/behavior-task-preview.js index c9293f1235..46bd583b36 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-task-preview.js +++ b/webroot/rsrc/js/application/maniphest/behavior-task-preview.js @@ -19,7 +19,7 @@ JX.behavior('maniphest-description-preview', function(config) { return { description : textarea.value }; - } + }; var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); var trigger = JX.bind(request, request.trigger); diff --git a/webroot/rsrc/js/application/maniphest/behavior-transaction-controls.js b/webroot/rsrc/js/application/maniphest/behavior-transaction-controls.js index b532f9b0b6..b4087067a2 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-transaction-controls.js +++ b/webroot/rsrc/js/application/maniphest/behavior-transaction-controls.js @@ -12,7 +12,7 @@ JX.behavior('maniphest-transaction-controls', function(config) { for (var k in config.tokenizers) { var tconfig = config.tokenizers[k]; tokenizers[k] = JX.Prefab.buildTokenizer(tconfig).tokenizer; - tokenizers[k].start() + tokenizers[k].start(); } JX.DOM.listen( diff --git a/webroot/rsrc/js/application/maniphest/behavior-transaction-preview.js b/webroot/rsrc/js/application/maniphest/behavior-transaction-preview.js index 96186c7974..ca18eb69d4 100644 --- a/webroot/rsrc/js/application/maniphest/behavior-transaction-preview.js +++ b/webroot/rsrc/js/application/maniphest/behavior-transaction-preview.js @@ -48,7 +48,7 @@ JX.behavior('maniphest-transaction-preview', function(config) { action : selected, value : value || '' }; - } + }; var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); var trigger = JX.bind(request, request.trigger); diff --git a/webroot/rsrc/js/application/phame/phame-post-preview.js b/webroot/rsrc/js/application/phame/phame-post-preview.js index 2025bc744a..2fd15bd0cf 100644 --- a/webroot/rsrc/js/application/phame/phame-post-preview.js +++ b/webroot/rsrc/js/application/phame/phame-post-preview.js @@ -18,9 +18,9 @@ JX.behavior('phame-post-preview', function(config) { if (!sync_titles) { return; } - var title_string = new String(title.value); + var title_string = title.value; phame_title.value = normalizeSlug(title_string); - } + }; var phameTitleKeyupCallback = function (e) { // stop sync'ing once user edits phame_title directly @@ -38,11 +38,11 @@ JX.behavior('phame-post-preview', function(config) { phame_title.focus(); phame_title.setSelectionRange(position, position); } - } + }; var phameTitleBlurCallback = function (e) { phame_title.value = normalizeSlug(phame_title.value); - } + }; // This is a sort of implementation of PhabricatorSlug::normalize var normalizeSlug = function (slug, spare_trailing_underscore) { @@ -53,7 +53,7 @@ JX.behavior('phame-post-preview', function(config) { s = s.replace(/_$/g, ''); } return s; - } + }; var callback = function(r) { JX.DOM.setContent(JX.$(config.preview), JX.$H(r)); @@ -65,7 +65,7 @@ JX.behavior('phame-post-preview', function(config) { title : title.value, phame_title : phame_title.value }; - } + }; var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); var trigger = JX.bind(request, request.trigger); diff --git a/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js b/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js index bb8bf26f21..aced690ff9 100644 --- a/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js +++ b/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js @@ -76,10 +76,11 @@ JX.behavior('pholio-mock-view', function(config) { } function clear_stage() { - for (var ii = 0; ii < reticles.length; ii++) { + var ii; + for (ii = 0; ii < reticles.length; ii++) { JX.DOM.remove(reticles[ii]); } - for (var ii = 0; ii < cards.length; ii++) { + for (ii = 0; ii < cards.length; ii++) { JX.DOM.remove(cards[ii]); } reticles = []; @@ -160,7 +161,7 @@ JX.behavior('pholio-mock-view', function(config) { if (!active_image) { return; } - var idx = get_image_index(active_image.id) + var idx = get_image_index(active_image.id); idx = (idx + delta + config.images.length) % config.images.length; select_image(config.images[idx].id); } @@ -324,7 +325,7 @@ JX.behavior('pholio-mock-view', function(config) { ).setPos(dialog); JX.DOM.focus(JX.DOM.find(dialog, 'textarea')); - } + }; new JX.Workflow('/pholio/inline/save/', data) .setHandler(handler) @@ -343,14 +344,15 @@ JX.behavior('pholio-mock-view', function(config) { var width = end.x - start.x; var height = end.y - start.y; + var addon; if (width < min_size) { - var addon = (min_size-width)/2; + addon = (min_size-width)/2; start.x = Math.max(0, start.x - addon); end.x = Math.min(active_image.tag.naturalWidth, end.x + addon); - if (start.x == 0) { + if (start.x === 0) { end.x = Math.min(min_size, active_image.tag.naturalWidth); } else if (end.x == active_image.tag.naturalWidth) { start.x = Math.max(0, active_image.tag.naturalWidth - min_size); @@ -358,12 +360,12 @@ JX.behavior('pholio-mock-view', function(config) { } if (height < min_size) { - var addon = (min_size-height)/2; + addon = (min_size-height)/2; start.y = Math.max(0, start.y - addon); end.y = Math.min(active_image.tag.naturalHeight, end.y + addon); - if (start.y == 0) { + if (start.y === 0) { end.y = Math.min(min_size, active_image.tag.naturalHeight); } else if (end.y == active_image.tag.naturalHeight) { start.y = Math.max(0, active_image.tag.naturalHeight - min_size); diff --git a/webroot/rsrc/js/application/phriction/phriction-document-preview.js b/webroot/rsrc/js/application/phriction/phriction-document-preview.js index 11649408f1..c806482d4e 100644 --- a/webroot/rsrc/js/application/phriction/phriction-document-preview.js +++ b/webroot/rsrc/js/application/phriction/phriction-document-preview.js @@ -19,7 +19,7 @@ JX.behavior('phriction-document-preview', function(config) { return { document : textarea.value }; - } + }; var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); var trigger = JX.bind(request, request.trigger); diff --git a/webroot/rsrc/js/application/ponder/behavior-votebox.js b/webroot/rsrc/js/application/ponder/behavior-votebox.js index 15c3197484..f72d17a1bf 100644 --- a/webroot/rsrc/js/application/ponder/behavior-votebox.js +++ b/webroot/rsrc/js/application/ponder/behavior-votebox.js @@ -28,7 +28,7 @@ JX.behavior('ponder-votebox', function(config) { JX.DOM.alterClass(upv, 'ponder-vote-active', (data.vote > 0)); var downv = JX.DOM.find(root, 'a', 'downvote'); - JX.DOM.alterClass(downv, 'ponder-vote-active', (data.vote < 0)) + JX.DOM.alterClass(downv, 'ponder-vote-active', (data.vote < 0)); JX.DOM.setContent( JX.DOM.find(root, 'div', 'ponder-vote-count'), @@ -36,7 +36,7 @@ JX.behavior('ponder-votebox', function(config) { new JX.Request(e.getTarget().href, JX.bag) .setData({vote: data.vote}) - .send() + .send(); } JX.Stratcom.listen( diff --git a/webroot/rsrc/js/application/releeph/releeph-preview-branch.js b/webroot/rsrc/js/application/releeph/releeph-preview-branch.js index 76e406bd73..269275c707 100644 --- a/webroot/rsrc/js/application/releeph/releeph-preview-branch.js +++ b/webroot/rsrc/js/application/releeph/releeph-preview-branch.js @@ -2,15 +2,14 @@ * @provides javelin-behavior-releeph-preview-branch * @requires javelin-behavior * javelin-dom - * javelin-stratcom * javelin-uri - * javelin-util + * javelin-request */ JX.behavior('releeph-preview-branch', function(config) { var uri = JX.$U(config.uri); - for (param_name in config.params.static) { + for (var param_name in config.params.static) { var value = config.params.static[param_name]; uri.setQueryParam(param_name, value); } @@ -20,7 +19,7 @@ JX.behavior('releeph-preview-branch', function(config) { var dynamics = config.params.dynamic; function renderPreview() { - for (param_name in dynamics) { + for (var param_name in dynamics) { var node_id = dynamics[param_name]; var input = JX.$(node_id); uri.setQueryParam(param_name, input.value); @@ -33,7 +32,7 @@ JX.behavior('releeph-preview-branch', function(config) { renderPreview(); - for (ii in dynamics) { + for (var ii in dynamics) { var node_id = dynamics[ii]; var input = JX.$(node_id); JX.DOM.listen( diff --git a/webroot/rsrc/js/application/releeph/releeph-request-state-change.js b/webroot/rsrc/js/application/releeph/releeph-request-state-change.js index 286d527b84..14cf5cbe49 100644 --- a/webroot/rsrc/js/application/releeph/releeph-request-state-change.js +++ b/webroot/rsrc/js/application/releeph/releeph-request-state-change.js @@ -3,7 +3,7 @@ * @requires javelin-behavior * javelin-dom * javelin-stratcom - * javelin-util + * javelin-request * phabricator-keyboard-shortcut * phabricator-notification */ @@ -45,8 +45,8 @@ JX.behavior('releeph-request-state-change', function(config) { function keynavMarkup() { var headers = getRequestHeaderNodes(); - for (ii in headers) { - JX.DOM.alterClass(headers[ii], 'focus', ii == keynav_cursor); + for (var k in headers) { + JX.DOM.alterClass(headers[k], 'focus', k == keynav_cursor); } } diff --git a/webroot/rsrc/js/application/releeph/releeph-request-typeahead.js b/webroot/rsrc/js/application/releeph/releeph-request-typeahead.js index fd932dd73b..d8b8db7321 100644 --- a/webroot/rsrc/js/application/releeph/releeph-request-typeahead.js +++ b/webroot/rsrc/js/application/releeph/releeph-request-typeahead.js @@ -1,15 +1,10 @@ /** * @provides javelin-behavior-releeph-request-typeahead * @requires javelin-behavior - * javelin-util * javelin-dom * javelin-typeahead - * javelin-tokenizer - * javelin-typeahead-preloaded-source * javelin-typeahead-ondemand-source * javelin-dom - * javelin-stratcom - * javelin-util */ JX.behavior('releeph-request-typeahead', function(config) { @@ -48,7 +43,7 @@ JX.behavior('releeph-request-typeahead', function(config) { 'div', { className: 'summary' }, summary - ), + ) ] ); diff --git a/webroot/rsrc/js/application/slowvote/behavior-slowvote-embed.js b/webroot/rsrc/js/application/slowvote/behavior-slowvote-embed.js index b35cdadd09..b762c1c74b 100644 --- a/webroot/rsrc/js/application/slowvote/behavior-slowvote-embed.js +++ b/webroot/rsrc/js/application/slowvote/behavior-slowvote-embed.js @@ -1,7 +1,7 @@ /** * @provides javelin-behavior-slowvote-embed * @requires javelin-behavior - * javelin-util + * javelin-request * javelin-stratcom * javelin-dom */ diff --git a/webroot/rsrc/js/application/transactions/behavior-transaction-comment-form.js b/webroot/rsrc/js/application/transactions/behavior-transaction-comment-form.js index 2c740b8889..7203988df6 100644 --- a/webroot/rsrc/js/application/transactions/behavior-transaction-comment-form.js +++ b/webroot/rsrc/js/application/transactions/behavior-transaction-comment-form.js @@ -36,7 +36,7 @@ JX.behavior('phabricator-transaction-comment-form', function(config) { [ JX.$H(response.spacer), JX.$H(response.xactions.join(response.spacer)), - JX.$H(response.spacer), + JX.$H(response.spacer) ]); JX.DOM.show(panel); } diff --git a/webroot/rsrc/js/application/uiexample/JavelinViewExample.js b/webroot/rsrc/js/application/uiexample/JavelinViewExample.js index 5f51185a2c..7967e20c8c 100644 --- a/webroot/rsrc/js/application/uiexample/JavelinViewExample.js +++ b/webroot/rsrc/js/application/uiexample/JavelinViewExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-javelin-view * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom */ diff --git a/webroot/rsrc/js/application/uiexample/ReactorButtonExample.js b/webroot/rsrc/js/application/uiexample/ReactorButtonExample.js index 36d3a7bea2..07ad129f65 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorButtonExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorButtonExample.js @@ -1,9 +1,9 @@ /** * @provides phabricator-uiexample-reactor-button * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom + * javelin-util + * javelin-dynval * javelin-reactor-dom */ diff --git a/webroot/rsrc/js/application/uiexample/ReactorCheckboxExample.js b/webroot/rsrc/js/application/uiexample/ReactorCheckboxExample.js index 4845480b65..b308ee4dbe 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorCheckboxExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorCheckboxExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-reactor-checkbox * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom * javelin-reactor-dom */ diff --git a/webroot/rsrc/js/application/uiexample/ReactorFocusExample.js b/webroot/rsrc/js/application/uiexample/ReactorFocusExample.js index bba4151e18..af76b9624a 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorFocusExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorFocusExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-reactor-focus * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom * javelin-reactor-dom */ diff --git a/webroot/rsrc/js/application/uiexample/ReactorInputExample.js b/webroot/rsrc/js/application/uiexample/ReactorInputExample.js index 1908801114..6b1a2c120f 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorInputExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorInputExample.js @@ -1,9 +1,6 @@ /** * @provides phabricator-uiexample-reactor-input * @requires javelin-install - * javelin-view - * javelin-util - * javelin-dom * javelin-reactor-dom * javelin-view-html * javelin-view-interpreter diff --git a/webroot/rsrc/js/application/uiexample/ReactorMouseoverExample.js b/webroot/rsrc/js/application/uiexample/ReactorMouseoverExample.js index 5c37ae7628..05152d39d4 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorMouseoverExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorMouseoverExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-reactor-mouseover * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom * javelin-reactor-dom */ diff --git a/webroot/rsrc/js/application/uiexample/ReactorRadioExample.js b/webroot/rsrc/js/application/uiexample/ReactorRadioExample.js index 2c74217889..db74a2f022 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorRadioExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorRadioExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-reactor-radio * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom * javelin-reactor-dom */ diff --git a/webroot/rsrc/js/application/uiexample/ReactorSelectExample.js b/webroot/rsrc/js/application/uiexample/ReactorSelectExample.js index ef3c02cf76..b7bb30acb1 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorSelectExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorSelectExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-reactor-select * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom * javelin-reactor-dom */ @@ -14,7 +12,7 @@ JX.install('ReactorSelectExample', { var select = JX.$N('select', {}, [ JX.$N('option', { value: 'goat' }, 'Goat'), JX.$N('option', { value: 'bat' }, 'Bat'), - JX.$N('option', { value: 'duck' }, 'Duck'), + JX.$N('option', { value: 'duck' }, 'Duck') ]); return [select, JX.RDOM.$DT(JX.RDOM.select(select))]; diff --git a/webroot/rsrc/js/application/uiexample/ReactorSendClassExample.js b/webroot/rsrc/js/application/uiexample/ReactorSendClassExample.js index c97ebd279c..70615d9fec 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorSendClassExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorSendClassExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-reactor-sendclass * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom * javelin-reactor-dom */ diff --git a/webroot/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js b/webroot/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js index 61478c84ea..eeae796c2a 100644 --- a/webroot/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js +++ b/webroot/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js @@ -1,8 +1,6 @@ /** * @provides phabricator-uiexample-reactor-sendproperties * @requires javelin-install - * javelin-view - * javelin-util * javelin-dom * javelin-reactor-dom */ diff --git a/webroot/rsrc/js/application/uiexample/gesture-example.js b/webroot/rsrc/js/application/uiexample/gesture-example.js index 8fdf8351ed..92495f97d1 100644 --- a/webroot/rsrc/js/application/uiexample/gesture-example.js +++ b/webroot/rsrc/js/application/uiexample/gesture-example.js @@ -62,8 +62,10 @@ JX.behavior('phabricator-gesture-example', function(config) { cxt.fillStyle = '#dfdfdf'; cxt.fillRect(0, 0, d.x, d.y); - for (var ii = 0; ii < strokes.length; ii++) { - var s = strokes[ii]; + var s; + var ii; + for (ii = 0; ii < strokes.length; ii++) { + s = strokes[ii]; cxt.strokeStyle = 'rgba(0, 0, 0, 0.50)'; cxt.beginPath(); cxt.moveTo(s[0], s[1]); @@ -71,8 +73,8 @@ JX.behavior('phabricator-gesture-example', function(config) { cxt.stroke(); } - for (var ii = 0; ii < current.length; ii++) { - var s = current[ii]; + for (ii = 0; ii < current.length; ii++) { + s = current[ii]; cxt.strokeStyle = 'rgba(255, 0, 0, 1)'; cxt.beginPath(); cxt.moveTo(s[0], s[1]); diff --git a/webroot/rsrc/js/application/uiexample/notification-example.js b/webroot/rsrc/js/application/uiexample/notification-example.js index 6767b43b64..631c4139a9 100644 --- a/webroot/rsrc/js/application/uiexample/notification-example.js +++ b/webroot/rsrc/js/application/uiexample/notification-example.js @@ -2,7 +2,6 @@ * @requires phabricator-notification * javelin-stratcom * javelin-behavior - * javelin-uri * @provides javelin-behavior-phabricator-notification-example */ diff --git a/webroot/rsrc/js/core/DragAndDropFileUpload.js b/webroot/rsrc/js/core/DragAndDropFileUpload.js index 531d04ceda..25c6c1a723 100644 --- a/webroot/rsrc/js/core/DragAndDropFileUpload.js +++ b/webroot/rsrc/js/core/DragAndDropFileUpload.js @@ -41,13 +41,13 @@ JX.install('PhabricatorDragAndDropFileUpload', { _node : null, _depth : 0, _updateDepth : function(delta) { - if (this._depth == 0 && delta > 0) { + if (this._depth === 0 && delta > 0) { this.invoke('didBeginDrag'); } this._depth += delta; - if (this._depth == 0 && delta < 0) { + if (this._depth === 0 && delta < 0) { this.invoke('didEndDrag'); } }, diff --git a/webroot/rsrc/js/core/FileUpload.js b/webroot/rsrc/js/core/FileUpload.js index 05f33300a0..bdc28f427f 100644 --- a/webroot/rsrc/js/core/FileUpload.js +++ b/webroot/rsrc/js/core/FileUpload.js @@ -36,11 +36,12 @@ JX.install('PhabricatorFileUpload', { .setDuration(0) .show(); + var content; switch (this.getStatus()) { case 'done': var link = JX.$N('a', {href: this.getURI()}, 'F' + this.getID()); - var content = [ + content = [ JX.$N('strong', {}, ['Upload Complete (', link, ')']), JX.$N('br'), this.getName() @@ -53,7 +54,7 @@ JX.install('PhabricatorFileUpload', { this._notification = null; break; case 'error': - var content = [ + content = [ JX.$N('strong', {}, 'Upload Failure'), JX.$N('br'), this.getName(), @@ -89,7 +90,7 @@ JX.install('PhabricatorFileUpload', { return null; } var ratio = this.getUploadedBytes() / this.getTotalBytes(); - return parseInt(100 * ratio) + '%'; + return parseInt(100 * ratio, 10) + '%'; }, _renderFileSize : function() { if (!this.getTotalBytes()) { diff --git a/webroot/rsrc/js/core/Hovercard.js b/webroot/rsrc/js/core/Hovercard.js index 0a9db67615..5174a85b5a 100644 --- a/webroot/rsrc/js/core/Hovercard.js +++ b/webroot/rsrc/js/core/Hovercard.js @@ -86,12 +86,12 @@ JX.install('Hovercard', { // TODO: Fix southern graceful align var margin = 20; // We can't shift left by ~$margin or more here due to Pholio, Phriction - var x = parseInt(p.x) - margin / 2; - var y = parseInt(p.y - n.y) - margin; + var x = parseInt(p.x, 10) - margin / 2; + var y = parseInt(p.y - n.y, 10) - margin; // If more in the center, we can safely center if (x > (n.x / 2) + margin) { - x = parseInt(p.x - (n.x / 2) + d.x); + x = parseInt(p.x - (n.x / 2) + d.x, 10); } // Temporarily disabled, since it gives weird results (you can only see diff --git a/webroot/rsrc/js/core/Prefab.js b/webroot/rsrc/js/core/Prefab.js index b3388d723a..56bd70ac7f 100644 --- a/webroot/rsrc/js/core/Prefab.js +++ b/webroot/rsrc/js/core/Prefab.js @@ -46,8 +46,10 @@ JX.install('Prefab', { * */ buildTokenizer : function(config) { + var root; + try { - var root = config.root || JX.$(config.id); + root = config.root || JX.$(config.id); } catch (ex) { // If the root element does not exist, just return without building // anything. This happens in some cases -- like Conpherence -- where we diff --git a/webroot/rsrc/js/core/ToolTip.js b/webroot/rsrc/js/core/ToolTip.js index b7db7b0f7d..399c937d63 100644 --- a/webroot/rsrc/js/core/ToolTip.js +++ b/webroot/rsrc/js/core/ToolTip.js @@ -54,20 +54,20 @@ JX.install('Tooltip', { switch (align) { case 'N': - node.style.left = parseInt(p.x - ((n.x - d.x) / 2)) + 'px'; - node.style.top = parseInt(p.y - n.y) + 'px'; + node.style.left = parseInt(p.x - ((n.x - d.x) / 2), 10) + 'px'; + node.style.top = parseInt(p.y - n.y, 10) + 'px'; break; case 'E': - node.style.left = parseInt(p.x + d.x) + 'px'; - node.style.top = parseInt(p.y - ((n.y - d.y) / 2)) + 'px'; + node.style.left = parseInt(p.x + d.x, 10) + 'px'; + node.style.top = parseInt(p.y - ((n.y - d.y) / 2), 10) + 'px'; break; case 'S': - node.style.left = parseInt(p.x - ((n.x - d.x) / 2)) + 'px'; - node.style.top = parseInt(p.y + d.y + 5) + 'px'; + node.style.left = parseInt(p.x - ((n.x - d.x) / 2), 10) + 'px'; + node.style.top = parseInt(p.y + d.y + 5, 10) + 'px'; break; case 'W': - node.style.left = parseInt(p.x - n.x - 5) + 'px'; - node.style.top = parseInt(p.y - ((n.y - d.y) / 2)) + 'px'; + node.style.left = parseInt(p.x - n.x - 5, 10) + 'px'; + node.style.top = parseInt(p.y - ((n.y - d.y) / 2), 10) + 'px'; break; } }, diff --git a/webroot/rsrc/js/core/behavior-active-nav.js b/webroot/rsrc/js/core/behavior-active-nav.js index 7a2f83bb89..c0bc40b2a9 100644 --- a/webroot/rsrc/js/core/behavior-active-nav.js +++ b/webroot/rsrc/js/core/behavior-active-nav.js @@ -29,7 +29,7 @@ JX.behavior('phabricator-active-nav', function(config) { 'phabricator-active-nav-focus', selected); } - } + }; /** @@ -49,7 +49,8 @@ JX.behavior('phabricator-active-nav', function(config) { // Sort the markers by Y position, descending. var markinfo = []; - for (var ii = 0; ii < markers.length; ii++) { + var ii; + for (ii = 0; ii < markers.length; ii++) { markinfo.push({ marker: markers[ii], position: JX.$V(markers[ii]).y - 15 @@ -60,7 +61,7 @@ JX.behavior('phabricator-active-nav', function(config) { // Find the first marker above the current scroll position, or the first // marker in the document if we're above all the markers. var active = null; - for (var ii = 0; ii < markinfo.length; ii++) { + for (ii = 0; ii < markinfo.length; ii++) { active = markinfo[ii].marker; if (markinfo[ii].position <= scroll_position) { break; @@ -72,13 +73,13 @@ JX.behavior('phabricator-active-nav', function(config) { // If we get above the first marker, select it. selectnav(active && JX.Stratcom.getData(active).anchor); - } + }; var pending = null; var onviewportchange = function(e) { pending && clearTimeout(pending); pending = setTimeout(updateposition, 100); - } + }; JX.Stratcom.listen('scroll', null, onviewportchange); JX.Stratcom.listen('resize', null, onviewportchange); diff --git a/webroot/rsrc/js/core/behavior-fancy-datepicker.js b/webroot/rsrc/js/core/behavior-fancy-datepicker.js index 7dab7e2c88..cd5ffb3b08 100644 --- a/webroot/rsrc/js/core/behavior-fancy-datepicker.js +++ b/webroot/rsrc/js/core/behavior-fancy-datepicker.js @@ -76,7 +76,7 @@ JX.behavior('fancy-datepicker', function(config) { m: JX.DOM.find(root, 'select', 'month-input'), d: JX.DOM.find(root, 'select', 'day-input') }; - } + }; var read_date = function() { var i = get_inputs(); @@ -97,7 +97,7 @@ JX.behavior('fancy-datepicker', function(config) { picker.firstChild, [ render_month(), - render_day(), + render_day() ]); }; @@ -114,7 +114,7 @@ JX.behavior('fancy-datepicker', function(config) { } return JX.$N('td', {meta: {value: value}, className: class_name}, label); - } + }; // Render the top bar which allows you to pick a month and year. @@ -152,7 +152,8 @@ JX.behavior('fancy-datepicker', function(config) { // First, render the weekday names. var weekdays = 'SMTWTFS'; var weekday_names = []; - for (var ii = 0; ii < weekdays.length; ii++) { + var ii; + for (ii = 0; ii < weekdays.length; ii++) { weekday_names.push(cell(weekdays.charAt(ii), null, false, 'day-name')); } weeks.push(JX.$N('tr', {}, weekday_names)); @@ -168,7 +169,7 @@ JX.behavior('fancy-datepicker', function(config) { var today = new Date(); - for (var ii = 1; ii <= 31; ii++) { + for (ii = 1; ii <= 31; ii++) { var date = new Date(value_y, value_m - 1, ii); if (date.getMonth() != (value_m - 1)) { // We've spilled over into the next month, so stop rendering. @@ -183,7 +184,7 @@ JX.behavior('fancy-datepicker', function(config) { if (is_today) { classes.push('today'); } - if (date.getDay() == 0 || date.getDay() == 6) { + if (date.getDay() === 0 || date.getDay() == 6) { classes.push('weekend'); } @@ -191,7 +192,7 @@ JX.behavior('fancy-datepicker', function(config) { } // Slice the days into weeks. - for (var ii = 0; ii < days.length; ii += 7) { + for (ii = 0; ii < days.length; ii += 7) { weeks.push(JX.$N('tr', {}, days.slice(ii, ii + 7))); } @@ -216,7 +217,7 @@ JX.behavior('fancy-datepicker', function(config) { switch (p[0]) { case 'm': // User clicked left or right month selection buttons. - value_m = value_m + parseInt(p[1]); + value_m = value_m + parseInt(p[1], 10); if (value_m > 12) { value_m -= 12; value_y++; @@ -227,7 +228,7 @@ JX.behavior('fancy-datepicker', function(config) { break; case 'd': // User clicked a day. - value_d = parseInt(p[1]); + value_d = parseInt(p[1], 10); write_date(); // Wait a moment to close the selector so they can see the effect diff --git a/webroot/rsrc/js/core/behavior-global-drag-and-drop.js b/webroot/rsrc/js/core/behavior-global-drag-and-drop.js index 8d4b7a443b..ad66625599 100644 --- a/webroot/rsrc/js/core/behavior-global-drag-and-drop.js +++ b/webroot/rsrc/js/core/behavior-global-drag-and-drop.js @@ -41,7 +41,7 @@ JX.behavior('global-drag-and-drop', function(config) { files.push(f); pending--; - if (pending == 0 && !errors) { + if (pending === 0 && !errors) { // If whatever the user dropped in has finished uploading, send them to // their uploads. var uri; diff --git a/webroot/rsrc/js/core/behavior-hovercard.js b/webroot/rsrc/js/core/behavior-hovercard.js index 86a9ef8f5c..6303d3c3bd 100644 --- a/webroot/rsrc/js/core/behavior-hovercard.js +++ b/webroot/rsrc/js/core/behavior-hovercard.js @@ -13,7 +13,7 @@ JX.behavior('phabricator-hovercards', function(config) { // We listen for mousemove instead of mouseover to handle the case when user // scrolls with keyboard. We don't want to display hovercard if node gets // under the mouse cursor randomly placed somewhere on the screen. This - // unfortunatelly doesn't work in Google Chrome which triggers both mousemove + // unfortunately doesn't work in Google Chrome which triggers both mousemove // and mouseover in this case but works in other browsers. JX.Stratcom.listen( 'mousemove', diff --git a/webroot/rsrc/js/core/behavior-lightbox-attachments.js b/webroot/rsrc/js/core/behavior-lightbox-attachments.js index 55d6bb4d22..477febd0ec 100644 --- a/webroot/rsrc/js/core/behavior-lightbox-attachments.js +++ b/webroot/rsrc/js/core/behavior-lightbox-attachments.js @@ -157,7 +157,7 @@ JX.behavior('lightbox-attachments', function (config) { img.onload = function() { JX.DOM.alterClass(img, 'loading', false); JX.Busy.done(); - } + }; img.src = img_uri; } diff --git a/webroot/rsrc/js/core/behavior-object-selector.js b/webroot/rsrc/js/core/behavior-object-selector.js index e897df857e..8affe37c43 100644 --- a/webroot/rsrc/js/core/behavior-object-selector.js +++ b/webroot/rsrc/js/core/behavior-object-selector.js @@ -79,7 +79,7 @@ JX.behavior('phabricator-object-selector', function(config) { var cells = [ JX.$N('td', {}, view_object_link), JX.$N('th', {}, select_object_link), - JX.$N('td', {}, select_object_button), + JX.$N('td', {}, select_object_button) ]; var table = JX.$N( @@ -109,7 +109,7 @@ JX.behavior('phabricator-object-selector', function(config) { function sendQuery() { query_timer = null; - JX.DOM.setContent(JX.$(config.results), renderNote('Loading...')) + JX.DOM.setContent(JX.$(config.results), renderNote('Loading...')); new JX.Request(config.uri, JX.bind(null, onreceive, ++n)) .setData({ filter: JX.$(config.filter).value, diff --git a/webroot/rsrc/js/core/behavior-oncopy.js b/webroot/rsrc/js/core/behavior-oncopy.js index 7580a914b7..e048c442b5 100644 --- a/webroot/rsrc/js/core/behavior-oncopy.js +++ b/webroot/rsrc/js/core/behavior-oncopy.js @@ -37,7 +37,7 @@ JX.behavior('phabricator-oncopy', function() { var pos; for (var ii = 0; ii < lines.length; ii++) { pos = lines[ii].indexOf(zws); - if (pos == -1 && ii != 0) { + if (pos == -1 && ii !== 0) { continue; } result.push(lines[ii].substring(pos + 1)); @@ -76,5 +76,5 @@ JX.behavior('phabricator-oncopy', function() { // to work or give me any errors. So you lose your selection when you // copy. Oh well? } - } + }; }); diff --git a/webroot/rsrc/js/core/behavior-phabricator-nav.js b/webroot/rsrc/js/core/behavior-phabricator-nav.js index 0df0967279..99cbe127c2 100644 --- a/webroot/rsrc/js/core/behavior-phabricator-nav.js +++ b/webroot/rsrc/js/core/behavior-phabricator-nav.js @@ -6,6 +6,8 @@ * javelin-dom * javelin-magical-init * javelin-vector + * javelin-request + * javelin-util * @javelin */ @@ -46,7 +48,6 @@ JX.behavior('phabricator-nav', function(config) { element: background, parameter: 'width', start: JX.Vector.getDim(background).x, - start: JX.Vector.getDim(background).x, minWidth: 1 }, { @@ -74,8 +75,9 @@ JX.behavior('phabricator-nav', function(config) { var dx = JX.$V(e).x - dragging.x; var panel; + var k; - for (var k = 0; k < track.length; k++) { + for (k = 0; k < track.length; k++) { panel = track[k]; if (!panel.minWidth) { continue; @@ -86,7 +88,7 @@ JX.behavior('phabricator-nav', function(config) { } } - for (var k = 0; k < track.length; k++) { + for (k = 0; k < track.length; k++) { panel = track[k]; var v = (panel.start + (dx * (panel.scale || 1))); panel.element.style[panel.parameter] = v + 'px'; @@ -115,7 +117,7 @@ JX.behavior('phabricator-nav', function(config) { JX.DOM.alterClass(main, 'has-local-nav', !collapsed); JX.DOM.alterClass(main, 'has-drag-nav', !collapsed); resetdrag(); - new JX.Request('/settings/adjust/', JX.Bag) + new JX.Request('/settings/adjust/', JX.bag) .setData({ key : 'nav-collapsed', value : (collapsed ? 1 : 0) }) .send(); }); diff --git a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js index 1eeb507530..1152bedd6a 100644 --- a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js +++ b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js @@ -119,11 +119,11 @@ JX.behavior('phabricator-remarkup-assist', function(config) { // Now, select just the middle part. For instance, if the user clicked // "B" to create bold text, we insert '**bold**' but just select the word // "bold" so if they type stuff they'll be editing the bold text. - var r = JX.TextAreaUtils.getSelectionRange(area); + var range = JX.TextAreaUtils.getSelectionRange(area); JX.TextAreaUtils.setSelectionRange( area, - r.start + l.length, - r.start + l.length + m.length); + range.start + l.length, + range.start + l.length + m.length); } function assist(area, action, root) { @@ -152,16 +152,16 @@ JX.behavior('phabricator-remarkup-assist', function(config) { sel = ["List Item"]; } sel = sel.join("\n" + ch); - update(area, ((r.start == 0) ? "" : "\n\n") + ch, sel, "\n\n"); + update(area, ((r.start === 0) ? "" : "\n\n") + ch, sel, "\n\n"); break; case 'code': sel = sel || "foreach ($list as $item) {\n work_miracles($item);\n}"; sel = sel.split("\n"); sel = " " + sel.join("\n "); - update(area, ((r.start == 0) ? "" : "\n\n"), sel, "\n\n"); + update(area, ((r.start === 0) ? "" : "\n\n"), sel, "\n\n"); break; case 'table': - update(area, (r.start == 0 ? '' : '\n\n') + '| ', sel || 'data', ' |'); + update(area, (r.start === 0 ? '' : '\n\n') + '| ', sel || 'data', ' |'); break; case 'meme': new JX.Workflow('/macro/meme/create/') @@ -170,7 +170,7 @@ JX.behavior('phabricator-remarkup-assist', function(config) { area, '', sel, - (r.start == 0 ? '' : '\n\n') + response.text + '\n\n'); + (r.start === 0 ? '' : '\n\n') + response.text + '\n\n'); }) .start(); break; diff --git a/webroot/rsrc/js/core/behavior-refresh-csrf.js b/webroot/rsrc/js/core/behavior-refresh-csrf.js index 8e3d18953f..bd236838ab 100644 --- a/webroot/rsrc/js/core/behavior-refresh-csrf.js +++ b/webroot/rsrc/js/core/behavior-refresh-csrf.js @@ -54,5 +54,6 @@ JX.behavior('refresh-csrf', function(config) { JX.Request.listen('finally', function(r) { JX.Busy.done(); - }) + }); + }); diff --git a/webroot/rsrc/js/core/behavior-reveal-content.js b/webroot/rsrc/js/core/behavior-reveal-content.js index 58ab087970..06ae482efa 100644 --- a/webroot/rsrc/js/core/behavior-reveal-content.js +++ b/webroot/rsrc/js/core/behavior-reveal-content.js @@ -13,10 +13,11 @@ JX.behavior('phabricator-reveal-content', function(config) { function(e) { e.kill(); var nodes = e.getNodeData('reveal-content'); - for (var ii = 0; ii < nodes.showIDs.length; ii++) { + var ii; + for (ii = 0; ii < nodes.showIDs.length; ii++) { JX.DOM.show(JX.$(nodes.showIDs[ii])); } - for (var ii = 0; ii < nodes.hideIDs.length; ii++) { + for (ii = 0; ii < nodes.hideIDs.length; ii++) { JX.DOM.hide(JX.$(nodes.hideIDs[ii])); } }); diff --git a/webroot/rsrc/js/core/behavior-search-typeahead.js b/webroot/rsrc/js/core/behavior-search-typeahead.js index 3b28807496..e6decc47b1 100644 --- a/webroot/rsrc/js/core/behavior-search-typeahead.js +++ b/webroot/rsrc/js/core/behavior-search-typeahead.js @@ -16,7 +16,7 @@ JX.behavior('phabricator-search-typeahead', function(config) { function transform(object) { var attr = { className: 'phabricator-main-search-typeahead-result' - } + }; if (object[6]) { attr.style = {backgroundImage: 'url('+object[6]+')'}; @@ -59,7 +59,8 @@ JX.behavior('phabricator-search-typeahead', function(config) { var tokens = this.tokenize(value); - for (var ii = 0; ii < list.length; ii++) { + var ii; + for (ii = 0; ii < list.length; ii++) { var item = list[ii]; if (!item.priority) { continue; @@ -91,7 +92,7 @@ JX.behavior('phabricator-search-typeahead', function(config) { // we show 3 applications, then 3 users, etc. var type_count = 0; var current_type = null; - for (var ii = 0; ii < list.length; ii++) { + for (ii = 0; ii < list.length; ii++) { if (list.length <= config.limit) { break; } diff --git a/webroot/rsrc/js/core/phtize.js b/webroot/rsrc/js/core/phtize.js index a48970c411..f97cf6ccaf 100644 --- a/webroot/rsrc/js/core/phtize.js +++ b/webroot/rsrc/js/core/phtize.js @@ -1,6 +1,7 @@ /** * @provides phabricator-phtize * @requires javelin-util + * @javelin-installs JX.phtize * @javelin */