Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/67902
Change subject: Hopefully guilt the authors of ve.ui.MWCategoryPopupWidget into
documenting their code
......................................................................
Hopefully guilt the authors of ve.ui.MWCategoryPopupWidget into documenting
their code
Added the data type of "item", which I found after a goose chase through
all of the category-related code, but left the actual documentation
to be filled in by someone who actually knows what's going on.
Change-Id: Idd01bb8d01363cb2eaf311abae8fa5ecf7b36f0e
---
M modules/ve/ui/widgets/ve.ui.MWCategoryPopupWidget.js
M modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
2 files changed, 25 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/02/67902/1
diff --git a/modules/ve/ui/widgets/ve.ui.MWCategoryPopupWidget.js
b/modules/ve/ui/widgets/ve.ui.MWCategoryPopupWidget.js
index 144e086..3cac1e9 100644
--- a/modules/ve/ui/widgets/ve.ui.MWCategoryPopupWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.MWCategoryPopupWidget.js
@@ -66,25 +66,34 @@
/**
* @event removeCategory
+ * @param {string} category Category name
*/
/**
* @event updateSortkey
+ * @param {string} category Category name
+ * @param {string} sortkey New sortkey
*/
/* Methods */
+// FIXME document me
ve.ui.MWCategoryPopupWidget.prototype.onRemoveCategory = function () {
this.emit( 'removeCategory', this.category );
this.closePopup();
};
+// FIXME document me
ve.ui.MWCategoryPopupWidget.prototype.onSortKeySubmit = function () {
this.emit( 'updateSortkey', this.category,
this.sortKeyInput.$input.val() );
this.closePopup();
return false;
};
+/**
+ * FIXME document me
+ * @param {Object} item Category item with name, value and metaItem properties
+ */
ve.ui.MWCategoryPopupWidget.prototype.openPopup = function ( item ) {
this.show();
this.popupOpen = true;
@@ -93,19 +102,32 @@
this.setPopup( item );
};
+/**
+ * FIXME document me
+ * @param {Object} item Category item with name, value and metaItem properties
+ */
ve.ui.MWCategoryPopupWidget.prototype.loadCategoryIntoPopup = function ( item
) {
this.sortKeyInput.$input.val( item.sortKey );
};
+// FIXME document me
ve.ui.MWCategoryPopupWidget.prototype.closePopup = function () {
this.hide();
this.popupOpen = false;
};
+/**
+ * FIXME document me
+ * @param {Object} item Category item with name, value and metaItem properties
+ */
ve.ui.MWCategoryPopupWidget.prototype.setDefaultSortKey = function ( value ) {
this.sortKeyInput.$input.attr( 'placeholder', value );
};
+/**
+ * FIXME document me
+ * @param {Object} item Category item with name, value and metaItem properties
+ */
ve.ui.MWCategoryPopupWidget.prototype.setPopup = function ( item ) {
var left = item.$.offset().left + ( item.$.width() - 17 ),
top = item.$.offset().top + item.$.height(),
diff --git a/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
b/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
index b83ca6d..b22c13f 100644
--- a/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
@@ -63,12 +63,12 @@
/**
* @event newCategory
- * @param {Object} item category group item
+ * @param {Object} item Category item with name, value and metaItem properties
*/
/**
* @event updateSortkey
- * * @param {Object} item category group item
+ * * @param {Object} item Category item with name, value and metaItem
properties
*/
/* Methods */
@@ -112,7 +112,7 @@
};
/**
- * Update sortkey value, emit upsteSortkey event
+ * Update sortkey value, emit updateSortkey event
*
* @param {string} name
* @param {string} value
--
To view, visit https://gerrit.wikimedia.org/r/67902
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd01bb8d01363cb2eaf311abae8fa5ecf7b36f0e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits