Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102388157
JavelinUIExample.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 20, 04:34
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Feb 22, 04:34 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24267551
Attached To
rPH Phabricator
JavelinUIExample.php
View Options
<?php
final
class
JavelinUIExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
'Javelin UI'
;
}
public
function
getDescription
()
{
return
'Here are some Javelin UI elements that you could use.'
;
}
public
function
renderExample
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
// toggle-class
$container_id
=
celerity_generate_unique_node_id
();
$button_red_id
=
celerity_generate_unique_node_id
();
$button_blue_id
=
celerity_generate_unique_node_id
();
$button_red
=
javelin_tag
(
'a'
,
array
(
'class'
=>
'button'
,
'sigil'
=>
'jx-toggle-class'
,
'href'
=>
'#'
,
'id'
=>
$button_red_id
,
'meta'
=>
array
(
'map'
=>
array
(
$container_id
=>
'jxui-red-border'
,
$button_red_id
=>
'jxui-active'
,
),
),
),
'Toggle Red Border'
);
$button_blue
=
javelin_tag
(
'a'
,
array
(
'class'
=>
'button jxui-active'
,
'sigil'
=>
'jx-toggle-class'
,
'href'
=>
'#'
,
'id'
=>
$button_blue_id
,
'meta'
=>
array
(
'state'
=>
true
,
'map'
=>
array
(
$container_id
=>
'jxui-blue-background'
,
$button_blue_id
=>
'jxui-active'
,
),
),
),
'Toggle Blue Background'
);
$div
=
phutil_tag
(
'div'
,
array
(
'id'
=>
$container_id
,
'class'
=>
'jxui-example-container jxui-blue-background'
,
),
array
(
$button_red
,
$button_blue
));
return
array
(
$div
);
}
}
Event Timeline
Log In to Comment