Make countdowns (internally) embeddable

Summary:
You can now embed countdowns in Remarkup! Not sure what it's
useful for, but there you have it.

Also I may have made a hash of the markup code; I don't really know what
I'm doing.

Test Plan: Make a new countdown, put `{C###}` in a Differential comment.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1053

Differential Revision: https://secure.phabricator.com/D3290
This commit is contained in:
Alan Huang
2012-08-14 19:19:23 -07:00
parent d45855e33e
commit f736ca047a
6 changed files with 126 additions and 31 deletions

View File

@@ -47,8 +47,9 @@ final class PhabricatorCountdownViewController
),
$chrome_visible ? 'Disable Chrome' : 'Enable Chrome');
$container = celerity_generate_unique_node_id();
$content =
'<div class="phabricator-timer">
'<div class="phabricator-timer" id="'.$container.'">
<h1 class="phabricator-timer-header">'.
phutil_escape_html($timer->getTitle()).' &middot; '.
phabricator_datetime($timer->getDatePoint(), $user).
@@ -61,18 +62,24 @@ final class PhabricatorCountdownViewController
<th>Minutes</th>
<th>Seconds</th>
</tr>
<tr>
<td id="phabricator-timer-days"></td>
<td id="phabricator-timer-hours"></td>
<td id="phabricator-timer-minutes"></td>
<td id="phabricator-timer-seconds"></td>
<tr>'.
javelin_render_tag('td',
array('sigil' => 'phabricator-timer-days'), '').
javelin_render_tag('td',
array('sigil' => 'phabricator-timer-hours'), '').
javelin_render_tag('td',
array('sigil' => 'phabricator-timer-minutes'), '').
javelin_render_tag('td',
array('sigil' => 'phabricator-timer-seconds'), '').
'</tr>
</table>
</div>'.
$chrome_link.
'</div>';
Javelin::initBehavior('countdown-timer', array(
'timestamp' => $timer->getDatepoint()
'timestamp' => $timer->getDatepoint(),
'container' => $container,
));
$panel = $content;