@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove placeholder

Summary: See discussion in D3103. We don't need this for now; if we do in the future we should probably use an alternate implementation.

Test Plan: Grepped for 'placeholder', viewed UI examples.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1569

Differential Revision: https://secure.phabricator.com/D3115

+49 -156
+48 -59
src/__celerity_resource_map__.php
··· 1139 1139 ), 1140 1140 'javelin-behavior-diffusion-commit-branches' => 1141 1141 array( 1142 - 'uri' => '/res/e6ae17a6/rsrc/js/application/diffusion/behavior-commit-branches.js', 1142 + 'uri' => '/res/1ede335a/rsrc/js/application/diffusion/behavior-commit-branches.js', 1143 1143 'type' => 'js', 1144 1144 'requires' => 1145 1145 array( ··· 1516 1516 ), 1517 1517 'disk' => '/rsrc/js/application/phriction/phriction-document-preview.js', 1518 1518 ), 1519 - 'javelin-behavior-placeholder' => 1520 - array( 1521 - 'uri' => '/res/7dc26990/rsrc/js/application/core/behavior-placeholder.js', 1522 - 'type' => 'js', 1523 - 'requires' => 1524 - array( 1525 - 0 => 'javelin-behavior', 1526 - 1 => 'javelin-dom', 1527 - ), 1528 - 'disk' => '/rsrc/js/application/core/behavior-placeholder.js', 1529 - ), 1530 1519 'javelin-behavior-projects-resource-editor' => 1531 1520 array( 1532 1521 'uri' => '/res/ffdde7d9/rsrc/js/application/projects/projects-resource-editor.js', ··· 1559 1548 ), 1560 1549 'javelin-behavior-repository-crossreference' => 1561 1550 array( 1562 - 'uri' => '/res/8e4bbed2/rsrc/js/application/repository/repository-crossreference.js', 1551 + 'uri' => '/res/345ad6b3/rsrc/js/application/repository/repository-crossreference.js', 1563 1552 'type' => 'js', 1564 1553 'requires' => 1565 1554 array( ··· 2438 2427 ), 2439 2428 'phabricator-standard-page-view' => 2440 2429 array( 2441 - 'uri' => '/res/4c0444c2/rsrc/css/application/base/standard-page-view.css', 2430 + 'uri' => '/res/678262d4/rsrc/css/application/base/standard-page-view.css', 2442 2431 'type' => 'css', 2443 2432 'requires' => 2444 2433 array( ··· 2693 2682 ), array( 2694 2683 'packages' => 2695 2684 array( 2696 - 'abce9c99' => 2685 + 84072344 => 2697 2686 array( 2698 2687 'name' => 'core.pkg.css', 2699 2688 'symbols' => ··· 2722 2711 21 => 'phabricator-flag-css', 2723 2712 22 => 'aphront-error-view-css', 2724 2713 ), 2725 - 'uri' => '/res/pkg/abce9c99/core.pkg.css', 2714 + 'uri' => '/res/pkg/84072344/core.pkg.css', 2726 2715 'type' => 'css', 2727 2716 ), 2728 2717 '971b021e' => ··· 2773 2762 'uri' => '/res/pkg/96bc37d6/differential.pkg.css', 2774 2763 'type' => 'css', 2775 2764 ), 2776 - 'f4bbbd84' => 2765 + 'ffd90d51' => 2777 2766 array( 2778 2767 'name' => 'differential.pkg.js', 2779 2768 'symbols' => ··· 2797 2786 16 => 'javelin-behavior-differential-dropdown-menus', 2798 2787 17 => 'javelin-behavior-buoyant', 2799 2788 ), 2800 - 'uri' => '/res/pkg/f4bbbd84/differential.pkg.js', 2789 + 'uri' => '/res/pkg/ffd90d51/differential.pkg.js', 2801 2790 'type' => 'js', 2802 2791 ), 2803 2792 'c8ce2d88' => ··· 2889 2878 'reverse' => 2890 2879 array( 2891 2880 'aphront-attached-file-view-css' => '7839ae2d', 2892 - 'aphront-crumbs-view-css' => 'abce9c99', 2893 - 'aphront-dialog-view-css' => 'abce9c99', 2894 - 'aphront-error-view-css' => 'abce9c99', 2895 - 'aphront-form-view-css' => 'abce9c99', 2881 + 'aphront-crumbs-view-css' => '84072344', 2882 + 'aphront-dialog-view-css' => '84072344', 2883 + 'aphront-error-view-css' => '84072344', 2884 + 'aphront-form-view-css' => '84072344', 2896 2885 'aphront-headsup-action-list-view-css' => '96bc37d6', 2897 - 'aphront-headsup-view-css' => 'abce9c99', 2898 - 'aphront-list-filter-view-css' => 'abce9c99', 2899 - 'aphront-pager-view-css' => 'abce9c99', 2900 - 'aphront-panel-view-css' => 'abce9c99', 2901 - 'aphront-side-nav-view-css' => 'abce9c99', 2902 - 'aphront-table-view-css' => 'abce9c99', 2903 - 'aphront-tokenizer-control-css' => 'abce9c99', 2904 - 'aphront-tooltip-css' => 'abce9c99', 2905 - 'aphront-typeahead-control-css' => 'abce9c99', 2886 + 'aphront-headsup-view-css' => '84072344', 2887 + 'aphront-list-filter-view-css' => '84072344', 2888 + 'aphront-pager-view-css' => '84072344', 2889 + 'aphront-panel-view-css' => '84072344', 2890 + 'aphront-side-nav-view-css' => '84072344', 2891 + 'aphront-table-view-css' => '84072344', 2892 + 'aphront-tokenizer-control-css' => '84072344', 2893 + 'aphront-tooltip-css' => '84072344', 2894 + 'aphront-typeahead-control-css' => '84072344', 2906 2895 'differential-changeset-view-css' => '96bc37d6', 2907 2896 'differential-core-view-css' => '96bc37d6', 2908 - 'differential-inline-comment-editor' => 'f4bbbd84', 2897 + 'differential-inline-comment-editor' => 'ffd90d51', 2909 2898 'differential-local-commits-view-css' => '96bc37d6', 2910 2899 'differential-results-table-css' => '96bc37d6', 2911 2900 'differential-revision-add-comment-css' => '96bc37d6', ··· 2918 2907 'inline-comment-summary-css' => '96bc37d6', 2919 2908 'javelin-behavior' => '6fb20113', 2920 2909 'javelin-behavior-aphront-basic-tokenizer' => '97f65640', 2921 - 'javelin-behavior-aphront-drag-and-drop' => 'f4bbbd84', 2922 - 'javelin-behavior-aphront-drag-and-drop-textarea' => 'f4bbbd84', 2910 + 'javelin-behavior-aphront-drag-and-drop' => 'ffd90d51', 2911 + 'javelin-behavior-aphront-drag-and-drop-textarea' => 'ffd90d51', 2923 2912 'javelin-behavior-aphront-form-disable-on-submit' => '971b021e', 2924 2913 'javelin-behavior-audit-preview' => '5e68be89', 2925 - 'javelin-behavior-buoyant' => 'f4bbbd84', 2926 - 'javelin-behavior-differential-accept-with-errors' => 'f4bbbd84', 2927 - 'javelin-behavior-differential-add-reviewers-and-ccs' => 'f4bbbd84', 2928 - 'javelin-behavior-differential-comment-jump' => 'f4bbbd84', 2929 - 'javelin-behavior-differential-diff-radios' => 'f4bbbd84', 2930 - 'javelin-behavior-differential-dropdown-menus' => 'f4bbbd84', 2931 - 'javelin-behavior-differential-edit-inline-comments' => 'f4bbbd84', 2932 - 'javelin-behavior-differential-feedback-preview' => 'f4bbbd84', 2933 - 'javelin-behavior-differential-keyboard-navigation' => 'f4bbbd84', 2934 - 'javelin-behavior-differential-populate' => 'f4bbbd84', 2935 - 'javelin-behavior-differential-show-more' => 'f4bbbd84', 2914 + 'javelin-behavior-buoyant' => 'ffd90d51', 2915 + 'javelin-behavior-differential-accept-with-errors' => 'ffd90d51', 2916 + 'javelin-behavior-differential-add-reviewers-and-ccs' => 'ffd90d51', 2917 + 'javelin-behavior-differential-comment-jump' => 'ffd90d51', 2918 + 'javelin-behavior-differential-diff-radios' => 'ffd90d51', 2919 + 'javelin-behavior-differential-dropdown-menus' => 'ffd90d51', 2920 + 'javelin-behavior-differential-edit-inline-comments' => 'ffd90d51', 2921 + 'javelin-behavior-differential-feedback-preview' => 'ffd90d51', 2922 + 'javelin-behavior-differential-keyboard-navigation' => 'ffd90d51', 2923 + 'javelin-behavior-differential-populate' => 'ffd90d51', 2924 + 'javelin-behavior-differential-show-more' => 'ffd90d51', 2936 2925 'javelin-behavior-diffusion-commit-graph' => '5e68be89', 2937 2926 'javelin-behavior-diffusion-pull-lastmodified' => '5e68be89', 2938 2927 'javelin-behavior-maniphest-batch-selector' => '7707de41', ··· 2942 2931 'javelin-behavior-maniphest-transaction-preview' => '7707de41', 2943 2932 'javelin-behavior-phabricator-autofocus' => '971b021e', 2944 2933 'javelin-behavior-phabricator-keyboard-shortcuts' => '971b021e', 2945 - 'javelin-behavior-phabricator-object-selector' => 'f4bbbd84', 2934 + 'javelin-behavior-phabricator-object-selector' => 'ffd90d51', 2946 2935 'javelin-behavior-phabricator-oncopy' => '971b021e', 2947 2936 'javelin-behavior-phabricator-tooltips' => '971b021e', 2948 2937 'javelin-behavior-phabricator-watch-anchor' => '971b021e', 2949 2938 'javelin-behavior-refresh-csrf' => '971b021e', 2950 - 'javelin-behavior-repository-crossreference' => 'f4bbbd84', 2939 + 'javelin-behavior-repository-crossreference' => 'ffd90d51', 2951 2940 'javelin-behavior-workflow' => '971b021e', 2952 2941 'javelin-dom' => '6fb20113', 2953 2942 'javelin-event' => '6fb20113', ··· 2968 2957 'javelin-workflow' => '971b021e', 2969 2958 'maniphest-task-summary-css' => '7839ae2d', 2970 2959 'maniphest-transaction-detail-css' => '7839ae2d', 2971 - 'phabricator-app-buttons-css' => 'abce9c99', 2960 + 'phabricator-app-buttons-css' => '84072344', 2972 2961 'phabricator-content-source-view-css' => '96bc37d6', 2973 - 'phabricator-core-buttons-css' => 'abce9c99', 2974 - 'phabricator-core-css' => 'abce9c99', 2975 - 'phabricator-directory-css' => 'abce9c99', 2976 - 'phabricator-drag-and-drop-file-upload' => 'f4bbbd84', 2962 + 'phabricator-core-buttons-css' => '84072344', 2963 + 'phabricator-core-css' => '84072344', 2964 + 'phabricator-directory-css' => '84072344', 2965 + 'phabricator-drag-and-drop-file-upload' => 'ffd90d51', 2977 2966 'phabricator-dropdown-menu' => '971b021e', 2978 - 'phabricator-flag-css' => 'abce9c99', 2979 - 'phabricator-jump-nav' => 'abce9c99', 2967 + 'phabricator-flag-css' => '84072344', 2968 + 'phabricator-jump-nav' => '84072344', 2980 2969 'phabricator-keyboard-shortcut' => '971b021e', 2981 2970 'phabricator-keyboard-shortcut-manager' => '971b021e', 2982 2971 'phabricator-menu-item' => '971b021e', ··· 2984 2973 'phabricator-paste-file-upload' => '971b021e', 2985 2974 'phabricator-prefab' => '971b021e', 2986 2975 'phabricator-project-tag-css' => '7839ae2d', 2987 - 'phabricator-remarkup-css' => 'abce9c99', 2988 - 'phabricator-shaped-request' => 'f4bbbd84', 2989 - 'phabricator-standard-page-view' => 'abce9c99', 2976 + 'phabricator-remarkup-css' => '84072344', 2977 + 'phabricator-shaped-request' => 'ffd90d51', 2978 + 'phabricator-standard-page-view' => '84072344', 2990 2979 'phabricator-tooltip' => '971b021e', 2991 - 'phabricator-transaction-view-css' => 'abce9c99', 2992 - 'syntax-highlighting-css' => 'abce9c99', 2980 + 'phabricator-transaction-view-css' => '84072344', 2981 + 'syntax-highlighting-css' => '84072344', 2993 2982 ), 2994 2983 ));
+1 -29
src/applications/uiexample/examples/JavelinUIExample.php
··· 30 30 $request = $this->getRequest(); 31 31 $user = $request->getUser(); 32 32 33 - // placeholder 34 - 35 - $placeholder_id = celerity_generate_unique_node_id(); 36 - 37 - Javelin::initBehavior( 38 - 'placeholder', 39 - array( 40 - 'id' => $placeholder_id, 41 - 'text' => 'This is a placeholder', 42 - )); 43 - 44 - $form = id(new AphrontFormView()) 45 - ->setUser($user) 46 - ->appendChild( 47 - id(new AphrontFormTextControl()) 48 - ->setLabel('Placeholder') 49 - ->setID($placeholder_id)) 50 - ->appendChild( 51 - id(new AphrontFormSubmitControl()) 52 - ->setValue('Submit')); 53 - 54 - $panel = new AphrontPanelView(); 55 - $panel->setHeader('A Form'); 56 - $panel->setWidth(AphrontPanelView::WIDTH_FORM); 57 - $panel->appendChild($form); 58 - 59 - 60 - 61 33 // toggle-class 62 34 63 35 $container_id = celerity_generate_unique_node_id(); ··· 105 77 ), 106 78 $button_red.$button_blue); 107 79 108 - return array($panel, $div); 80 + return array($div); 109 81 } 110 82 }
-8
webroot/rsrc/css/application/base/standard-page-view.css
··· 119 119 cursor: pointer; 120 120 121 121 } 122 - 123 - /** 124 - * Placeholder text added to inputs by the "placeholder" behavior. 125 - */ 126 - .jx-placeholder { 127 - color: #888888; 128 - } 129 -
-60
webroot/rsrc/js/application/core/behavior-placeholder.js
··· 1 - /** 2 - * @provides javelin-behavior-placeholder 3 - * @requires javelin-behavior 4 - * javelin-dom 5 - */ 6 - 7 - /** 8 - * Add placeholder text to an input. Config are: 9 - * 10 - * - `id` (Required) ID of the element to add placeholder text to. 11 - * - `text` (Required) Text to show. 12 - * 13 - * While the element is displaying placeholder text, the class `jx-placeholder` 14 - * is added to it. Normally, you use a lower-contrast color to indicate that 15 - * this text is instructional: 16 - * 17 - * .jx-placeholder { 18 - * color: #888888; 19 - * } 20 - * 21 - * @group ui 22 - */ 23 - JX.behavior('placeholder', function(config) { 24 - var input = JX.$(config.id); 25 - var placeholder_visible = false; 26 - 27 - function update(show_placeholder) { 28 - placeholder_visible = show_placeholder; 29 - JX.DOM.alterClass(input, 'jx-placeholder', placeholder_visible); 30 - } 31 - 32 - function onfocus() { 33 - if (placeholder_visible) { 34 - input.value = ''; 35 - update(false); 36 - } 37 - } 38 - 39 - function onblur() { 40 - if (!input.value) { 41 - input.value = config.text; 42 - update(true); 43 - } 44 - } 45 - 46 - JX.DOM.listen(input, 'focus', null, onfocus); 47 - JX.DOM.listen(input, 'blur', null, onblur); 48 - 49 - // When the user submits the form, remove the placeholder text (so it doesn't 50 - // get submitted to the server) and then restore it after the submit finishes. 51 - JX.DOM.listen(input.form, 'submit', null, function() { 52 - onfocus(); 53 - setTimeout(onblur, 0); 54 - }); 55 - 56 - // If the element isn't currently focused, show the placeholder text. 57 - if (document.activeElement != input) { 58 - onblur(); 59 - } 60 - });