2011-06-24 21:21:48 +02:00
|
|
|
/**
|
|
|
|
* @provides javelin-behavior-differential-add-reviewers-and-ccs
|
|
|
|
* @requires javelin-behavior
|
|
|
|
* javelin-dom
|
Use Javelin placeholders and new sorting rules broadly; consolidate tokenizer construction code
Summary:
- We have three nearly-identical blocks of Tokenizer construction code; consolidate them into Prefab.
- Add placeholder support.
- Augment server-side stuff to specify placeholder text.
Test Plan: Verified behavior of Differential edit tokenizers, Differential comment tokenizers, Maniphest edit tokenizers, Maniphest comment tokenizers, Maniphest filter tokenizers, Differential filter tokenizers, Owners filter tokenizers, Owners edit tokenizers, Herald edit tokenizers, Audit filter tokenizers.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran, epriestley
Maniphest Tasks: T772, T946
Differential Revision: https://secure.phabricator.com/D1844
2012-03-10 00:46:39 +01:00
|
|
|
* phabricator-prefab
|
2011-06-24 21:21:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
JX.behavior('differential-add-reviewers-and-ccs', function(config) {
|
|
|
|
|
Use Javelin placeholders and new sorting rules broadly; consolidate tokenizer construction code
Summary:
- We have three nearly-identical blocks of Tokenizer construction code; consolidate them into Prefab.
- Add placeholder support.
- Augment server-side stuff to specify placeholder text.
Test Plan: Verified behavior of Differential edit tokenizers, Differential comment tokenizers, Maniphest edit tokenizers, Maniphest comment tokenizers, Maniphest filter tokenizers, Differential filter tokenizers, Owners filter tokenizers, Owners edit tokenizers, Herald edit tokenizers, Audit filter tokenizers.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran, epriestley
Maniphest Tasks: T772, T946
Differential Revision: https://secure.phabricator.com/D1844
2012-03-10 00:46:39 +01:00
|
|
|
var dynamic = {};
|
|
|
|
for (var k in config.dynamic) {
|
|
|
|
var props = config.dynamic[k];
|
|
|
|
props.id = k;
|
2011-12-23 02:59:00 +01:00
|
|
|
|
Use Javelin placeholders and new sorting rules broadly; consolidate tokenizer construction code
Summary:
- We have three nearly-identical blocks of Tokenizer construction code; consolidate them into Prefab.
- Add placeholder support.
- Augment server-side stuff to specify placeholder text.
Test Plan: Verified behavior of Differential edit tokenizers, Differential comment tokenizers, Maniphest edit tokenizers, Maniphest comment tokenizers, Maniphest filter tokenizers, Differential filter tokenizers, Owners filter tokenizers, Owners edit tokenizers, Herald edit tokenizers, Audit filter tokenizers.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran, epriestley
Maniphest Tasks: T772, T946
Differential Revision: https://secure.phabricator.com/D1844
2012-03-10 00:46:39 +01:00
|
|
|
var tokenizer = JX.Prefab.buildTokenizer(props).tokenizer;
|
2011-06-24 21:21:48 +02:00
|
|
|
tokenizer.start();
|
|
|
|
|
|
|
|
dynamic[k] = {
|
|
|
|
row : JX.$(props.row),
|
Use Javelin placeholders and new sorting rules broadly; consolidate tokenizer construction code
Summary:
- We have three nearly-identical blocks of Tokenizer construction code; consolidate them into Prefab.
- Add placeholder support.
- Augment server-side stuff to specify placeholder text.
Test Plan: Verified behavior of Differential edit tokenizers, Differential comment tokenizers, Maniphest edit tokenizers, Maniphest comment tokenizers, Maniphest filter tokenizers, Differential filter tokenizers, Owners filter tokenizers, Owners edit tokenizers, Herald edit tokenizers, Audit filter tokenizers.
Reviewers: btrahan
Reviewed By: btrahan
CC: aran, epriestley
Maniphest Tasks: T772, T946
Differential Revision: https://secure.phabricator.com/D1844
2012-03-10 00:46:39 +01:00
|
|
|
tokenizer : tokenizer,
|
2013-07-10 20:05:53 +02:00
|
|
|
actions : props.actions,
|
|
|
|
labels: props.labels
|
2011-06-24 21:21:48 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
JX.DOM.listen(
|
|
|
|
JX.$(config.select),
|
|
|
|
'change',
|
|
|
|
null,
|
|
|
|
function(e) {
|
|
|
|
var v = JX.$(config.select).value;
|
|
|
|
for (var k in dynamic) {
|
2012-01-24 03:34:46 +01:00
|
|
|
if (dynamic[k].actions[v]) {
|
2011-06-24 21:21:48 +02:00
|
|
|
JX.DOM.show(dynamic[k].row);
|
2013-07-10 20:05:53 +02:00
|
|
|
if (dynamic[k].labels) {
|
|
|
|
var label_node = JX.DOM.find(dynamic[k].row, 'label');
|
|
|
|
if (label_node) {
|
|
|
|
JX.DOM.setContent(label_node, dynamic[k].labels[v]);
|
|
|
|
}
|
|
|
|
}
|
2011-06-24 21:21:48 +02:00
|
|
|
dynamic[k].tokenizer.refresh();
|
|
|
|
} else {
|
|
|
|
JX.DOM.hide(dynamic[k].row);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|