[MediaWiki-commits] [Gerrit] Simplified toolbar definition - change (mediawiki...Wikibase)

2013-04-22 Thread Daniel Werner (Code Review)
Daniel Werner has submitted this change and it was merged.

Change subject: Simplified toolbar definition
..


Simplified toolbar definition

To define a toolbar's interaction widget, it is sufficient to specify the 
interaction
widgets full name in the toolbar definition instead of additionally referencing 
its
prototype.

Change-Id: I67a14bfd5319d07fdbcb1893cb443a67c4c50e42
---
M lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
M lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
M lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
M lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
4 files changed, 19 insertions(+), 27 deletions(-)

Approvals:
  Daniel Werner: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
index 2bb402c..753e1ad 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
@@ -390,10 +390,7 @@
 var widgetPrototype = $.wikibase.claimlistview.prototype;
 
 $.wikibase.toolbarcontroller.definition( 'addtoolbar', {
-   widget: {
-   name: 'wikibase.claimlistview',
-   prototype: widgetPrototype
-   },
+   widgetName: 'wikibase.claimlistview',
options: {
interactionWidgetName: widgetPrototype.widgetName
}
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
index b59180f..f7a2e36 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
@@ -200,10 +200,7 @@
 
 // Register toolbars:
 $.wikibase.toolbarcontroller.definition( 'edittoolbar', {
-   widget: {
-   name: 'wikibase.referenceview',
-   prototype: $.wikibase.referenceview.prototype
-   },
+   widgetName: 'wikibase.referenceview',
options: {
interactionWidgetName: 
$.wikibase.referenceview.prototype.widgetName
}
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
index 151e320..eb7d634 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
@@ -288,10 +288,7 @@
 
 // Register toolbars:
 $.wikibase.toolbarcontroller.definition( 'edittoolbar', {
-   widget: {
-   name: 'wikibase.statementview',
-   prototype: $.wikibase.statementview.prototype
-   },
+   widgetName: 'wikibase.statementview',
events: {
statementviewchange: function( event ) {
var $target = $( event.target ),
diff --git 
a/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js 
b/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
index 9ef517b..d43f57f 100644
--- a/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
+++ b/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
@@ -24,10 +24,8 @@
 * $.wikibase.toolbarcontroller.definition(
 *   'addtoolbar', // the toolbar type
 *   {
-* widget: { // the referenced widget that needs to be able to 
interface to the toolbar type
-*   name: 'wikibase.claimlistview', // namespace.name of the 
widget
-*   prototype: $.wikibase.claimlistview.prototype
-* },
+* widgetName: 'wikibase.claimlistview',// namespace.name of 
the referenced widget that
+*  // needs to be able to 
interface to the toolbar type
 * options: { // options passed to the toolbar
 *   toolbarParentSelector: '.wb-claims-toolbar'
 * }
@@ -59,11 +57,9 @@
 * @param {Object} toolbarDefinitionOrId Object defining a toolbar that 
should be set or a
 *toolbar id/widget name to get a registered toolbar definition.
 *A toolbar definition may contain the following attributes:
-*- widget
-*  An object referencing the widget the toolbar shall interact 
with, for example:
-*  { name: 'wikibase.claimlistview', prototype: 
$.wikibase.claimlistview.prototype }
-*  Having defined an interaction widget, no other attributes 
(except fot the options)
-*  need to be defined.
+*- widgetName
+*  The full name of the widget the toolbar shall interact 
with. Having defined an
+*  interaction widget, no other attributes (except fot the 
options) need to be defined.
  

[MediaWiki-commits] [Gerrit] Simplified toolbar definition - change (mediawiki...Wikibase)

2013-04-16 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59409


Change subject: Simplified toolbar definition
..

Simplified toolbar definition

To define a toolbar's interaction widget, it is sufficient to specify the 
interaction
widgets full name in the toolbar definition instead of additionally referencing 
its
prototype.

Change-Id: I67a14bfd5319d07fdbcb1893cb443a67c4c50e42
---
M lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
M lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
M lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
M lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
4 files changed, 19 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/09/59409/1

diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
index 2bb402c..753e1ad 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js
@@ -390,10 +390,7 @@
 var widgetPrototype = $.wikibase.claimlistview.prototype;
 
 $.wikibase.toolbarcontroller.definition( 'addtoolbar', {
-   widget: {
-   name: 'wikibase.claimlistview',
-   prototype: widgetPrototype
-   },
+   widgetName: 'wikibase.claimlistview',
options: {
interactionWidgetName: widgetPrototype.widgetName
}
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
index b59180f..f7a2e36 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
@@ -200,10 +200,7 @@
 
 // Register toolbars:
 $.wikibase.toolbarcontroller.definition( 'edittoolbar', {
-   widget: {
-   name: 'wikibase.referenceview',
-   prototype: $.wikibase.referenceview.prototype
-   },
+   widgetName: 'wikibase.referenceview',
options: {
interactionWidgetName: 
$.wikibase.referenceview.prototype.widgetName
}
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
index 151e320..eb7d634 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.statementview.js
@@ -288,10 +288,7 @@
 
 // Register toolbars:
 $.wikibase.toolbarcontroller.definition( 'edittoolbar', {
-   widget: {
-   name: 'wikibase.statementview',
-   prototype: $.wikibase.statementview.prototype
-   },
+   widgetName: 'wikibase.statementview',
events: {
statementviewchange: function( event ) {
var $target = $( event.target ),
diff --git 
a/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js 
b/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
index 9ef517b..d43f57f 100644
--- a/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
+++ b/lib/resources/jquery.wikibase/toolbar/toolbarcontroller.definitions.js
@@ -24,10 +24,8 @@
 * $.wikibase.toolbarcontroller.definition(
 *   'addtoolbar', // the toolbar type
 *   {
-* widget: { // the referenced widget that needs to be able to 
interface to the toolbar type
-*   name: 'wikibase.claimlistview', // namespace.name of the 
widget
-*   prototype: $.wikibase.claimlistview.prototype
-* },
+* widgetName: 'wikibase.claimlistview',// namespace.name of 
the referenced widget that
+*  // needs to be able to 
interface to the toolbar type
 * options: { // options passed to the toolbar
 *   toolbarParentSelector: '.wb-claims-toolbar'
 * }
@@ -59,11 +57,9 @@
 * @param {Object} toolbarDefinitionOrId Object defining a toolbar that 
should be set or a
 *toolbar id/widget name to get a registered toolbar definition.
 *A toolbar definition may contain the following attributes:
-*- widget
-*  An object referencing the widget the toolbar shall interact 
with, for example:
-*  { name: 'wikibase.claimlistview', prototype: 
$.wikibase.claimlistview.prototype }
-*  Having defined an interaction widget, no other attributes 
(except fot the options)
-*  need to be defined.
+*- widgetName
+*  The full name of the widget the toolbar shall interact 
with. Having defined an
+*  interaction widget, no other attributes