1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00

Add javelin_tag(), convert easy callsites

Summary:
  - Implements `javelin_tag()`, which is `javelin_render_tag()` on top of `phutil_tag()` instead of `phutil_render_tag()`.
  - Manually converts all or almost all of the trivial callsites.

Test Plan:
  - Site does not seem any more broken than before.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D4639
This commit is contained in:
epriestley 2013-01-25 12:57:17 -08:00
parent 94da7c2033
commit 3093d1663d
66 changed files with 188 additions and 171 deletions

View file

@ -97,7 +97,7 @@ final class DarkConsoleCore {
$tabclass = null;
}
$tabs_markup[] = javelin_render_tag(
$tabs_markup[] = javelin_tag(
'a',
array(
'class' => "dark-console-tab {$tabclass}",
@ -173,7 +173,7 @@ final class DarkConsoleCore {
),
'<tr>'.
'<th class="dark-console-tabs">'.
javelin_render_tag(
phutil_tag(
'a',
array(
'class' => 'dark-console-tab dark-console-tab-selected',

View file

@ -291,7 +291,7 @@ final class AphrontCalendarMonthView extends AphrontView {
$href = null;
}
$text_div = javelin_render_tag(
$text_div = javelin_tag(
$tag,
array(
'sigil' => 'has-tooltip',
@ -302,9 +302,9 @@ final class AphrontCalendarMonthView extends AphrontView {
'class' => 'aphront-calendar-event-text',
'href' => $href,
),
phutil_escape_html(phutil_utf8_shorten($event->getName(), 32)));
phutil_utf8_shorten($event->getName(), 32));
return javelin_render_tag(
return javelin_tag(
'div',
array(
'class' => implode(' ', $classes),

View file

@ -163,29 +163,33 @@ final class ConpherenceViewController extends
array(
'class' => 'widgets-header'
),
javelin_render_tag(
array(
javelin_tag(
'a',
array(
'sigil' => 'conpherence-change-widget',
'meta' => array('widget' => 'widgets-files')
),
pht('Files')
).' | '.
javelin_render_tag(
),
' | ',
javelin_tag(
'a',
array(
'sigil' => 'conpherence-change-widget',
'meta' => array('widget' => 'widgets-tasks')
),
pht('Tasks')
).' | '.
javelin_render_tag(
),
' | ',
javelin_tag(
'a',
array(
'sigil' => 'conpherence-change-widget',
'meta' => array('widget' => 'widgets-calendar')
),
pht('Calendar')
),
)
).
phutil_render_tag(

View file

@ -36,7 +36,7 @@ final class PhabricatorCountdownListController
),
'Edit');
$delete_button = javelin_render_tag(
$delete_button = javelin_tag(
'a',
array(
'class' => 'small button grey',

View file

@ -47,13 +47,13 @@ final class PhabricatorCountdownViewController
<th>Seconds</th>
</tr>
<tr>'.
javelin_render_tag('td',
javelin_tag('td',
array('sigil' => 'phabricator-timer-days'), '').
javelin_render_tag('td',
javelin_tag('td',
array('sigil' => 'phabricator-timer-hours'), '').
javelin_render_tag('td',
javelin_tag('td',
array('sigil' => 'phabricator-timer-minutes'), '').
javelin_render_tag('td',
javelin_tag('td',
array('sigil' => 'phabricator-timer-seconds'), '').
'</tr>
</table>

View file

@ -146,7 +146,7 @@ final class DifferentialReviewersFieldSpecification
$names[] = phutil_escape_html(
$this->getHandle($reviewer)->getLinkName());
}
$suffix = ' '.javelin_render_tag(
$suffix = ' '.javelin_tag(
'abbr',
array(
'sigil' => 'has-tooltip',

View file

@ -321,7 +321,7 @@ abstract class DifferentialChangesetHTMLRenderer
$more = null;
if ($force !== 'none') {
$more = ' '.javelin_render_tag(
$more = ' '.javelin_tag(
'a',
array(
'mustcapture' => true,

View file

@ -16,7 +16,7 @@ final class DifferentialChangesetTwoUpRenderer
$context_not_available = null;
if ($hunk_starts) {
$context_not_available = javelin_render_tag(
$context_not_available = javelin_tag(
'tr',
array(
'sigil' => 'context-target',
@ -83,7 +83,7 @@ final class DifferentialChangesetTwoUpRenderer
$is_first_block = true;
}
$contents[] = javelin_render_tag(
$contents[] = javelin_tag(
'a',
array(
'href' => '#',
@ -99,7 +99,7 @@ final class DifferentialChangesetTwoUpRenderer
: pht("\xE2\x96\xB2 Show 20 Lines"));
}
$contents[] = javelin_render_tag(
$contents[] = javelin_tag(
'a',
array(
'href' => '#',
@ -119,7 +119,7 @@ final class DifferentialChangesetTwoUpRenderer
}
if ($len > 40) {
$contents[] = javelin_render_tag(
$contents[] = javelin_tag(
'a',
array(
'href' => '#',
@ -235,7 +235,7 @@ final class DifferentialChangesetTwoUpRenderer
dirname('/'.$orig_file);
}
$class = ($orig_type == '-' ? 'new-move' : 'new-copy');
$n_copy = javelin_render_tag(
$n_copy = javelin_tag(
'td',
array(
'meta' => array(

View file

@ -104,7 +104,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder {
),
$name);
$filetree[] = javelin_render_tag(
$filetree[] = javelin_tag(
$href ? 'a' : 'span',
array(
'href' => $href,
@ -112,7 +112,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder {
'title' => $title,
'class' => 'phabricator-filetree-item',
),
$icon.$name_element);
array($icon, $name_element));
}
$tree->destroy();

View file

@ -143,7 +143,7 @@ final class DifferentialChangesetListView extends AphrontView {
$load = 'Loading...';
$mapping[$uniq_id] = $ref;
} else {
$load = javelin_render_tag(
$load = javelin_tag(
'a',
array(
'href' => '#'.$uniq_id,
@ -155,7 +155,7 @@ final class DifferentialChangesetListView extends AphrontView {
'sigil' => 'differential-load',
'mustcapture' => true,
),
'Load');
pht('Load'));
}
$detail->appendChild(
phutil_tag(
@ -209,13 +209,13 @@ final class DifferentialChangesetListView extends AphrontView {
* Render the "Undo" markup for the inline comment undo feature.
*/
private function renderUndoTemplates() {
$link = javelin_render_tag(
$link = javelin_tag(
'a',
array(
'href' => '#',
'sigil' => 'differential-inline-comment-undo',
),
'Undo');
pht('Undo'));
$div = phutil_tag(
'div',
@ -302,7 +302,7 @@ final class DifferentialChangesetListView extends AphrontView {
'differential-dropdown-menus',
array());
return javelin_render_tag(
return javelin_tag(
'a',
array(
'class' => 'button small grey',
@ -311,7 +311,7 @@ final class DifferentialChangesetListView extends AphrontView {
'target' => '_blank',
'sigil' => 'differential-view-options',
),
"View Options \xE2\x96\xBC");
pht("View Options \xE2\x96\xBC"));
}
}

View file

@ -192,16 +192,14 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
}
}
$reveal_link =
javelin_render_tag(
$reveal_link = javelin_tag(
'a',
array(
'sigil' => 'differential-reveal-all',
'mustcapture' => true,
'class' => 'button differential-toc-reveal-all',
),
pht('Show All Context')
);
pht('Show All Context'));
$buttons =
'<tr><td colspan="7">'.
@ -256,7 +254,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
private function renderChangesetLink(DifferentialChangeset $changeset, $ref) {
$display_file = $changeset->getDisplayFilename();
return javelin_render_tag(
return javelin_tag(
'a',
array(
'href' => '#'.$changeset->getAnchorName(),
@ -266,7 +264,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
),
'sigil' => 'differential-load',
),
phutil_escape_html($display_file));
$display_file);
}
}

View file

@ -94,7 +94,7 @@ final class DifferentialInlineCommentEditView extends AphrontView {
$buttons = array();
$buttons[] = '<button>Ready</button>';
$buttons[] = javelin_render_tag(
$buttons[] = javelin_tag(
'button',
array(
'sigil' => 'inline-edit-cancel',

View file

@ -95,7 +95,7 @@ final class DifferentialInlineCommentView extends AphrontView {
}
if (!$this->preview) {
$links[] = javelin_render_tag(
$links[] = javelin_tag(
'a',
array(
'href' => '#',
@ -104,7 +104,7 @@ final class DifferentialInlineCommentView extends AphrontView {
),
pht('Previous'));
$links[] = javelin_render_tag(
$links[] = javelin_tag(
'a',
array(
'href' => '#',
@ -122,7 +122,7 @@ final class DifferentialInlineCommentView extends AphrontView {
// file/line information, and synthetic comments don't have an inline
// comment ID.
$links[] = javelin_render_tag(
$links[] = javelin_tag(
'a',
array(
'href' => '#',
@ -138,7 +138,7 @@ final class DifferentialInlineCommentView extends AphrontView {
$anchor_name = 'inline-'.$inline->getID();
if ($this->editable && !$this->preview) {
$links[] = javelin_render_tag(
$links[] = javelin_tag(
'a',
array(
'href' => '#',
@ -146,7 +146,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'sigil' => 'differential-inline-edit',
),
pht('Edit'));
$links[] = javelin_render_tag(
$links[] = javelin_tag(
'a',
array(
'href' => '#',
@ -155,7 +155,7 @@ final class DifferentialInlineCommentView extends AphrontView {
),
pht('Delete'));
} else if ($this->preview) {
$links[] = javelin_render_tag(
$links[] = javelin_tag(
'a',
array(
'meta' => array(
@ -164,7 +164,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'sigil' => 'differential-inline-preview-jump',
),
pht('Not Visible'));
$links[] = javelin_render_tag(
$links[] = javelin_tag(
'a',
array(
'href' => '#',

View file

@ -166,7 +166,7 @@ final class DifferentialRevisionCommentListView extends AphrontView {
),
'<div class="differential-older-comments-are-hidden">'.
pht('%d older comments are hidden. ', number_format(count($hidden))).
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => '#',

View file

@ -111,7 +111,7 @@ final class DifferentialRevisionListView extends AphrontView {
if (isset($flagged[$phid])) {
$class = PhabricatorFlagColor::getCSSClass($flagged[$phid]->getColor());
$note = $flagged[$phid]->getNote();
$flag = javelin_render_tag(
$flag = javelin_tag(
'div',
$note ? array(
'class' => 'phabricator-flag-icon '.$class,

View file

@ -72,7 +72,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
if ($id) {
$new_checked = ($this->selectedDiffID == $id);
$new = javelin_render_tag(
$new = javelin_tag(
'input',
array(
'type' => 'radio',

View file

@ -605,7 +605,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
Javelin::initBehavior('phabricator-tooltips', array());
require_celerity_resource('aphront-tooltip-css');
$commit_link = javelin_render_tag(
$commit_link = javelin_tag(
'a',
array(
'href' => $drequest->generateURI(
@ -620,7 +620,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
'size' => 600,
),
),
phutil_escape_html(phutil_utf8_shorten($line['commit'], 9, '')));
phutil_utf8_shorten($line['commit'], 9, ''));
$revision_id = null;
if (idx($commits, $commit)) {
@ -637,7 +637,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
" \xC2\xB7 ".
$revision->getTitle();
}
$revision_link = javelin_render_tag(
$revision_link = javelin_tag(
'a',
array(
'href' => '/D'.$revision_id,
@ -652,7 +652,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
}
$uri = $line_href->alter('before', $commit);
$before_link = javelin_render_tag(
$before_link = javelin_tag(
'a',
array(
'href' => $uri->setQueryParam('view', 'blame'),
@ -706,7 +706,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
),
$line['line']);
$blame[] = javelin_render_tag(
$blame[] = javelin_tag(
'th',
array(
'class' => 'diffusion-line-link',

View file

@ -62,14 +62,14 @@ final class DiffusionCommitEditController extends DiffusionController {
->setValue($proj_t_values)
->setID($tokenizer_id)
->setCaption(
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => '/project/create/',
'mustcapture' => true,
'sigil' => 'project-create',
),
'Create New Project'))
pht('Create New Project')))
->setDatasource('/typeahead/common/projects/'));;
Javelin::initBehavior('project-create', array(

View file

@ -39,7 +39,7 @@ final class DiffusionCommitChangeTableView extends DiffusionView {
}
if (isset($this->renderingReferences[$id])) {
$path_column = javelin_render_tag(
$path_column = javelin_tag(
'a',
array(
'href' => '#'.$hash,
@ -49,7 +49,7 @@ final class DiffusionCommitChangeTableView extends DiffusionView {
),
'sigil' => 'differential-load',
),
phutil_escape_html($path));
$path);
} else {
$path_column = phutil_escape_html($path);
}

View file

@ -312,7 +312,7 @@ final class DiffusionHistoryTableView extends DiffusionView {
// Render into tags for the behavior.
foreach ($graph as $k => $meta) {
$graph[$k] = javelin_render_tag(
$graph[$k] = javelin_tag(
'div',
array(
'sigil' => 'commit-graph',

View file

@ -144,7 +144,7 @@ abstract class DiffusionView extends AphrontView {
if ($email->getDisplayName() && $email->getDomainName()) {
Javelin::initBehavior('phabricator-tooltips', array());
require_celerity_resource('aphront-tooltip-css');
return javelin_render_tag(
return javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',
@ -154,7 +154,7 @@ abstract class DiffusionView extends AphrontView {
'size' => 'auto',
),
),
phutil_escape_html($email->getDisplayName()));
$email->getDisplayName());
}
return phutil_escape_html($name);
}

View file

@ -100,7 +100,7 @@ final class HeraldRuleController extends HeraldController {
->appendChild(
// Build this explicitly (instead of using addHiddenInput())
// so we can add a sigil to it.
javelin_render_tag(
javelin_tag(
'input',
array(
'type' => 'hidden',
@ -123,7 +123,7 @@ final class HeraldRuleController extends HeraldController {
->appendChild(
id(new AphrontFormInsetView())
->setTitle('Conditions')
->setRightButton(javelin_render_tag(
->setRightButton(javelin_tag(
'a',
array(
'href' => '#',
@ -135,7 +135,7 @@ final class HeraldRuleController extends HeraldController {
->setDescription(
'When '.$must_match_selector .
' these conditions are met:')
->setContent(javelin_render_tag(
->setContent(javelin_tag(
'table',
array(
'sigil' => 'rule-conditions',
@ -145,7 +145,7 @@ final class HeraldRuleController extends HeraldController {
->appendChild(
id(new AphrontFormInsetView())
->setTitle('Action')
->setRightButton(javelin_render_tag(
->setRightButton(javelin_tag(
'a',
array(
'href' => '#',
@ -156,7 +156,7 @@ final class HeraldRuleController extends HeraldController {
'Create New Action'))
->setDescription('Take these actions '.$repetition_selector.
' this rule matches:')
->setContent(javelin_render_tag(
->setContent(javelin_tag(
'table',
array(
'sigil' => 'rule-actions',

View file

@ -58,7 +58,7 @@ final class HeraldRuleListView extends AphrontView {
),
'View Edit Log');
$delete = javelin_render_tag(
$delete = javelin_tag(
'a',
array(
'href' => '/herald/delete/'.$rule->getID().'/',

View file

@ -101,7 +101,7 @@ final class ManiphestBatchEditController extends ManiphestController {
$form->appendChild(
id(new AphrontFormInsetView())
->setTitle('Actions')
->setRightButton(javelin_render_tag(
->setRightButton(javelin_tag(
'a',
array(
'href' => '#',
@ -110,7 +110,7 @@ final class ManiphestBatchEditController extends ManiphestController {
'mustcapture' => true,
),
'Add Another Action'))
->setContent(javelin_render_tag(
->setContent(javelin_tag(
'table',
array(
'sigil' => 'maniphest-batch-actions',

View file

@ -574,7 +574,7 @@ final class ManiphestReportController extends ManiphestController {
}
$cname[] = 'Total';
$cclass[] = 'n';
$cname[] = javelin_render_tag(
$cname[] = javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',
@ -585,7 +585,7 @@ final class ManiphestReportController extends ManiphestController {
),
'Oldest (All)');
$cclass[] = 'n';
$cname[] = javelin_render_tag(
$cname[] = javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',
@ -599,7 +599,7 @@ final class ManiphestReportController extends ManiphestController {
$cclass[] = 'n';
list($ignored, $window_epoch) = $this->getWindow();
$cname[] = javelin_render_tag(
$cname[] = javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',
@ -745,7 +745,7 @@ final class ManiphestReportController extends ManiphestController {
$raw_age = (time() - $oldest->getDateCreated());
$age = number_format($raw_age / (24 * 60 * 60)).' d';
$link = javelin_render_tag(
$link = javelin_tag(
'a',
array(
'href' => '/T'.$oldest->getID(),
@ -755,7 +755,7 @@ final class ManiphestReportController extends ManiphestController {
),
'target' => '_blank',
),
phutil_escape_html($age));
$age);
return array($link, $raw_age);
}

View file

@ -61,7 +61,7 @@ final class ManiphestSavedQueryListController extends ManiphestController {
'class' => 'grey small button',
),
'Edit'),
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => '/maniphest/custom/delete/'.$query->getID().'/',

View file

@ -425,7 +425,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->setValue($projects_value)
->setID($project_tokenizer_id)
->setCaption(
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => '/project/create/',

View file

@ -641,7 +641,7 @@ final class ManiphestTaskListController extends ManiphestController {
'status' => 'batch-select-status-cell',
));
$select_all = javelin_render_tag(
$select_all = javelin_tag(
'a',
array(
'href' => '#',
@ -651,7 +651,7 @@ final class ManiphestTaskListController extends ManiphestController {
),
'Select All');
$select_none = javelin_render_tag(
$select_none = javelin_tag(
'a',
array(
'href' => '#',
@ -670,7 +670,7 @@ final class ManiphestTaskListController extends ManiphestController {
),
"Batch Edit Selected Tasks \xC2\xBB");
$export = javelin_render_tag(
$export = javelin_tag(
'a',
array(
'href' => '/maniphest/export/'.$search_query->getQueryKey().'/',

View file

@ -39,7 +39,7 @@ final class ManiphestTaskProjectsView extends ManiphestView {
$all[] = $handle->getName();
}
$tags[] = javelin_render_tag(
$tags[] = javelin_tag(
'span',
array(
'class' => 'phabricator-project-tag',

View file

@ -62,15 +62,14 @@ final class ManiphestTaskSummaryView extends ManiphestView {
if ($this->showBatchControls) {
$batch =
'<td class="maniphest-task-batch">'.
javelin_render_tag(
javelin_tag(
'input',
array(
'type' => 'checkbox',
'name' => 'batch[]',
'value' => $task->getID(),
'sigil' => 'maniphest-batch',
),
null).
)).
'</td>';
}
@ -87,7 +86,7 @@ final class ManiphestTaskSummaryView extends ManiphestView {
$control_sigil = 'maniphest-task-handle';
}
$handle = javelin_render_tag(
$handle = javelin_tag(
'td',
array(
'class' => 'maniphest-task-handle '.$pri_class.' '.$control_class,

View file

@ -590,7 +590,7 @@ final class ManiphestTransactionDetailView extends ManiphestView {
Javelin::initBehavior('maniphest-transaction-expand');
return javelin_render_tag(
return javelin_tag(
'a',
array(
'href' => '/maniphest/task/descriptionchange/'.$id.'/',

View file

@ -61,7 +61,7 @@ final class PhabricatorNotificationListController
$panel->setHeader($header);
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
$panel->addButton(
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => '/notification/clear/',

View file

@ -120,7 +120,7 @@ final class PhabricatorOwnersDetailController
$panel->setHeader(
'Package Details for "'.phutil_escape_html($package->getName()).'"');
$panel->addButton(
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => '/owners/delete/'.$package->getID().'/',

View file

@ -218,7 +218,7 @@ final class PhabricatorOwnersEditController
id(new AphrontFormInsetView())
->setTitle('Paths')
->addDivAttributes(array('id' => 'path-editor'))
->setRightButton(javelin_render_tag(
->setRightButton(javelin_tag(
'a',
array(
'href' => '#',
@ -229,7 +229,7 @@ final class PhabricatorOwnersEditController
'Add New Path'))
->setDescription('Specify the files and directories which comprise '.
'this package.')
->setContent(javelin_render_tag(
->setContent(javelin_tag(
'table',
array(
'class' => 'owners-path-editor-table',

View file

@ -51,7 +51,7 @@ final class PhortuneStripePaymentFormView extends AphrontView {
id(new AphrontFormMarkupControl())
->setLabel('')
->setValue(
javelin_render_tag(
javelin_tag(
'div',
array(
'class' => 'credit-card-logos',
@ -86,7 +86,7 @@ final class PhortuneStripePaymentFormView extends AphrontView {
->setError($this->getCardExpirationError())
)
->appendChild(
javelin_render_tag(
javelin_tag(
'input',
array(
'hidden' => true,
@ -96,7 +96,7 @@ final class PhortuneStripePaymentFormView extends AphrontView {
)
)
->appendChild(
javelin_render_tag(
javelin_tag(
'input',
array(
'hidden' => true,

View file

@ -35,7 +35,7 @@ final class PonderVotableView extends AphrontView {
$uri = id(new PhutilURI($this->uri))->alter('phid', $this->phid);
$up = javelin_render_tag(
$up = javelin_tag(
'a',
array(
'href' => (string)$uri,
@ -45,7 +45,7 @@ final class PonderVotableView extends AphrontView {
),
"\xE2\x96\xB2");
$down = javelin_render_tag(
$down = javelin_tag(
'a',
array(
'href' => (string)$uri,
@ -55,13 +55,13 @@ final class PonderVotableView extends AphrontView {
),
"\xE2\x96\xBC");
$count = javelin_render_tag(
$count = javelin_tag(
'div',
array(
'class' => 'ponder-vote-count',
'sigil' => 'ponder-vote-count',
),
phutil_escape_html($this->count));
$this->count);
return javelin_render_tag(
'div',

View file

@ -142,7 +142,7 @@ final class PhabricatorProjectMembersEditController
),
'');
$button = javelin_render_tag(
$button = javelin_tag(
'button',
array(
'class' => 'grey',

View file

@ -98,7 +98,7 @@ final class PhabricatorProjectProfileController
),
'Join Project'));
} else {
$action = javelin_render_tag(
$action = javelin_tag(
'a',
array(
'href' => '/project/update/'.$project->getID().'/leave/',

View file

@ -43,7 +43,7 @@ final class PhabricatorRepositoryListController
'href' => '/repository/edit/'.$repo->getID().'/',
),
'Edit'),
javelin_render_tag(
javelin_tag(
'a',
array(
'class' => 'button small grey',

View file

@ -52,7 +52,7 @@ final class PhabricatorSettingsPanelEmailAddresses
$rows = array();
foreach ($emails as $email) {
$button_verify = javelin_render_tag(
$button_verify = javelin_tag(
'a',
array(
'class' => 'button small grey',
@ -61,7 +61,7 @@ final class PhabricatorSettingsPanelEmailAddresses
),
'Verify');
$button_make_primary = javelin_render_tag(
$button_make_primary = javelin_tag(
'a',
array(
'class' => 'button small grey',
@ -70,7 +70,7 @@ final class PhabricatorSettingsPanelEmailAddresses
),
'Make Primary');
$button_remove = javelin_render_tag(
$button_remove = javelin_tag(
'a',
array(
'class' => 'button small grey',
@ -133,7 +133,7 @@ final class PhabricatorSettingsPanelEmailAddresses
$view = new AphrontPanelView();
if ($editable) {
$view->addButton(
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => $uri->alter('new', 'true'),

View file

@ -186,7 +186,7 @@ final class PhabricatorSettingsPanelSSHKeys
phutil_escape_html($key->getKeyType()),
phabricator_date($key->getDateCreated(), $user),
phabricator_time($key->getDateCreated(), $user),
javelin_render_tag(
javelin_tag(
'a',
array(
'href' => $this->getPanelURI('?delete='.$key->getID()),

View file

@ -20,7 +20,7 @@ final class JavelinUIExample extends PhabricatorUIExample {
$button_red_id = celerity_generate_unique_node_id();
$button_blue_id = celerity_generate_unique_node_id();
$button_red = javelin_render_tag(
$button_red = javelin_tag(
'a',
array(
'class' => 'button',
@ -36,7 +36,7 @@ final class JavelinUIExample extends PhabricatorUIExample {
),
'Toggle Red Border');
$button_blue = javelin_render_tag(
$button_blue = javelin_tag(
'a',
array(
'class' => 'button jxui-active',

View file

@ -15,7 +15,7 @@ final class PhabricatorUINotificationExample extends PhabricatorUIExample {
require_celerity_resource('phabricator-notification-css');
Javelin::initBehavior('phabricator-notification-example');
$content = javelin_render_tag(
$content = javelin_tag(
'a',
array(
'sigil' => 'notification-example',

View file

@ -89,14 +89,14 @@ EOTEXT;
$content = array();
foreach ($metas as $key => $meta) {
$content[] = javelin_render_tag(
$content[] = javelin_tag(
'div',
array(
'sigil' => 'has-tooltip',
'meta' => $meta,
'style' => $style,
),
phutil_escape_html($key));
$key);
}
return $content;

View file

@ -84,7 +84,7 @@ final class PhabricatorXHProfProfileTopLevelView
array(
'Symbol',
'Count',
javelin_render_tag(
javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',
@ -97,7 +97,7 @@ final class PhabricatorXHProfProfileTopLevelView
),
'Wall Time (Inclusive)'),
'%',
javelin_render_tag(
javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',

View file

@ -234,14 +234,14 @@ abstract class PhabricatorInlineCommentController
}
private function renderTextArea($text) {
return javelin_render_tag(
return javelin_tag(
'textarea',
array(
'class' => 'differential-inline-comment-edit-textarea',
'sigil' => 'differential-inline-comment-edit-textarea',
'name' => 'text',
),
phutil_escape_html($text));
$text);
}
}

View file

@ -5,6 +5,19 @@ function javelin_render_tag(
array $attributes = array(),
$content = null) {
if (is_array($content)) {
$content = implode('', $content);
}
$html = javelin_tag($tag, $attributes, phutil_safe_html($content));
return $html->getHTMLContent();
}
function javelin_tag(
$tag,
array $attributes = array(),
$content = null) {
if (isset($attributes['sigil']) ||
isset($attributes['meta']) ||
isset($attributes['mustcapture'])) {
@ -32,10 +45,9 @@ function javelin_render_tag(
}
}
return phutil_render_tag($tag, $attributes, $content);
return phutil_tag($tag, $attributes, $content);
}
function phabricator_render_form(PhabricatorUser $user, $attributes, $content) {
if (strcasecmp(idx($attributes, 'method'), 'POST') == 0 &&
!preg_match('#^(https?:|//)#', idx($attributes, 'action'))) {

View file

@ -52,13 +52,13 @@ final class PhabricatorRemarkupRuleCountdown extends PhutilRemarkupRule {
'id' => $id,
),
array(
javelin_render_tag('span',
javelin_tag('span',
array('sigil' => 'phabricator-timer-days'), '').'d',
javelin_render_tag('span',
javelin_tag('span',
array('sigil' => 'phabricator-timer-hours'), '').'h',
javelin_render_tag('span',
javelin_tag('span',
array('sigil' => 'phabricator-timer-minutes'), '').'m',
javelin_render_tag('span',
javelin_tag('span',
array('sigil' => 'phabricator-timer-seconds'), '').'s',
));
Javelin::initBehavior('countdown-timer', array(

View file

@ -110,7 +110,7 @@ final class PhabricatorRemarkupRuleEmbedFile
require_celerity_resource('lightbox-attachment-css');
$img = phutil_tag('img', $data['attrs']);
$embed = javelin_render_tag(
$embed = javelin_tag(
'a',
array(
'href' => $meta['uri'],

View file

@ -79,17 +79,17 @@ final class AphrontDialogView extends AphrontView {
$buttons = array();
if ($this->submitButton) {
$buttons[] = javelin_render_tag(
$buttons[] = javelin_tag(
'button',
array(
'name' => '__submit__',
'sigil' => '__default__',
),
phutil_escape_html($this->submitButton));
$this->submitButton);
}
if ($this->cancelURI) {
$buttons[] = javelin_render_tag(
$buttons[] = javelin_tag(
'a',
array(
'href' => $this->cancelURI,
@ -97,7 +97,7 @@ final class AphrontDialogView extends AphrontView {
'name' => '__cancel__',
'sigil' => 'jx-workflow-button',
),
phutil_escape_html($this->cancelText));
$this->cancelText);
}
$buttons = implode('', $buttons);
@ -133,7 +133,7 @@ final class AphrontDialogView extends AphrontView {
$hidden_inputs = array();
foreach ($this->hidden as $desc) {
list($key, $value) = $desc;
$hidden_inputs[] = javelin_render_tag(
$hidden_inputs[] = javelin_tag(
'input',
array(
'type' => 'hidden',

View file

@ -32,7 +32,7 @@ final class AphrontAttachedFileView extends AphrontView {
$file->getName());
$size = number_format($file->getByteSize()).' bytes';
$remove = javelin_render_tag(
$remove = javelin_tag(
'a',
array(
'class' => 'button grey',

View file

@ -41,7 +41,7 @@ final class AphrontTokenizerTemplateView extends AphrontView {
$tokens[] = $this->renderToken($key, $value);
}
$input = javelin_render_tag(
$input = javelin_tag(
'input',
array(
'mustcapture' => true,

View file

@ -41,7 +41,7 @@ final class AphrontTypeaheadTemplateView extends AphrontView {
$tokens[] = $this->renderToken($key, $value);
}
$input = javelin_render_tag(
$input = javelin_tag(
'input',
array(
'name' => $name,
@ -52,14 +52,16 @@ final class AphrontTypeaheadTemplateView extends AphrontView {
'autocomplete' => 'off',
));
return javelin_render_tag(
return javelin_tag(
'div',
array(
'id' => $id,
'sigil' => 'typeahead-hardpoint',
'class' => 'jx-typeahead-hardpoint',
),
$input.
'<div style="clear: both;"></div>');
array(
$input,
phutil_tag('div', array('style' => 'clear: both'), ''),
));
}
}

View file

@ -225,7 +225,7 @@ final class AphrontFormDateControl extends AphrontFormControl {
'sigil' => 'year-input',
));
$cal_icon = javelin_render_tag(
$cal_icon = javelin_tag(
'a',
array(
'href' => '#',

View file

@ -25,7 +25,7 @@ final class AphrontFormTextControl extends AphrontFormControl {
}
protected function renderInput() {
return javelin_render_tag(
return javelin_tag(
'input',
array(
'type' => 'text',

View file

@ -99,7 +99,7 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
require_celerity_resource('sprite-icon-css');
$buttons[] = javelin_render_tag(
$buttons[] = javelin_tag(
'a',
array(
'class' => implode(' ', $classes),

View file

@ -32,7 +32,7 @@ final class AphrontMoreView extends AphrontView {
$link = null;
if ($this->more && $this->more != $this->some) {
Javelin::initBehavior('aphront-more');
$link = ' '.javelin_render_tag(
$link = ' '.javelin_tag(
'a',
array(
'sigil' => 'aphront-more-view-show-more',

View file

@ -66,12 +66,12 @@ final class PhabricatorActionView extends AphrontView {
'Call setUser() when rendering an action as a form.');
}
$item = javelin_render_tag(
$item = javelin_tag(
'button',
array(
'class' => 'phabricator-action-view-item',
),
phutil_escape_html($this->name));
$this->name);
$item = phabricator_render_form(
$this->user,
@ -82,14 +82,14 @@ final class PhabricatorActionView extends AphrontView {
),
$item);
} else {
$item = javelin_render_tag(
$item = javelin_tag(
'a',
array(
'href' => $this->href,
'class' => 'phabricator-action-view-item',
'sigil' => $this->workflow ? 'workflow' : null,
),
phutil_escape_html($this->name));
$this->name);
}
} else {
$item = phutil_tag(

View file

@ -18,7 +18,7 @@ final class PhabricatorAnchorView extends AphrontView {
public function render() {
$marker = null;
if ($this->navigationMarker) {
$marker = javelin_render_tag(
$marker = javelin_tag(
'legend',
array(
'class' => 'phabricator-anchor-navigation-marker',

View file

@ -37,14 +37,17 @@ final class PhabricatorCrumbsView extends AphrontView {
),
'');
}
$actions[] = javelin_render_tag(
$actions[] = javelin_tag(
'a',
array(
'href' => $action->getHref(),
'class' => 'phabricator-crumbs-action',
'sigil' => $action->getWorkflow() ? 'workflow' : null,
),
$icon.phutil_escape_html($action->getName()));
array(
$icon,
$action->getName(),
));
}
$action_view = phutil_render_tag(

View file

@ -67,7 +67,7 @@ final class PhabricatorFileLinkView extends AphrontView {
);
}
return javelin_render_tag(
return javelin_tag(
'a',
array(
'href' => $this->getFileViewURI(),
@ -76,7 +76,6 @@ final class PhabricatorFileLinkView extends AphrontView {
'meta' => $meta,
'mustcapture' => $mustcapture,
),
phutil_escape_html($this->getFileName())
);
$this->getFileName());
}
}

View file

@ -235,7 +235,7 @@ final class PhabricatorTimelineEventView extends AphrontView {
if ($this->getIsEdited()) {
$extra[] = javelin_render_tag(
$extra[] = javelin_tag(
'a',
array(
'href' => '/transactions/history/'.$xaction_phid.'/',
@ -245,7 +245,7 @@ final class PhabricatorTimelineEventView extends AphrontView {
}
if ($this->getIsEditable()) {
$extra[] = javelin_render_tag(
$extra[] = javelin_tag(
'a',
array(
'href' => '/transactions/edit/'.$xaction_phid.'/',

View file

@ -64,10 +64,10 @@ final class AphrontHeadsupActionView extends AphrontView {
$attrs['sigil'] = 'workflow';
}
return javelin_render_tag(
return javelin_tag(
$tag,
$attrs,
phutil_escape_html($this->name));
$this->name);
}
}

View file

@ -65,15 +65,15 @@ final class PhabricatorMainMenuIconView extends AphrontView {
$classes = $this->classes;
$classes[] = 'phabricator-main-menu-icon';
$label = javelin_render_tag(
$label = javelin_tag(
'a',
array(
'href' => $href,
'class' => 'phabricator-main-menu-icon-label',
),
phutil_escape_html($name));
$name);
$item = javelin_render_tag(
$item = javelin_tag(
'a',
array(
'href' => $href,

View file

@ -34,7 +34,7 @@ final class PhabricatorMainMenuSearchView extends AphrontView {
$scope = $this->scope;
$target = javelin_render_tag(
$target = javelin_tag(
'div',
array(
'id' => $target_id,

View file

@ -118,7 +118,7 @@ final class PhabricatorMainMenuView extends AphrontView {
}
private function renderPhabricatorMenuButton($header_id) {
return javelin_render_tag(
return javelin_tag(
'a',
array(
'class' => 'phabricator-main-menu-expand-button '.
@ -139,7 +139,7 @@ final class PhabricatorMainMenuView extends AphrontView {
}
public function renderApplicationMenuButton($header_id) {
return javelin_render_tag(
return javelin_tag(
'a',
array(
'class' => 'phabricator-main-menu-expand-button '.
@ -344,7 +344,7 @@ final class PhabricatorMainMenuView extends AphrontView {
'dropdownID' => $dropdown_id,
));
$notification_dropdown = javelin_render_tag(
$notification_dropdown = javelin_tag(
'div',
array(
'id' => $dropdown_id,