Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894631
behavior-remarkup-preview.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
behavior-remarkup-preview.js
View Options
/**
* @provides javelin-behavior-remarkup-preview
* @requires javelin-behavior
* javelin-dom
* javelin-util
* phabricator-shaped-request
*/
JX
.
behavior
(
'remarkup-preview'
,
function
(
config
)
{
// Don't bother with any of this on mobile.
if
(
JX
.
Device
.
getDevice
()
!==
'desktop'
)
{
return
;
}
var
preview
=
JX
.
$
(
config
.
previewID
);
var
control
=
JX
.
$
(
config
.
controlID
);
var
callback
=
function
(
r
)
{
// This currently accepts responses from two controllers:
// Old: PhabricatorMarkupPreviewController
// New: PhabricatorApplicationTransactionRemarkupPreviewController
// TODO: Swap everything to just the new controller.
JX
.
DOM
.
setContent
(
preview
,
JX
.
$H
(
r
.
content
||
r
));
};
var
getdata
=
function
()
{
return
{
text
:
control
.
value
};
};
var
request
=
new
JX
.
PhabricatorShapedRequest
(
config
.
uri
,
callback
,
getdata
);
var
trigger
=
JX
.
bind
(
request
,
request
.
trigger
);
JX
.
DOM
.
listen
(
control
,
'keydown'
,
null
,
trigger
);
request
.
start
();
trigger
();
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 20:10 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128329
Default Alt Text
behavior-remarkup-preview.js (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment