Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1223269
behavior-participants-pane.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
behavior-participants-pane.js
View Options
/**
* @requires javelin-behavior
* javelin-dom
* javelin-stratcom
* javelin-workflow
* javelin-util
* phabricator-notification
* conpherence-thread-manager
* @provides javelin-behavior-conpherence-participants-pane
*/
JX
.
behavior
(
'conpherence-participants-pane'
,
function
()
{
/**
* Generified adding new stuff to widgets technology!
*/
JX
.
Stratcom
.
listen
(
[
'click'
],
'conpherence-widget-adder'
,
function
(
e
)
{
e
.
kill
();
var
threadManager
=
JX
.
ConpherenceThreadManager
.
getInstance
();
var
href
=
threadManager
.
_getUpdateURI
();
var
latest_transaction_id
=
threadManager
.
getLatestTransactionID
();
var
data
=
{
latest_transaction_id
:
latest_transaction_id
,
action
:
'add_person'
};
var
workflow
=
new
JX
.
Workflow
(
href
,
data
)
.
setHandler
(
function
(
r
)
{
var
threadManager
=
JX
.
ConpherenceThreadManager
.
getInstance
();
threadManager
.
setLatestTransactionID
(
r
.
latest_transaction_id
);
var
root
=
JX
.
DOM
.
find
(
document
,
'div'
,
'conpherence-layout'
);
var
messages
=
null
;
try
{
messages
=
JX
.
DOM
.
find
(
root
,
'div'
,
'conpherence-messages'
);
}
catch
(
ex
)
{
}
if
(
messages
)
{
JX
.
DOM
.
appendContent
(
messages
,
JX
.
$H
(
r
.
transactions
));
JX
.
Stratcom
.
invoke
(
'conpherence-redraw-thread'
,
null
,
{});
}
try
{
var
people_root
=
JX
.
DOM
.
find
(
root
,
'div'
,
'widgets-people'
);
// update the people widget
JX
.
DOM
.
setContent
(
people_root
,
JX
.
$H
(
r
.
people_widget
));
}
catch
(
ex
)
{
}
});
threadManager
.
syncWorkflow
(
workflow
,
'submit'
);
}
);
JX
.
Stratcom
.
listen
(
[
'touchstart'
,
'mousedown'
],
'remove-person'
,
function
(
e
)
{
var
threadManager
=
JX
.
ConpherenceThreadManager
.
getInstance
();
var
href
=
threadManager
.
_getUpdateURI
();
var
data
=
e
.
getNodeData
(
'remove-person'
);
// While the user is removing themselves, disable the notification
// update behavior. If we don't do this, the user can get an error
// when they remove themselves about permissions as the notification
// code tries to load what jist happened.
var
loadedPhid
=
threadManager
.
getLoadedThreadPHID
();
threadManager
.
setLoadedThreadPHID
(
null
);
new
JX
.
Workflow
(
href
,
data
)
.
setCloseHandler
(
function
()
{
threadManager
.
setLoadedThreadPHID
(
loadedPhid
);
})
// we re-direct to conpherence home so the thread manager will
// fix itself there
.
setHandler
(
function
(
r
)
{
JX
.
$U
(
r
.
href
).
go
();
})
.
start
();
}
);
/* settings widget */
var
onsubmitSettings
=
function
(
e
)
{
e
.
kill
();
var
form
=
e
.
getNode
(
'tag:form'
);
var
button
=
JX
.
DOM
.
find
(
form
,
'button'
);
JX
.
Workflow
.
newFromForm
(
form
)
.
setHandler
(
JX
.
bind
(
this
,
function
(
r
)
{
new
JX
.
Notification
()
.
setDuration
(
6000
)
.
setContent
(
r
)
.
show
();
button
.
disabled
=
''
;
JX
.
DOM
.
alterClass
(
button
,
'disabled'
,
false
);
}))
.
start
();
};
JX
.
Stratcom
.
listen
(
[
'submit'
,
'didSyntheticSubmit'
],
'notifications-update'
,
onsubmitSettings
);
});
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Thu, Jul 3, 9:11 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
298433
Default Alt Text
behavior-participants-pane.js (3 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment