[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Making multi-column lists visually similar to single-column ...

2017-09-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381375 )

Change subject: Making multi-column lists visually similar to single-column 
lists.
..

Making multi-column lists visually similar to single-column lists.

Change-Id: Ifccd5f2a7ee091bd9fa4a794f7ace51309facf13
---
M modules/ext.CollaborationKit.list.styles.less
1 file changed, 4 insertions(+), 88 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/75/381375/1

diff --git a/modules/ext.CollaborationKit.list.styles.less 
b/modules/ext.CollaborationKit.list.styles.less
index bf1da1f..01345b8 100644
--- a/modules/ext.CollaborationKit.list.styles.less
+++ b/modules/ext.CollaborationKit.list.styles.less
@@ -7,8 +7,10 @@
 }
 
 .mw-ck-list-image {
+   .grey();
float: left;
overflow: hidden;
+   padding: 1px;
 }
 .mw-ck-list-noimageplaceholder {
width: 64px;
@@ -41,7 +43,6 @@
margin: 0 -0.5em;
 
.mw-ck-list-column {
-   .grey-box();
float: left; // IE9 workaround, maybe
.flex();
margin: 0.5em;
@@ -59,9 +60,6 @@
}
.mw-ck-list-column-header {
padding: 1.25em 1.5em 0.35em;
-
-   // YOU ARE AN IDIOT AND YOU SUCK, SELF
-   // Can anyone else explain how this voodoo works? because now I 
can't figure it out
margin: -1.6em -1.6em 1em;
border-radius: 3px 3px 0 0;
}
@@ -69,88 +67,6 @@
margin-top: 0;
padding-top: 0;
}
-}
-.column-theme-header( #ddd );
-
-// Theme colours mixin and application
-
-.column-theme-header( @color ) {
-   .mw-ck-multilist {
-   .mw-ck-list-column {
-   border-color: fadeout( @color, 25% );
-   }
-   .mw-ck-list-column-header {
-   border: solid 1px @color;
-   border-bottom-width: 3px;
-   background: fadeout( @color, 75% );
-   }
-   }
-}
-.mw-ck-theme-darkred {
-   .column-theme-header( @darkred );
-}
-.mw-ck-theme-red {
-   .column-theme-header( @red );
-}
-.mw-ck-theme-darkgrey {
-   .column-theme-header( @darkgrey );
-}
-.mw-ck-theme-lightgrey {
-   .column-theme-header( @lightgrey );
-}
-.mw-ck-theme-skyblue {
-   .column-theme-header( @skyblue );
-}
-.mw-ck-theme-blue {
-   .column-theme-header( @blue );
-}
-.mw-ck-theme-bluegrey {
-   .column-theme-header( @bluegrey );
-}
-.mw-ck-theme-navyblue {
-   .column-theme-header( @navyblue );
-}
-.mw-ck-theme-darkblue {
-   .column-theme-header( @darkblue );
-}
-.mw-ck-theme-aquamarine {
-   .column-theme-header( @aquamarine );
-}
-.mw-ck-theme-violet {
-   .column-theme-header( @violet );
-}
-.mw-ck-theme-purple {
-   .column-theme-header( @purple );
-}
-.mw-ck-theme-mauve {
-   .column-theme-header( @mauve );
-}
-.mw-ck-theme-lightmauve {
-   .column-theme-header( @lightmauve );
-}
-.mw-ck-theme-salmon {
-   .column-theme-header( @salmon );
-}
-.mw-ck-theme-orange {
-   .column-theme-header( @orange );
-}
-.mw-ck-theme-yellow {
-   .column-theme-header( @yellow );
-}
-.mw-ck-theme-gold {
-   .column-theme-header( @gold );
-}
-.mw-ck-theme-pastelyellow {
-   .column-theme-header( @pastelyellow );
-}
-.mw-ck-theme-forestgreen {
-   .column-theme-header( @forestgreen );
-}
-.mw-ck-theme-brightgreen {
-   .column-theme-header( @brightgreen );
-}
-.mw-ck-theme-khaki {
-   .column-theme-header( @khaki );
 }
 
 /* @todo, should maybe replace styling from toccolours with this class */
@@ -200,8 +116,8 @@
 }
 
 .mw-ck-list-dragplaceholder {
-   border: #000 thin dashed;
-   width: 25%;
+   background: #eee;
+   width: 100%;
 }
 
 .mw-ck-list-title .jquery-confirmable-text,

-- 
To view, visit https://gerrit.wikimedia.org/r/381375
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifccd5f2a7ee091bd9fa4a794f7ace51309facf13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Tighter bounding / visual uniformity for list entries. Also ...

2017-06-15 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/359105 )

Change subject: Tighter bounding / visual uniformity for list entries. Also 
making chrome consistent between single-column and multi-column lists.
..

Tighter bounding / visual uniformity for list entries. Also making
chrome consistent between single-column and multi-column lists.

Change-Id: Ic76884146471f9df4c214feca2922750dcb943a4
---
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.list.styles.less
M modules/ext.CollaborationKit.list.ui.js
3 files changed, 56 insertions(+), 101 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/05/359105/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index f39a580..ae22185 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -372,8 +372,9 @@
} elseif ( $item->link !== false ) {
$titleForItem = 
Title::newFromText( $item->link );
}
+   $adjustedIconWidth = $iconWidth * 1.3;
$text .= Html::openElement( 'div', [
-   'style' => 
"min-height:{$iconWidth}px",
+   'style' => 
"height:{$adjustedIconWidth}px; min-height:{$adjustedIconWidth}px",
'class' => 'mw-ck-list-item',
'data-collabkit-item-title' => 
$item->title,
'data-collabkit-item-id' => 
$colId . '-' . $itemCounter,
diff --git a/modules/ext.CollaborationKit.list.styles.less 
b/modules/ext.CollaborationKit.list.styles.less
index bf1da1f..155a504 100644
--- a/modules/ext.CollaborationKit.list.styles.less
+++ b/modules/ext.CollaborationKit.list.styles.less
@@ -3,12 +3,53 @@
 /* Styles needed when transcluding list content */
 
 .mw-ck-list-item {
-   margin-bottom: 0.5em;
+   overflow: hidden;
+   margin-bottom: 0.5625em;
+   position: relative;
+
+   .mw-ck-list-buttonrow {
+   display: none;
+   }
+
+   .mw-ck-list-container .mw-ck-list-notes p {
+   margin: .35em 0;
+   }
+}
+
+.mw-ck-list-item:after {
+   content: '';
+   background: linear-gradient(to bottom, transparent, white);
+   height: 50%;
+   width: 100%;
+   margin-left:68px;
+   position: absolute;
+   bottom: 0;
+   left: 0;
+}
+
+.mw-ck-hub-members .mw-ck-list-item:after {
+   background: linear-gradient(to bottom, transparent, #f9f9f9);
+}
+
+.mw-ck-list-item:hover {
+   height: auto !important;
+   overflow: visible;
+
+   .mw-ck-list-buttonrow {
+   display: block;
+   }
+}
+
+/* Removes the fadeout effect */
+.mw-ck-list-item:hover:after {
+   display: none;
 }
 
 .mw-ck-list-image {
+   .grey();
float: left;
overflow: hidden;
+   padding: 1px;
 }
 .mw-ck-list-noimageplaceholder {
width: 64px;
@@ -18,10 +59,8 @@
background: #eee 50% 50%;
 }
 .mw-ck-list-container {
-   height: 64px;
padding-left: 10px;
display: table-cell;
-   vertical-align: middle;
line-height: 1.2;
 }
 .mw-ck-list-title {
@@ -31,7 +70,6 @@
 
 .mw-ck-list-notes {
font-size: 90%;
-   margin: 1em 0 2em;
 }
 
 /* Multilist stuff */
@@ -41,7 +79,6 @@
margin: 0 -0.5em;
 
.mw-ck-list-column {
-   .grey-box();
float: left; // IE9 workaround, maybe
.flex();
margin: 0.5em;
@@ -70,88 +107,6 @@
padding-top: 0;
}
 }
-.column-theme-header( #ddd );
-
-// Theme colours mixin and application
-
-.column-theme-header( @color ) {
-   .mw-ck-multilist {
-   .mw-ck-list-column {
-   border-color: fadeout( @color, 25% );
-   }
-   .mw-ck-list-column-header {
-   border: solid 1px @color;
-   border-bottom-width: 3px;
-   background: fadeout( @color, 75% );
-   }
-   }
-}
-.mw-ck-theme-darkred {
-   .column-theme-header( @darkred );
-}
-.mw-ck-theme-red {
-   .column-theme-header( @red );
-}
-.mw-ck-theme-darkgrey {
-   .column-theme-header( @darkgrey );
-}
-.mw-ck-theme-lightgrey {
-   .column-theme-header( @lightgrey );
-}
-.mw-ck-theme-skyblue {
-   .column-theme-header( @skyblue );
-}
-.mw-ck-theme-blue {
-   .column-theme-header( @blue );
-}
-.mw-ck-theme-bluegrey {
-   .column-theme-header( @bluegrey );
-}
-.mw-ck-theme-navyblue {
-   

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Consistent use of the edit icon

2017-06-15 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/359102 )

Change subject: Consistent use of the edit icon
..

Consistent use of the edit icon

Change-Id: I53631da03c02a7e2c914bea9ed692394e1725594
---
M extension.json
M modules/ext.CollaborationKit.hubtheme.js
M modules/ext.CollaborationKit.list.ui.js
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/02/359102/1

diff --git a/extension.json b/extension.json
index 5f0a516..0de6fb3 100644
--- a/extension.json
+++ b/extension.json
@@ -183,6 +183,7 @@
"mediawiki.api.edit",
"oojs-ui",
"oojs-ui.styles.icons-movement",
+   "oojs-ui.styles.icons-editing-core",
"mediawiki.widgets",
"mediawiki.widgets.UserInputWidget",
"jquery.ui.sortable",
diff --git a/modules/ext.CollaborationKit.hubtheme.js 
b/modules/ext.CollaborationKit.hubtheme.js
index c45b747..daced22 100644
--- a/modules/ext.CollaborationKit.hubtheme.js
+++ b/modules/ext.CollaborationKit.hubtheme.js
@@ -291,14 +291,14 @@
 
// Defining buttons
colourBrowserButton = new OO.ui.ButtonWidget( {
-   icon: 'search',
+   icon: 'edit',
framed: false,
classes: [ 'mw-ck-hubtheme-widget-inlinebutton' ]
} );
colourBrowserButton.on( 'click', openColourBrowser );
 
hubimageBrowserButton = new OO.ui.ButtonWidget( {
-   icon: 'search',
+   icon: 'edit',
framed: false,
classes: [ 'mw-ck-hubtheme-widget-inlinebutton' ]
} );
diff --git a/modules/ext.CollaborationKit.list.ui.js 
b/modules/ext.CollaborationKit.list.ui.js
index dd6cfaa..27404a2 100644
--- a/modules/ext.CollaborationKit.list.ui.js
+++ b/modules/ext.CollaborationKit.list.ui.js
@@ -302,7 +302,7 @@
}
 
editButton = new OO.ui.ButtonWidget( {
-   label: 'edit',
+   icon: 'edit',
framed: false
} ).on( 'click', function () {
modifyExistingItem(

-- 
To view, visit https://gerrit.wikimedia.org/r/359102
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I53631da03c02a7e2c914bea9ed692394e1725594
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing typos in function documentation.

2017-06-14 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/359091 )

Change subject: Fixing typos in function documentation.
..

Fixing typos in function documentation.

Change-Id: I7550a59064d02f3fbdac40fff2a7bb2b71f9a0e0
---
M includes/content/CollaborationKitImage.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/91/359091/1

diff --git a/includes/content/CollaborationKitImage.php 
b/includes/content/CollaborationKitImage.php
index ed083bb..ac7f39d 100644
--- a/includes/content/CollaborationKitImage.php
+++ b/includes/content/CollaborationKitImage.php
@@ -26,12 +26,12 @@
 *  instead of HTML? Defaults to false.
 * @param string $options['label'] Label to put under image; used for 
ToC icons
 * @param string $options['fallback'] If the specified image is null or
-*  doesn't exist. Validoptions are none', a valid icon ID, or an 
arbitrary
+*  doesn't exist. Valid options are 'none', a valid icon ID, or an 
arbitrary
 *  string to use a seed. (Note: if you specify a label, then that will
 *  serve as the fallback.)
 * @param bool $options['optimizeForSquare'] Fetch an image such that 
it's
 *  ideal for shoving into a square frame. Default is false. Images with
-*  labels always get optimzed for squares.
+*  labels always get optimzied for squares.
 * @return string HTML elements or wikitext, depending on
 *  $options['renderAsWikitext']
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/359091
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7550a59064d02f3fbdac40fff2a7bb2b71f9a0e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Make the edit textboxes use monospace text.

2017-06-14 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/359090 )

Change subject: Make the edit textboxes use monospace text.
..

Make the edit textboxes use monospace text.

Change-Id: I25513f17f340a3fe79eede37b07c86874d4fbc35
---
M modules/ext.CollaborationKit.edit.styles.less
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/90/359090/1

diff --git a/modules/ext.CollaborationKit.edit.styles.less 
b/modules/ext.CollaborationKit.edit.styles.less
index e20f551..9854168 100644
--- a/modules/ext.CollaborationKit.edit.styles.less
+++ b/modules/ext.CollaborationKit.edit.styles.less
@@ -8,6 +8,9 @@
max-width: 100%;
}
 }
+.mw-collabkit-modifiededitform textarea {
+   font-family: monospace !important;
+}
 .mw-htmlform-ooui-wrapper,
 .mw-collabkit-modifiededitform {
.oo-ui-fieldLayout-header label.oo-ui-labelElement-label,

-- 
To view, visit https://gerrit.wikimedia.org/r/359090
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25513f17f340a3fe79eede37b07c86874d4fbc35
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...InputBox[master]: Allow appending searchfilters to terms

2017-06-06 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357437 )

Change subject: Allow appending searchfilters to terms
..

Allow appending searchfilters to terms

For search-style inputboxes, if you have `searchfilter=foo` as a
parameter, it will append `foo` after the search term. This is
useful for leveraging search filters in custom search boxes without
exposing it to the user.

Bug: T147951
Change-Id: Ie23ce220ff9657c38fe5b41195e297ca7cebf7f1
---
M InputBox.classes.php
M InputBox.hooks.php
2 files changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InputBox 
refs/changes/37/357437/1

diff --git a/InputBox.classes.php b/InputBox.classes.php
index e5a4290..1ee1931 100644
--- a/InputBox.classes.php
+++ b/InputBox.classes.php
@@ -36,6 +36,7 @@
private $mInline = false;
private $mPrefix = '';
private $mDir = '';
+   private $mSearchFilter = '';
 
/* Functions */
 
@@ -167,6 +168,10 @@
 
if ( $this->mPrefix != '' ) {
$htmlOut .= Html::hidden( 'prefix', $this->mPrefix );
+   }
+
+   if ( $this->mSearchFilter != '' ) {
+   $htmlOut .= Html::hidden( 'searchfilter', 
$this->mSearchFilter );
}
 
$htmlOut .= $this->mBR;
@@ -599,6 +604,7 @@
'inline' => 'mInline',
'prefix' => 'mPrefix',
'dir' => 'mDir',
+   'searchfilter' => 'mSearchFilter'
];
foreach ( $options as $name => $var ) {
if ( isset( $values[$name] ) ) {
diff --git a/InputBox.hooks.php b/InputBox.hooks.php
index 9bdae13..60c16d1 100644
--- a/InputBox.hooks.php
+++ b/InputBox.hooks.php
@@ -22,10 +22,15 @@
$request = $special->getRequest();
$prefix = $request->getText( 'prefix', '' );
$title = $request->getText( 'wpNewTitle', '' );
+   $search = $request->getText( 'search', '' );
+   $searchfilter = $request->getText( 'searchfilter', '' );
if ( $special->getName() == 'Movepage' && $prefix !== '' && 
$title !== '' ) {
$request->setVal( 'wpNewTitle', $prefix . $title );
$request->unsetVal( 'prefix' );
}
+   if ( $special->getName() == 'Search' && $searchfilter !== '' ) {
+   $request->setVal( 'search', $search . ' ' . 
$searchfilter );
+   }
return true;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/357437
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie23ce220ff9657c38fe5b41195e297ca7cebf7f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/InputBox
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Style tweaks

2017-05-20 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354887 )

Change subject: Style tweaks
..

Style tweaks

- Tighter bounding / visual uniformity for list entries
- Making chrome consistent between single-column and multi-column
  lists
- Changing some usages of the magnifying glass icon to the pencil
  icon

Change-Id: I3019069213a183ff441c15482a24813431c21b44
---
M extension.json
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.hub.styles.less
M modules/ext.CollaborationKit.hubtheme.js
M modules/ext.CollaborationKit.list.styles.less
M modules/ext.CollaborationKit.list.ui.js
6 files changed, 65 insertions(+), 109 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/87/354887/1

diff --git a/extension.json b/extension.json
index db5658e..00fc2de 100644
--- a/extension.json
+++ b/extension.json
@@ -182,6 +182,7 @@
"mediawiki.api.edit",
"oojs-ui",
"oojs-ui.styles.icons-movement",
+   "oojs-ui.styles.icons-editing-core",
"mediawiki.widgets",
"mediawiki.widgets.UserInputWidget",
"jquery.ui.sortable",
diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index f39a580..d950f10 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -372,8 +372,9 @@
} elseif ( $item->link !== false ) {
$titleForItem = 
Title::newFromText( $item->link );
}
+   $adjustedIconWidth = $iconWidth + 2;
$text .= Html::openElement( 'div', [
-   'style' => 
"min-height:{$iconWidth}px",
+   'style' => 
"height:{$adjustedIconWidth}px; min-height:{$adjustedIconWidth}px",
'class' => 'mw-ck-list-item',
'data-collabkit-item-title' => 
$item->title,
'data-collabkit-item-id' => 
$colId . '-' . $itemCounter,
diff --git a/modules/ext.CollaborationKit.hub.styles.less 
b/modules/ext.CollaborationKit.hub.styles.less
index 9ac5995..bea4cad 100644
--- a/modules/ext.CollaborationKit.hub.styles.less
+++ b/modules/ext.CollaborationKit.hub.styles.less
@@ -22,6 +22,10 @@
margin: auto;
}
 
+   div ul {
+   margin: 0;
+   }
+
.mw-ck-file-image {
height: 50px;
overflow: hidden;
@@ -32,9 +36,9 @@
}
.mw-ck-toc-label {
font-weight: bold;
-   margin: 0 0 1em;
-   border-bottom: 3px solid;
+   margin: 0 0 .5em;
width: 33%;
+
}
.mw-ck-icon {
height: 50px;
@@ -67,7 +71,7 @@
}
 
.mw-ck-hub-section-main {
-   padding-top: .25em;
+   padding-top: 1.125em;
}
}
.mw-ck-hub-section-buttons {
@@ -106,7 +110,7 @@
width: 25%;
 
h3 {
-   margin: 0 0 .5em;
+   margin: 0 0 1.125em;
padding: 0;
text-align: center;
}
diff --git a/modules/ext.CollaborationKit.hubtheme.js 
b/modules/ext.CollaborationKit.hubtheme.js
index e727919..f3fc2c2 100644
--- a/modules/ext.CollaborationKit.hubtheme.js
+++ b/modules/ext.CollaborationKit.hubtheme.js
@@ -291,14 +291,14 @@
 
// Defining buttons
colourBrowserButton = new OO.ui.ButtonWidget( {
-   icon: 'search',
+   icon: 'edit',
framed: false,
classes: [ 'mw-ck-hubtheme-widget-inlinebutton' ]
} );
colourBrowserButton.on( 'click', openColourBrowser );
 
hubimageBrowserButton = new OO.ui.ButtonWidget( {
-   icon: 'search',
+   icon: 'edit',
framed: false,
classes: [ 'mw-ck-hubtheme-widget-inlinebutton' ]
} );
diff --git a/modules/ext.CollaborationKit.list.styles.less 
b/modules/ext.CollaborationKit.list.styles.less
index 7f3265c..e509a7d 100644
--- a/modules/ext.CollaborationKit.list.styles.less
+++ b/modules/ext.CollaborationKit.list.styles.less
@@ -3,10 +3,48 @@
 /* Styles needed when transcluding list content */
 
 .mw-ck-list-item {
-   margin-bottom: 0.5em;
+  

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Assign column-agnostic UID to individual list entries

2017-05-20 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354618 )

Change subject: Assign column-agnostic UID to individual list entries
..

Assign column-agnostic UID to individual list entries

Unlike the other ID assignment mechanism, this is based on the item's
position in the JSON's native representation. This allows list items
to be edited regardless of how they appear in the rendered HTML.

Bug: T165672
Change-Id: I37da1639e2e70d1b51ba090444d2a5e73be94613
---
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.ui.js
3 files changed, 198 insertions(+), 135 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/18/354618/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 47c68ff..246afa9 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -300,10 +300,19 @@
return $text;
}
 
+   $columns = $this->columns;
+
+   // Assign a UID to each list entry.
+   $uidCounter = 0;
+   foreach ( $columns as $colId => $column ) {
+   foreach ( $column->items as $rowId => $row ) {
+   $columns[$colId]->items[$rowId]->uid = 
$uidCounter;
+   $uidCounter++;
+   }
+   }
+
if ( $this->displaymode === 'members' && count( $this->columns 
) === 1 ) {
-   $columns = $this->sortUsersIntoColumns( 
$this->columns[0] );
-   } else {
-   $columns = $this->columns;
+   $columns = $this->sortUsersIntoColumns( $columns[0] );
}
 
$columns = $this->filterColumns( $columns, $options['columns'] 
);
@@ -335,103 +344,103 @@
if ( count( $column->items ) === 0 ) {
$text .= "\n";
$text .= 
"{{mediawiki:collaborationkit-list-emptycolumn}}\n";
-   $text .= "\n";
-   continue;
-   }
+   } else {
+   $curItem = 0;
 
-   $curItem = 0;
+   $sortedItems = $column->items;
+   $this->sortList( $sortedItems, 
$options['defaultSort'] );
 
-   $sortedItems = $column->items;
-   $this->sortList( $sortedItems, $options['defaultSort'] 
);
-
-   $itemCounter = 0;
-   foreach ( $sortedItems as $item ) {
-   if ( $offset !== 0 ) {
-   $offset--;
-   continue;
-   }
-   $curItem++;
-   if ( $maxItems !== false && $maxItems < 
$curItem ) {
-   break;
-   }
-
-   $itemTags = isset( $item->tags ) ? $item->tags 
: [];
-   if ( !$this->matchesTag( $options['tags'], 
$itemTags ) ) {
-   continue;
-   }
-
-   $titleForItem = null;
-   if ( !isset( $item->link ) ) {
-   $titleForItem = Title::newFromText( 
$item->title );
-   } elseif ( $item->link !== false ) {
-   $titleForItem = Title::newFromText( 
$item->link );
-   }
-   $text .= Html::openElement( 'div', [
-   'style' => "min-height:{$iconWidth}px",
-   'class' => 'mw-ck-list-item',
-   'data-collabkit-item-title' => 
$item->title,
-   'data-collabkit-item-id' => $colId . 
'-' . $itemCounter
-   ] );
-   $itemCounter++;
-   if ( $options['mode'] !== 'no-img' ) {
-   if ( isset( $item->image ) ) {
-   $text .= static::generateImage(
-   $item->image,
-   $this->displaymode,
-   $titleForItem,
-   $iconWidth
-

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Ask the user for confirmation before overwriting an existing...

2017-05-18 Thread Harej (Code Review)
Harej has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/351097 )

Change subject: Ask the user for confirmation before overwriting an existing 
page
..


Ask the user for confirmation before overwriting an existing page

Also preventing CreateCollaborationHub from being shown to those
who cannot create pages.

Change-Id: I507acec92d29a871d4e0df7a9db43cc01dfbe746
---
M i18n/en.json
M i18n/qqq.json
M includes/SpecialCreateCollaborationHub.php
3 files changed, 69 insertions(+), 9 deletions(-)

Approvals:
  jenkins-bot: Verified
  Isarra: Looks good to me, approved



diff --git a/i18n/en.json b/i18n/en.json
index 74caeb9..4fb8c8d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -15,6 +15,8 @@
"collaborationkit-createhub-exists": "A page already exists with the 
specified title.",
"collaborationkit-createhub-nopermission": "You do not have permission 
to create a Collaboration Hub with this title",
"collaborationkit-createhub-editsummary": "Created new Collaboration 
Hub",
+   "collaborationkit-createhub-confirm": "Yes, overwrite the current page 
contents",
+   "collaborationkit-createhub-confirmheader": "There is already a page 
with this title. If you confirm below, the contents of that page will be 
overwritten. Would you like to proceed?",
"collaborationkit-createhubfeature-collaborationhub": "Parent 
Collaboration Hub",
"collaborationkit-createhubfeature-featurename": "Feature name",
"collaborationkit-createhubfeature-icon": "Icon",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 8e171bc..4df4c93 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -18,6 +18,8 @@
"collaborationkit-createhub-exists": "Error message for attempting to 
create a page that already exists",
"collaborationkit-createhub-nopermission": "Error message for no 
permission to edit/create/whatever",
"collaborationkit-createhub-editsummary": "Edit summary for creating a 
new Collaboration Hub via Special:CreateCollaborationHub",
+   "collaborationkit-createhub-confirm": "Checkbox message to confirm 
overwriting an existing page when creating a Collaboration Hub",
+   "collaborationkit-createhub-confirmheader": "Warning box that shows at 
the top of Special:CreateCollaborationHub when a page already exists at the 
given title",
"collaborationkit-createhubfeature-collaborationhub": "Label for form 
field for specifying the Collaboration Hub on Special:CreateHubFeature",
"collaborationkit-createhubfeature-featurename": "Label for form field 
for specifying the name of the feature to be created on 
Special:CreateHubFeature",
"collaborationkit-createhubfeature-icon": "Label for form field for 
specifying the feature's icon on Special:CreateHubFeature\n{{Identical|Icon}}",
diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 321fab6..5a96b3b 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -25,6 +25,10 @@
 * @param $par string
 */
public function execute( $par ) {
+   if ( !$this->getUser()->isAllowed( 'createpage' ) ) {
+   throw new PermissionsError( 'createpage' );
+   }
+
$out = $this->getContext()->getOutput();
$out->addModules( [
'ext.CollaborationKit.hubtheme'
@@ -35,6 +39,12 @@
CollaborationHubContent::getThemeColours()
);
 
+   if ( $this->getRequest()->getVal( 'confirm' ) ) {
+   $out->wrapWikiMsg(
+   "\n$1\n",
+   'collaborationkit-createhub-confirmheader'
+   );
+   }
parent::execute( $par );
}
 
@@ -52,8 +62,6 @@
}
 
$fields = [
-   // autofilled from how they got here, hopefully
-
'namespace' => [
'type' => 'select',
'options' => $namespaceChoices,
@@ -110,6 +118,36 @@
'placeholder-message' => 
'collaborationkit-hubedit-introduction-placeholder'
];
 
+   // If these fields are included in GET parameter, have them as 
default
+   // values on the form.
+   foreach ( [
+   'namespace',
+   'icon',
+   'display_name',
+   'icon',
+   'colour',
+   'introduction' ]
+   as $fieldName )
+   {
+   if ( $this->getRequest()->getVal( $fieldName ) ) {
+   $fields[ $fieldName ][ 'default' ] = 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Updating unit tests

2017-05-09 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353007 )

Change subject: Updating unit tests
..

Updating unit tests

Change-Id: Ie7f85f5b219443d4f0c1725cf2a80738d7bd131d
---
M tests/phpunit/CollaborationHubContentTest.php
1 file changed, 9 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/07/353007/1

diff --git a/tests/phpunit/CollaborationHubContentTest.php 
b/tests/phpunit/CollaborationHubContentTest.php
index 0529d5c..3da547e 100644
--- a/tests/phpunit/CollaborationHubContentTest.php
+++ b/tests/phpunit/CollaborationHubContentTest.php
@@ -118,9 +118,9 @@
 */
public function testGetParsedIntroduction( CollaborationHubContent 
$content, $id ) {
$expected = [
-   "Test content\n",
-   '',
-   '',
+   "Test 
content\n",
+   '',
+   '',
];
$wc = TestingAccessWrapper::newFromObject( $content );
$actual = $wc->getParsedIntroduction( Title::newMainPage(), new 
ParserOptions );
@@ -132,9 +132,9 @@
 */
public function testGetParsedFooter( CollaborationHubContent $content, 
$id ) {
$expected = [
-   "Test content footer\n",
-   '',
-   '',
+   "Test content 
footer\n",
+   '',
+   '',
];
$wc = TestingAccessWrapper::newFromObject( $content );
$actual = $wc->getParsedFooter( Title::newMainPage(), new 
ParserOptions );
@@ -147,9 +147,9 @@
public function testGetParsedContent( CollaborationHubContent $content, 
$id ) {
global $wgServer;
$expected = [
-   "Wow!" . wfMessage( 
'collaborationkit-hub-missingpage-note' ) . "" . wfMessage( 
'collaborationkit-hub-missingpage-create' ) . "" 
. wfMessage( 'collaborationkit-hub-missingpage-purgecache' ) . "",
-   '',
-   ''
+   "Wow!" . wfMessage( 
'collaborationkit-hub-missingpage-note' ) . "" . wfMessage( 
'collaborationkit-hub-missingpage-create' ) . "" 
. wfMessage( 'collaborationkit-hub-missingpage-purgecache' ) . "",
+   '',
+   ''
];
$wc = TestingAccessWrapper::newFromObject( $content );
$actual = $wc->getParsedContent( Title::newMainPage(), new 
ParserOptions, new ParserOutput );

-- 
To view, visit https://gerrit.wikimedia.org/r/353007
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie7f85f5b219443d4f0c1725cf2a80738d7bd131d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Treating the "empty column" message as a list item for CSS s...

2017-05-03 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351747 )

Change subject: Treating the "empty column" message as a list item for CSS 
selector purposes.
..

Treating the "empty column" message as a list item for CSS selector
purposes.

Basically, the JavaScript uses the last element of the mw-ck-list-item
class to figure out where to append the "add item" button. This
treats the notice that says "this column is empty" as a list item
so that each column will always have at least one element of that
class.

Change-Id: I55fb901e4d87ef266e22b2c9ef2f33f78f1c6e66
---
M includes/content/CollaborationListContent.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/47/351747/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index c60c1c7..58ea7b2 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -333,7 +333,9 @@
$text .= "\n";
 
if ( count( $column->items ) === 0 ) {
-   $text .= 
"\n{{mediawiki:collaborationkit-list-emptycolumn}}\n";
+   $text .= "\n";
+   $text .= 
"{{mediawiki:collaborationkit-list-emptycolumn}}\n";
+   $text .= "\n";
continue;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/351747
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55fb901e4d87ef266e22b2c9ef2f33f78f1c6e66
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding .pushPending() to certain process dialogs

2017-05-03 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351746 )

Change subject: Adding .pushPending() to certain process dialogs
..

Adding .pushPending() to certain process dialogs

This way, when buttons are pushed, they have a nice save animation
instead of just sitting there blankly.

Change-Id: Iafd1663f94d03cf059fec185e072aceac0cc1d59
---
M modules/ext.CollaborationKit.hubtheme.js
M modules/ext.CollaborationKit.list.ui.js
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/46/351746/1

diff --git a/modules/ext.CollaborationKit.hubtheme.js 
b/modules/ext.CollaborationKit.hubtheme.js
index e99bd8b..e727919 100644
--- a/modules/ext.CollaborationKit.hubtheme.js
+++ b/modules/ext.CollaborationKit.hubtheme.js
@@ -223,8 +223,8 @@
 */
ImageProcessDialog.prototype.getActionProcess = function ( action ) {
var dialog, fileTitle;
-
dialog = this;
+   dialog.pushPending();
if ( action ) {
return new OO.ui.Process( function () {
var fileObj, fileUrl, fileHeight, fileTitleObj;
diff --git a/modules/ext.CollaborationKit.list.ui.js 
b/modules/ext.CollaborationKit.list.ui.js
index 26a0574..3ad6636 100644
--- a/modules/ext.CollaborationKit.list.ui.js
+++ b/modules/ext.CollaborationKit.list.ui.js
@@ -187,6 +187,8 @@
dialog = this,
titleObj;
 
+   dialog.pushPending();
+
if ( this.titleWidget instanceof mw.widgets.UserInputWidget ) {
titleObj = mw.Title.newFromText( 'User:' + title );
if ( titleObj ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/351746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafd1663f94d03cf059fec185e072aceac0cc1d59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Converting underscores to spaces when querying querycachetwo...

2017-05-02 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351569 )

Change subject: Converting underscores to spaces when querying querycachetwo 
and back again.
..

Converting underscores to spaces when querying querycachetwo and
back again.

I want to die.

Bug: T164160
Change-Id: I4b865c9b36385678cbd6e800120c4bb487564db3
---
M includes/content/CollaborationListContent.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/69/351569/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index c60c1c7..80fd221 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -1117,7 +1117,10 @@
 */
private function filterActiveUsers( $userList ) {
if ( count( $userList ) > 0 ) {
-   $users = array_keys( $userList );
+   $users = [];
+   foreach( array_keys( $userList ) as $user ) {
+   $users[] = str_replace( '_', ' ', $user );
+   }
$dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'querycachetwo',
@@ -1133,7 +1136,7 @@
 
$active = [];
foreach ( $res as $row ) {
-   $active[$row->qcc_title] = 
$userList[$row->qcc_title];
+   $active[$row->qcc_title] = 
$userList[str_replace( ' ', '_', $row->qcc_title )];
unset( $userList[$row->qcc_title] );
}
return [ 'active' => $active, 'inactive' => $userList ];

-- 
To view, visit https://gerrit.wikimedia.org/r/351569
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b865c9b36385678cbd6e800120c4bb487564db3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Prevent CreateCollaborationHub and CreateHubFeature from bei...

2017-04-29 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351097 )

Change subject: Prevent CreateCollaborationHub and CreateHubFeature from being 
shown to those who cannot create pages.
..

Prevent CreateCollaborationHub and CreateHubFeature from being shown
to those who cannot create pages.

Change-Id: I507acec92d29a871d4e0df7a9db43cc01dfbe746
---
M includes/SpecialCreateCollaborationHub.php
M includes/SpecialCreateHubFeature.php
2 files changed, 12 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/97/351097/1

diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 321fab6..51c4261 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -25,6 +25,10 @@
 * @param $par string
 */
public function execute( $par ) {
+   if ( !$this->getUser()->isAllowed( 'createpage' ) ) {
+   throw new PermissionsError( 'createpage' );
+   }
+
$out = $this->getContext()->getOutput();
$out->addModules( [
'ext.CollaborationKit.hubtheme'
@@ -150,11 +154,7 @@
return Status::newFatal( 
'collaborationkit-createhub-nopermission' );
}
 
-   $title = Title::newFromText( $pagename );
-   if ( !$title ) {
-   return Status::newFatal( 
'collaborationkit-createhub-invalidtitle' );
-   }
-
+   // Create member list
$memberListTitle = Title::newFromText(
$pagename
. '/'
@@ -175,6 +175,7 @@
return $memberResult;
}
 
+   // Create announcements page
$announcementsTitle = Title::newFromText( $pagename
. '/'
. $this->msg( 
'collaborationkit-hub-pagetitle-announcements' )
@@ -184,7 +185,7 @@
if ( !$announcementsTitle ) {
return Status::newFatal( 
'collaborationkit-createhub-invalidtitle' );
}
-   // Ensure that a valid context is provided to the API in unit 
tests
+
$context = $this->getContext();
$der = new DerivativeContext( $context );
$request = new DerivativeRequest(
@@ -216,6 +217,7 @@
);
}
 
+   // Now, to create the hub itself
$result = CollaborationHubContentHandler::edit(
$title,
$data['display_name'],
diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index 12d75fc..6a486f4 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -21,6 +21,10 @@
 * @param string $par
 */
public function execute( $par ) {
+   if ( !$this->getUser()->isAllowed( 'createpage' ) ) {
+   throw new PermissionsError( 'createpage' );
+   }
+
$output = $this->getContext()->getOutput();
$output->addModules( 'ext.CollaborationKit.iconbrowser' );
$output->addModuleStyles( [

-- 
To view, visit https://gerrit.wikimedia.org/r/351097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I507acec92d29a871d4e0df7a9db43cc01dfbe746
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Check for parent page being a hub earlier in the process.

2017-04-29 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351095 )

Change subject: Check for parent page being a hub earlier in the process.
..

Check for parent page being a hub earlier in the process.

What was happening was that pages were being created, *then* it was
checking if the parent was a hub.

Change-Id: I250c2f880471b7299def3b923be1a2556673d568
---
M includes/SpecialCreateHubFeature.php
1 file changed, 13 insertions(+), 12 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/95/351095/1

diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index 8e20a6a..12d75fc 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -116,10 +116,21 @@
 */
public function onSubmit( array $data ) {
$collaborationHub = $data['collaborationhub'];
+   $hubTitleObject = Title::newFromText( $collaborationHub );
+
+   // This special page can only be used to create subpages of 
Collaboration
+   // Hubs. This checks if the parent page is one.
+
+   if ( !$hubTitleObject->exists() ) {
+   return Status::newFatal( 
'collaborationkit-createhubfeature-hubdoesnotexist' );
+   }
+
+   if ( $hubTitleObject->getContentModel() != 
'CollaborationHubContent' ) {
+   return Status::newFatal( 
'collaborationkit-createhubfeature-hubisnotahub' );
+   }
+
$featureName = $data['featurename'];
-
$titleText = $collaborationHub . '/' . $featureName;
-
$title = Title::newFromText( $titleText );
if ( !$title ) {
return Status::newFatal( 
'collaborationkit-createhubfeature-invalidtitle' );
@@ -197,16 +208,6 @@
 
if ( $data[ 'icon' ] ) {
$newFeature['image'] = $data[ 'icon' ];
-   }
-
-   $hubTitleObject = Title::newFromText( $collaborationHub );
-
-   if ( !$hubTitleObject->exists() ) {
-   return Status::newFatal( 
'collaborationkit-createhubfeature-hubdoesnotexist' );
-   }
-
-   if ( $hubTitleObject->getContentModel() != 
'CollaborationHubContent' ) {
-   return Status::newFatal( 
'collaborationkit-createhubfeature-hubisnotahub' );
}
 
$hubWikiPageObject = WikiPage::factory( $hubTitleObject );

-- 
To view, visit https://gerrit.wikimedia.org/r/351095
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I250c2f880471b7299def3b923be1a2556673d568
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Change JS list editor to use numeric indices instead of titles.

2017-04-29 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351094 )

Change subject: Change JS list editor to use numeric indices instead of titles.
..

Change JS list editor to use numeric indices instead of titles.

A page title could be included on a list multiple times, and this
causes issues with the JS list editor. This change assigns "item
IDs" to each list item, based on the column and item index, and
changes all list editor behavior to use those instead of the page
title.

Change-Id: I01af89264c59f943274c422b630b1f9fb09622ca
---
M extension.json
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.ui.js
4 files changed, 105 insertions(+), 101 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/94/351094/1

diff --git a/extension.json b/extension.json
index 9a9f0ac..005c968 100644
--- a/extension.json
+++ b/extension.json
@@ -197,6 +197,7 @@
"collaborationkit-list-delete-summary",
"collaborationkit-list-delete-popup",
"collaborationkit-list-delete-popup-title",
+   "collaborationkit-list-error-editconflict",
"collaborationkit-list-error-saving",
"collaborationkit-list-move",
"collaborationkit-list-move-summary",
diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index c60c1c7..871665f 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -342,6 +342,7 @@
$sortedItems = $column->items;
$this->sortList( $sortedItems, $options['defaultSort'] 
);
 
+   $itemCounter = 0;
foreach ( $sortedItems as $item ) {
if ( $offset !== 0 ) {
$offset--;
@@ -366,8 +367,10 @@
$text .= Html::openElement( 'div', [
'style' => "min-height:{$iconWidth}px",
'class' => 'mw-ck-list-item',
-   'data-collabkit-item-title' => 
$item->title
+   'data-collabkit-item-title' => 
$item->title,
+   'data-collabkit-item-id' => $colId . 
'-' . $itemCounter
] );
+   $itemCounter++;
if ( $options['mode'] !== 'no-img' ) {
if ( isset( $item->image ) ) {
$text .= static::generateImage(
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 8865022..d1409bd 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -4,7 +4,7 @@
 ( function ( $, mw ) {
'use strict';
 
-   var deleteItem, getCurrentJson, saveJson, reorderList, getListOfTitles, 
getColId;
+   var deleteItem, getCurrentJson, saveJson, reorderList, getListOfItems, 
getColId, renumberElements;
 
/**
 * Retrieves ID number of column
@@ -24,13 +24,28 @@
};
 
/**
+* Renumbers the item IDs within a column following a re-ordering or a 
deletion
+*
+* @param {number} colId the column in which to re-number the items
+*/
+   renumberElements = function ( colId ) {
+   $( '.mw-ck-list-column[ data-collabkit-column-id=' + colId + ' 
] .mw-ck-list-item' )
+   .each( function ( index ) {
+   $( this ).data( 'collabkit-item-id', colId + 
'-' + index );
+   } );
+   }
+
+   /**
 * Deletes an item from the list
 *
 * @param {jQuery} $item
 */
deleteItem = function ( $item ) {
-   var spinner,
+   var i,
+   oldItems,
+   spinner,
title = $item.data( 'collabkit-item-title' ),
+   itemId = $item.data( 'collabkit-item-id' ),
colId = getColId( $item );
 
if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) ) {
@@ -48,12 +63,13 @@
 
getCurrentJson( mw.config.get( 'wgArticleId' ), function ( res 
) {
var newItems = [];
-   $.each( res.content.columns[ colId ].items, function ( 
index ) {
-   if ( this.title === title ) {
-   

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Bringing border colors back to the edit form

2017-04-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350922 )

Change subject: Bringing border colors back to the edit form
..

Bringing border colors back to the edit form

Change-Id: Ida43027c705b91acdaf316afa10fdd9b37dbddf5
---
M modules/ext.CollaborationKit.edit.styles.less
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/22/350922/1

diff --git a/modules/ext.CollaborationKit.edit.styles.less 
b/modules/ext.CollaborationKit.edit.styles.less
index 92cd6bb..e9781f3 100644
--- a/modules/ext.CollaborationKit.edit.styles.less
+++ b/modules/ext.CollaborationKit.edit.styles.less
@@ -23,7 +23,7 @@
 .ck-customeditor-borders( @color ) {
.mw-collabkit-modifiededitform {
padding: 1.5em 1em;
-   border: 1px solid;
+   border: 1px solid @color;
border-top-width: 3px;
border-bottom-width: 4px;
background-color: fadeout( @color, 95% );

-- 
To view, visit https://gerrit.wikimedia.org/r/350922
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida43027c705b91acdaf316afa10fdd9b37dbddf5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Properly embedding interface messages in forms.

2017-04-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350912 )

Change subject: Properly embedding interface messages in forms.
..

Properly embedding interface messages in forms.

'placeholder' --> 'placeholder-message'

Change-Id: I855e0fb30710928309faf5d4ff1b3a03337bba3b
---
M includes/CollaborationHubContentEditor.php
M includes/CollaborationListContentEditor.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/12/350912/1

diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index bed2af3..6011fa6 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -95,7 +95,7 @@
'type' => 'textarea',
'cssclass' => 'mw-ck-introduction-input',
'label-message' => 
'collaborationkit-hubedit-introduction',
-   'placeholder' => 
'collaborationkit-hubedit-introduction-placeholder',
+   'placeholder-message' => 
'collaborationkit-hubedit-introduction-placeholder',
'name' => 'wpCollabHubIntroduction',
'default' => $parts[1],
'rows' => 8,
diff --git a/includes/CollaborationListContentEditor.php 
b/includes/CollaborationListContentEditor.php
index c7b44cf..f335979 100644
--- a/includes/CollaborationListContentEditor.php
+++ b/includes/CollaborationListContentEditor.php
@@ -54,7 +54,7 @@
'type' => 'textarea',
'cssclass' => 'mw-ck-introduction-input',
'label-message' => 
'collaborationkit-listedit-description',
-   'placeholder' => 
'collaborationkit-listedit-description-placeholder',
+   'placeholder-message' => 
'collaborationkit-listedit-description-placeholder',
'name' => 'wpCollabListDescription',
'default' => $parts[0],
'rows' => 4,

-- 
To view, visit https://gerrit.wikimedia.org/r/350912
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I855e0fb30710928309faf5d4ff1b3a03337bba3b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Change how addSelf function works

2017-04-27 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350794 )

Change subject: Change how addSelf function works
..

Change how addSelf function works

Before, I had it do an API lookup to get a URL. This added a lot
of complication to the process and it turns out I can synthesize
the URL myself using the page ID. So I got rid of all that and
made the process a lot more efficient.

Bug: T163410
Change-Id: I146caa1f9574ea1e2f04d1e8315fed4c331565fc
---
M modules/ext.CollaborationKit.list.members.js
1 file changed, 8 insertions(+), 20 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/94/350794/1

diff --git a/modules/ext.CollaborationKit.list.members.js 
b/modules/ext.CollaborationKit.list.members.js
index 67cc895..444cc24 100644
--- a/modules/ext.CollaborationKit.list.members.js
+++ b/modules/ext.CollaborationKit.list.members.js
@@ -53,9 +53,8 @@
 * One-click project-joining button
 *
 * @param {number} destinationPage Page ID of member list, if different 
from current page
-* @param {string} destinationUrl Full URL of member list, if different 
from current page
 */
-   addSelf = function ( destinationPage, destinationUrl ) {
+   addSelf = function ( destinationPage ) {
if ( destinationPage === undefined ) {
destinationPage = mw.config.get( 'wgArticleId' );
}
@@ -84,11 +83,7 @@
res.content.columns[ 0 ].items[ index ] = itemToAdd;
res.summary = mw.msg( 
'collaborationkit-list-add-self-summary', itemToAdd.title );
LE.saveJson( res, function () {
-   if ( destinationUrl === undefined ) {
-   location.reload();
-   } else {
-   window.location = destinationUrl;
-   }
+   window.location.href = 
'index.php?curid=' + destinationPage;
} );
} );
 
@@ -102,21 +97,14 @@
if ( mw.config.get( 'wgCollaborationKitAssociatedMemberList' ) 
&& !mw.user.isAnon() ) {
memberListPage = mw.config.get( 
'wgCollaborationKitAssociatedMemberList' );
curUserIsInList( memberListPage ); // removes Join 
button if user already is member
-   new mw.Api().get( {
-   action: 'query',
-   prop: 'info',
-   inprop: 'url',
-   pageids: memberListPage
-   } ).done( function ( data ) {
-   var memberListUrl = data.query.pages[ 
memberListPage ].fullurl;
-   $( '.mw-ck-members-join a' )
-   .attr( 'href', memberListUrl );
 
-   $( '.mw-ck-members-join' ).on( 'click', 
function () {
-   addSelf( memberListPage, memberListUrl 
);
-   } );
+   $( '.mw-ck-members-join a' )
+   .attr( 'href', '#' );
+
+   $( '.mw-ck-members-join' ).on( 'click', function () {
+   addSelf( memberListPage );
} );
-   }
+   };
 
if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) &&
!curUserIsInList() && !mw.user.isAnon()  // Workflow 
assumes existence of username

-- 
To view, visit https://gerrit.wikimedia.org/r/350794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I146caa1f9574ea1e2f04d1e8315fed4c331565fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Correctly invoking the name of a message

2017-04-27 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350790 )

Change subject: Correctly invoking the name of a message
..

Correctly invoking the name of a message

Also a nitpick involving defining a variable in the middle of a
function.

Change-Id: I79c4d1678c8a20a09d8e7d17aaf5c100b9be9f16
---
M extension.json
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.members.js
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/90/350790/1

diff --git a/extension.json b/extension.json
index 59b8d64..9a9f0ac 100644
--- a/extension.json
+++ b/extension.json
@@ -197,6 +197,7 @@
"collaborationkit-list-delete-summary",
"collaborationkit-list-delete-popup",
"collaborationkit-list-delete-popup-title",
+   "collaborationkit-list-error-saving",
"collaborationkit-list-move",
"collaborationkit-list-move-summary",
"collaborationkit-list-move-popup",
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 79d9f7c..8865022 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -288,7 +288,7 @@
basetimestamp: params.timestamp
} ).done( callback ).fail( function () {
// FIXME proper error handling.
-   alert( 'collaborationkit-list-error-saving' );
+   alert( mw.msg( 'collaborationkit-list-error-saving' ) );
} );
};
 
diff --git a/modules/ext.CollaborationKit.list.members.js 
b/modules/ext.CollaborationKit.list.members.js
index 67cc895..4f15cd7 100644
--- a/modules/ext.CollaborationKit.list.members.js
+++ b/modules/ext.CollaborationKit.list.members.js
@@ -95,7 +95,7 @@
};
 
$( function () {
-   var memberListPage, list;
+   var memberListPage, memberListUrl, list;
// Workflow assumes existence of username, so we filter against 
it
// However, since !curUserIsInList, the button will still 
render. It will just use no-JS
// behavior instead.
@@ -108,7 +108,7 @@
inprop: 'url',
pageids: memberListPage
} ).done( function ( data ) {
-   var memberListUrl = data.query.pages[ 
memberListPage ].fullurl;
+   memberListUrl = data.query.pages[ 
memberListPage ].fullurl;
$( '.mw-ck-members-join a' )
.attr( 'href', memberListUrl );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/350790
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79c4d1678c8a20a09d8e7d17aaf5c100b9be9f16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Properly instantiating object to call method.

2017-04-27 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350519 )

Change subject: Properly instantiating object to call method.
..

Properly instantiating object to call method.

Bug: T163409
Change-Id: I65ef533eea93a3bd65bd8b61dadf39a22ece41d1
---
M includes/SpecialCreateHubFeature.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/19/350519/1

diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index 53a1516..e27a95a 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -153,8 +153,9 @@
// something such as JSON.
$initialContent = '';
if ( $contentModel == 'CollaborationListContent' ) {
-   $initialContent = 
CollaborationListContentHandler::serializeContent(
-   
CollaborationListContentHandler::makeEmptyContent()
+   $contentModelObj = ContentHandler::getForModelID( 
$contentModel ); // I recommend renaming $contentModel to $contentModelID BTW
+   $initialContent = $contentModelObj->serializeContent(
+   $contentModelObj->makeEmptyContent()
);
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/350519
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65ef533eea93a3bd65bd8b61dadf39a22ece41d1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Switching hub feature edit order and adding purge button

2017-03-20 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343801 )

Change subject: Switching hub feature edit order and adding purge button
..

Switching hub feature edit order and adding purge button

Bug: T160879
Change-Id: I6edf80fca99d8004c168ee4ccb7e7db0ae4013ff
---
M i18n/en.json
M i18n/qqq.json
M includes/SpecialCreateHubFeature.php
M includes/content/CollaborationHubContent.php
4 files changed, 69 insertions(+), 61 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/01/343801/1

diff --git a/i18n/en.json b/i18n/en.json
index 47258de..c5cbdbe 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -72,8 +72,9 @@
"collaborationkit-hub-members-header": "Meet our members!",
"collaborationkit-hub-members-signup": "Join",
"collaborationkit-hub-members-view": "View full list",
-   "collaborationkit-hub-missingpage-note": "This feature does not exist. 
You can create a new feature using the button below.",
+   "collaborationkit-hub-missingpage-note": "This feature does not exist. 
You can create a new feature using the button below. If you just created the 
feature and you're still seeing this message, try purging the cache.",
"collaborationkit-hub-missingpage-create": "Create feature",
+   "collaborationkit-hub-missingpage-purgecache": "Purge cache",
"collaborationkit-hub-pagetitle-members": "Members",
"collaborationkit-hub-pagetitle-announcements": "Announcements",
"collaborationkit-hub-subpage-view": "View page",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1fbaa1e..6f943e4 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -77,6 +77,7 @@
"collaborationkit-hub-members-view": "Label for the 'view all' button 
in the members block",
"collaborationkit-hub-missingpage-note": "Note and helpt text for 
missing feature sections (subpages) on a collaboration hub mainpage",
"collaborationkit-hub-missingpage-create": "Button label for creating a 
new feature (subpage)",
+   "collaborationkit-hub-missingpage-purgecache": "Button for purging page 
cache",
"collaborationkit-hub-pagetitle-members": "The title of the /Members 
subpage for a Collaboration Hub (without the leading 
slash)\n{{Identical|Member}}",
"collaborationkit-hub-pagetitle-announcements": "The title of the 
/Announcements subpage for a Collaboration Hub (without the leading 
slash)\n{{Identical|Announcement}}",
"collaborationkit-hub-subpage-view": "View link label for subpages on 
Collaboration Hub mainpages\n{{Identical|View page}}",
diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index e18fe11..d5b90f6 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -129,6 +129,63 @@
return Status::newFatal( 
'collaborationkit-createhubfeature-nopermission' );
}
 
+   // Create feature
+   $contentModel = $data[ 'contenttype' ];
+   if ( $contentModel != 'wikitext'
+   && $contentModel != 'CollaborationListContent' )
+   {
+   return Status::newFatal( 
'collaborationkit-createhubfeature-invalidcontenttype' );
+   }
+
+   if ( $contentModel == 'wikitext' ) {
+   $contentFormat = 'text/x-wiki';
+   } elseif ( $contentModel == 'CollaborationListContent' ) {
+   $contentFormat = 'application/json';
+   } else {
+   return Status::newFatal( 
'collaborationkit-createhubfeature-invalidcontenttype' );
+   }
+
+   // Create empty page by default; exception is if there needs to 
be
+   // something such as JSON.
+   $initialContent = '';
+   if ( $contentModel == 'CollaborationListContent' ) {
+   $initialContent = 
CollaborationListContentHandler::serializeContent(
+   
CollaborationListContentHandler::makeEmptyContent()
+   );
+   }
+
+   $summary = $this
+   ->msg( 'collaborationkit-createhubfeature-editsummary' )
+   ->plain();
+
+   $context = $this->getContext();
+   $der = new DerivativeContext( $context );
+   $request = new DerivativeRequest(
+   $context->getRequest(),
+   [
+   'action' => 'edit',
+   'title' => $title->getFullText(),
+   'contentmodel' => $contentModel,
+   'contentformat' => $contentFormat,
+   'text' => $initialContent,
+   'summary' => 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Clarifying interface message.

2017-03-20 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343792 )

Change subject: Clarifying interface message.
..

Clarifying interface message.

Currently, there is no way (within this particular UI) to select
anything other than a pre-included icon.

Bug: T160880
Change-Id: I156acbbaca2269c5ec5bbac5687d748d490067bb
---
M i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/92/343792/1

diff --git a/i18n/en.json b/i18n/en.json
index 47258de..faf3db5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -129,6 +129,6 @@
"collaborationkit-hubedit-footer-help": "Appears beneath the included 
features. Recommended location for categories, navigation templates, etc.",
"collaborationkit-hubedit-content-help": "list of (sub)pages to include 
in the project, delineated by linebreaks. Use the full page name.",
"collaborationkit-listedit-description-placeholder": "Describe what the 
list is about or for.",
-   "collaborationkit-listedit-list-help": "Custom syntax is used for bulk 
editing. Essentially, one item for line, with different columns marked by 
several hyphens. See [[Help:CollaborationLists]] for more information.",
-   "collaborationkit-createhubfeature-icon-help": "Icon can be one of the 
included icons, or any image on-wiki."
+   "collaborationkit-listedit-list-help": "Custom syntax is used for bulk 
editing. Essentially, one item for line, with different columns marked by 
several hyphens. See [[Help:Extension:CollaborationKit]] for more information.",
+   "collaborationkit-createhubfeature-icon-help": "Please choose from the 
included icons."
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/343792
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I156acbbaca2269c5ec5bbac5687d748d490067bb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Create Special:CollaborationKitIcons

2017-03-20 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343786 )

Change subject: Create Special:CollaborationKitIcons
..

Create Special:CollaborationKitIcons

Bug: T160881
Change-Id: I43815d3d425636b9a191f3d71380cc1b93bd3587
---
M CollaborationKit.alias.php
M extension.json
M i18n/en.json
M i18n/qqq.json
A includes/SpecialCollaborationKitIcons.php
5 files changed, 69 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/86/343786/1

diff --git a/CollaborationKit.alias.php b/CollaborationKit.alias.php
index 51e9f23..b35840c 100644
--- a/CollaborationKit.alias.php
+++ b/CollaborationKit.alias.php
@@ -9,6 +9,7 @@
 
 /** English (English) */
 $specialPageAliases['en'] = [
+   'CollaborationKitIcons' => [ 'CollaborationKitIcons' ],
'CreateCollaborationHub' => [ 'CreateCollaborationHub' ],
'CreateHubFeature' => [ 'CreateHubFeature' ]
 ];
diff --git a/extension.json b/extension.json
index 92333f1..59b8d64 100644
--- a/extension.json
+++ b/extension.json
@@ -34,6 +34,7 @@
"CollaborationListContentEditor": 
"includes/CollaborationListContentEditor.php",
"SpecialCreateCollaborationHub": 
"includes/SpecialCreateCollaborationHub.php",
"SpecialCreateHubFeature": 
"includes/SpecialCreateHubFeature.php",
+   "SpecialCollaborationKitIcons": 
"includes/SpecialCollaborationKitIcons.php",
"ResourceLoaderListStyleModule": 
"includes/ResourceLoaderListStyleModule.php"
},
"ContentHandlers": {
@@ -53,6 +54,7 @@
}
},
"SpecialPages": {
+   "CollaborationKitIcons": "SpecialCollaborationKitIcons",
"CreateCollaborationHub": "SpecialCreateCollaborationHub",
"CreateHubFeature": "SpecialCreateHubFeature"
},
diff --git a/i18n/en.json b/i18n/en.json
index 47258de..3573027 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,6 +7,7 @@
]
},
"collaborationkit-desc": "Tools for building WikiProjects and on-wiki 
collaborative workspaces",
+   "collaborationkiticons": "CollaborationKit icon directory",
"createcollaborationhub": "Create new Collaboration Hub",
"createhubfeature": "Create a new Collaboration Hub feature",
"collaborationkit-createhub-title": "Page title",
@@ -28,6 +29,9 @@
"collaborationkit-createhubfeature-editsummary": "Creating new feature",
"collaborationkit-createhubfeature-freetext": "Generic wiki page",
"collaborationkit-createhubfeature-articlelist": "List of pages",
+   "collaborationkit-iconlist-intro": "These are the pre-packaged icons 
that can be used on Collaboration Hubs. Each icon name in the table corresponds 
to the keyword used in the Collaboration Hub editing interface to select the 
icon.",
+   "collaborationkit-iconlist-columnheader-icon": "Icon",
+   "collaborationkit-iconlist-columnheader-iconname": "Icon name",
"collaborationkit-list-isempty": "This list has no columns or items.",
"collaborationkit-list-emptycolumn": "This column has no items in it.",
"collaborationkit-list-invalid": "This content does not meet the 
requirements of the CollaborationListContent schema. This may happen as a 
result of a software update. The content is reproduced below.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1fbaa1e..65bc54c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -10,6 +10,7 @@
]
},
"collaborationkit-desc": 
"{{desc|name=CollaborationKit|url=https://www.mediawiki.org/wiki/Extension:CollaborationKit}};,
+   "collaborationkiticons": "Header for Special:CollaborationKitIcons",
"createcollaborationhub": "Header for Special:CreateCollaborationHub",
"createhubfeature": "Header for Special:CreateHubFeature. Hubs are the 
WikiProject pages as a whole, and \"features\" are the sections inside them.",
"collaborationkit-createhub-title": "Label for target page title input 
on Special:CreateCollaborationHub\n{{Identical|Page title}}",
@@ -31,6 +32,9 @@
"collaborationkit-createhubfeature-editsummary": "Edit summary used by 
Special:CreateHubFeature when creating a new feature",
"collaborationkit-createhubfeature-freetext": "Label for selecting 
content type in the Create Hub Feature form corresponding to freeform text 
(i.e. wikitext)",
"collaborationkit-createhubfeature-articlelist": "Label for selecting 
content type in the Create Hub Feature form corresponding to 
CollaborationListContent",
+   "collaborationkit-iconlist-intro": "Introductory text on 
Special:CollaborationKitIcons",
+   "collaborationkit-iconlist-columnheader-icon": "Column header in the 
table on Special:CollaborationKitIcons",
+   

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding message strings for colours

2017-03-05 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341265 )

Change subject: Adding message strings for colours
..

Adding message strings for colours

Change-Id: Ie4491a8e45366160273694a14adc84963193f366
---
M includes/CollaborationHubContentEditor.php
M includes/SpecialCreateCollaborationHub.php
2 files changed, 18 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/65/341265/1

diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index b48d001..bed2af3 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -61,6 +61,15 @@
],
];
 
+   // Colour messages:
+   // collaborationkit-darkred, collaborationkit-red, 
collaborationkit-darkgrey,
+   // collaborationkit-lightgrey, collaborationkit-skyblue, 
collaborationkit-blue,
+   // collaborationkit-bluegrey, collaborationkit-navyblue, 
collaborationkit-darkblue,
+   // collaborationkit-aquamarine, collaborationkit-violet, 
collaborationkit-purple,
+   // collaborationkit-mauve, collaborationkit-lightmauve, 
collaborationkit-salmon,
+   // collaborationkit-orange, collaborationkit-yellow, 
collaborationkit-gold,
+   // collaborationkit-pastelyellow, collaborationkit-forestgreen,
+   // collaborationkit-brightgreen, collaborationkit-khaki, 
collaborationkit-black
$colours = [];
foreach ( CollaborationHubContent::getThemeColours() as $colour 
) {
$colours['collaborationkit-' . $colour] = $colour;
diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 7528058..3702ade 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -115,6 +115,15 @@
 * @return array
 */
protected function getOptions( $mapping ) {
+   // Colour messages:
+   // collaborationkit-darkred, collaborationkit-red, 
collaborationkit-darkgrey,
+   // collaborationkit-lightgrey, collaborationkit-skyblue, 
collaborationkit-blue,
+   // collaborationkit-bluegrey, collaborationkit-navyblue, 
collaborationkit-darkblue,
+   // collaborationkit-aquamarine, collaborationkit-violet, 
collaborationkit-purple,
+   // collaborationkit-mauve, collaborationkit-lightmauve, 
collaborationkit-salmon,
+   // collaborationkit-orange, collaborationkit-yellow, 
collaborationkit-gold,
+   // collaborationkit-pastelyellow, collaborationkit-forestgreen,
+   // collaborationkit-brightgreen, collaborationkit-khaki, 
collaborationkit-black
$options = [];
foreach ( $mapping as $msgKey => $option ) {
$options[$this->msg( $msgKey )->escaped()] = $option;

-- 
To view, visit https://gerrit.wikimedia.org/r/341265
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4491a8e45366160273694a14adc84963193f366
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding columns= as a parameter for {{#transcludelist}}

2017-03-03 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341112 )

Change subject: Adding columns= as a parameter for {{#transcludelist}}
..

Adding columns= as a parameter for {{#transcludelist}}

Behaves in the same way as tags= but for columns. The exception was
caused by "columns" being a valid option but not having its own
special handling. While this will technically work, in the docs we
should continue to prefer |column=|column= because that way we avoid
the follies of having the delimiter be something that could validly
show up as a column name ("Art+Feminism," for example).

Bug: T159398
Change-Id: Ief0e64b703218a74580fa934a00fe94219c9059e
---
M includes/content/CollaborationListContent.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/12/341112/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index ca61263..7aa9be5 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -982,6 +982,12 @@
$tagCount += count( $tagList );
} elseif ( $name === 'column' ) {
$options['columns'][] = $value;
+   } elseif ( $name === 'columns' ) {
+   $columnList = explode( '+', $value );
+   $columnCount = count( $columnList );
+   for ( $i = 0; $i < $columnCount; $i++ ) {
+   $options['columns'][] = $columnList[$i];
+   }
} elseif ( self::validateOption( $name, $value ) ) {
$options[$name] = $value;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/341112
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief0e64b703218a74580fa934a00fe94219c9059e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/docroot[master]: Adding CollaborationKit to doc.wikimedia.org portal

2017-03-03 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341098 )

Change subject: Adding CollaborationKit to doc.wikimedia.org portal
..

Adding CollaborationKit to doc.wikimedia.org portal

Change-Id: Ib526dec5ca28c0470d5e7c1b1e612616ca56f0ed
---
M org/wikimedia/doc/default.html
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/docroot 
refs/changes/98/341098/1

diff --git a/org/wikimedia/doc/default.html b/org/wikimedia/doc/default.html
index b4d7799..a2e1898 100644
--- a/org/wikimedia/doc/default.html
+++ b/org/wikimedia/doc/default.html
@@ -33,6 +33,12 @@
 
 MediaWiki extensions
 
+   CollaborationKit
+   
+   JavaScript
+   PHP
+   
+   
EventLogging
Flow
GuidedTour

-- 
To view, visit https://gerrit.wikimedia.org/r/341098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib526dec5ca28c0470d5e7c1b1e612616ca56f0ed
Gerrit-PatchSet: 1
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Configuration for JSDuck

2017-03-02 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340925 )

Change subject: Configuration for JSDuck
..

Configuration for JSDuck

Change-Id: I0ee0826a2fca3e5c2ac0ebb8b141f7188dd122b6
---
A jsduck.json
M package.json
2 files changed, 13 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/25/340925/1

diff --git a/jsduck.json b/jsduck.json
new file mode 100644
index 000..f0d47eb
--- /dev/null
+++ b/jsduck.json
@@ -0,0 +1,11 @@
+{
+   "--title": "TemplateData - CollaborationKit",
+   "--processes": "0",
+   "--warnings-exit-nonzero": true,
+   "--external": "OO.*",
+   "--output": "docs",
+   "--": [
+   "jsduck.external.js",
+   "modules"
+   ]
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index d6d0f28..13889a8 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,8 @@
 {
   "private": true,
   "scripts": {
-"test": "grunt test"
+"test": "grunt test",
+"doc": "jsduck"
   },
   "devDependencies": {
 "grunt": "0.4.5",

-- 
To view, visit https://gerrit.wikimedia.org/r/340925
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ee0826a2fca3e5c2ac0ebb8b141f7188dd122b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/config[master]: Merge branch 'master' of https://gerrit.wikimedia.org/r/inte...

2017-03-02 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340922 )

Change subject: Merge branch 'master' of 
https://gerrit.wikimedia.org/r/integration/config
..

Merge branch 'master' of https://gerrit.wikimedia.org/r/integration/config

Change-Id: I3a43f5c9a0b7cb03e1e4d6a8c8ac6da97ee82d26
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/22/340922/1


-- 
To view, visit https://gerrit.wikimedia.org/r/340922
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a43f5c9a0b7cb03e1e4d6a8c8ac6da97ee82d26
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] integration/config[master]: Adding Doxygen and JSDuck postmerge jobs for CollaborationKit

2017-03-02 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340921 )

Change subject: Adding Doxygen and JSDuck postmerge jobs for CollaborationKit
..

Adding Doxygen and JSDuck postmerge jobs for CollaborationKit

Change-Id: I4f9230089053d7b39ace00840bd8a3792d0a62c1
---
M zuul/layout.yaml
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/21/340921/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index c048171..e5db5f9 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -3037,6 +3037,9 @@
   - name: npm
 check:
   - jsonlint
+postmerge:
+  - mwext-doxygen-publish
+  - mwext-jsduck-publish
 
   - name: mediawiki/extensions/CollapsibleVector
 template:

-- 
To view, visit https://gerrit.wikimedia.org/r/340921
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f9230089053d7b39ace00840bd8a3792d0a62c1
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Making makeEmptyContent slightly more readable

2017-03-01 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340669 )

Change subject: Making makeEmptyContent slightly more readable
..

Making makeEmptyContent slightly more readable

Also making Special:CreateHubFeature recycle the content handler's
function for making empty content.

Change-Id: I205427c2d2a361f7067129ff87e09ca7a5f2a369
---
M includes/SpecialCreateHubFeature.php
M includes/content/CollaborationHubContentHandler.php
2 files changed, 12 insertions(+), 11 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/69/340669/1

diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index ecb1c28..7844c94 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -214,14 +214,9 @@
// something such as JSON.
$initialContent = '';
if ( $contentModel == 'CollaborationListContent' ) {
-   // FIXME why are we redefining this here? Can't we 
reuse something
-   // from collaborationlistcontenthandler, which already 
has default
-   // content?
-   $initialContent = '{ "displaymode": "normal",
-   "columns": [ { "items":[] } ],
-   "options":{},
-   "description":""
-   }';
+   $initialContent = 
CollaborationListContentHandler::serializeContent(
+   
CollaborationListContentHandler::makeEmptyContent()
+   );
}
 
$summary = $this
diff --git a/includes/content/CollaborationHubContentHandler.php 
b/includes/content/CollaborationHubContentHandler.php
index 1d42d21..594c0a6 100644
--- a/includes/content/CollaborationHubContentHandler.php
+++ b/includes/content/CollaborationHubContentHandler.php
@@ -84,9 +84,15 @@
 * @return CollaborationHubContent
 */
public function makeEmptyContent() {
-   return new CollaborationHubContent(
-   '{ "display_name": "", "introduction": "", "footer": 
"", "content": [] }'
-   );
+   $empty = <

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Creation of CollaborationKitSerialization class

2017-03-01 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340666 )

Change subject: Creation of CollaborationKitSerialization class
..

Creation of CollaborationKitSerialization class

Four different classes have functions to do the same thing of sticking
wedges of content between a bunch of hyphens. This centralizes that
into one class.

The process to get the native form back remains in their respective
classes since it's so different for each.

Change-Id: I34c33a5c8311183e42452a3c9f23dc95ca9561f7
---
M includes/CollaborationHubContentEditor.php
M includes/CollaborationListContentEditor.php
M includes/content/CollaborationHubContent.php
A includes/content/CollaborationKitSerialization.php
M includes/content/CollaborationListContent.php
M tests/phpunit/CollaborationHubContentTest.php
M tests/phpunit/CollaborationListContentTest.php
7 files changed, 77 insertions(+), 50 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/66/340666/1

diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index 8b9919e..b48d001 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -149,7 +149,7 @@
}
 
$parts = explode(
-   CollaborationHubContent::HUMAN_DESC_SPLIT,
+   CollaborationKitSerialization::SERIALIZATION_SPLIT,
$this->textbox1,
6
);
@@ -217,16 +217,13 @@
$colour = trim( $request->getText( 'wpCollabHubColour', '' ) );
$content = trim( $request->getText( 'wpCollabHubContent', '' ) 
);
 
-   return $displayname
-   . CollaborationHubContent::HUMAN_DESC_SPLIT
-   . $introduction
-   . CollaborationHubContent::HUMAN_DESC_SPLIT
-   . $footer
-   . CollaborationHubContent::HUMAN_DESC_SPLIT
-   . $image
-   . CollaborationHubContent::HUMAN_DESC_SPLIT
-   . $colour
-   . CollaborationHubContent::HUMAN_DESC_SPLIT
-   . $content;
+   return CollaborationKitSerialization::getSerialization( [
+   $displayname,
+   $introduction,
+   $footer,
+   $image,
+   $colour,
+   $content
+   ] );
}
 }
diff --git a/includes/CollaborationListContentEditor.php 
b/includes/CollaborationListContentEditor.php
index 4d9f37e..c7b44cf 100644
--- a/includes/CollaborationListContentEditor.php
+++ b/includes/CollaborationListContentEditor.php
@@ -33,7 +33,7 @@
}
 
$parts = explode(
-   CollaborationListContent::HUMAN_DESC_SPLIT,
+   CollaborationKitSerialization::SERIALIZATION_SPLIT,
$this->textbox1,
3
);
@@ -103,10 +103,11 @@
}
$main = trim( $request->getText( 'wpCollabListContent', '' ) );
$options = $request->getText( 'wpCollaborationKitOptions', '' );
-   return $desc
-   . CollaborationListContent::HUMAN_DESC_SPLIT
-   . $options
-   . CollaborationListContent::HUMAN_DESC_SPLIT
-   . $main;
+
+   return CollaborationKitSerialization::getSerialization( [
+   $desc,
+   $options,
+   $main
+   ] );
}
 }
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 727f214..eb969d1 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -15,8 +15,6 @@
 
 class CollaborationHubContent extends JsonContent {
 
-   const HUMAN_DESC_SPLIT = "\n---\n";
-
/** @var string */
protected $displayName;
 
@@ -925,19 +923,14 @@
 */
public function convertToHumanEditable() {
$this->decode();
-
-   $output = $this->displayName;
-   $output .= self::HUMAN_DESC_SPLIT;
-   $output .= $this->introduction;
-   $output .= self::HUMAN_DESC_SPLIT;
-   $output .= $this->footer;
-   $output .= self::HUMAN_DESC_SPLIT;
-   $output .= $this->image;
-   $output .= self::HUMAN_DESC_SPLIT;
-   $output .= $this->themeColour;
-   $output .= self::HUMAN_DESC_SPLIT;
-   $output .= $this->getHumanEditableContent();
-   return $output;
+

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing sortUsersIntoColumns documentation

2017-03-01 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340662 )

Change subject: Fixing sortUsersIntoColumns documentation
..

Fixing sortUsersIntoColumns documentation

I var_dumped and it turns out that it is an object "items" => array,
with the array being an array of objects.

Change-Id: I30d67c85ab487fdcd7cfcb4b13a039cbf4912033
---
M includes/content/CollaborationListContent.php
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/62/340662/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index ca61263..d538ba0 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -1026,10 +1026,11 @@
/**
 * Sort users into active/inactive column
 *
-* @param array $column An array containing key items, which
-*  is an array of stdClass's representing each list item.
-*  Each of these has a key named title which contains
-*  a user name (including namespace). May have non-users too.
+* @param stdClass $column An object representing the one column 
containing
+*  the list of members of a given project. The object contains an 
attribute
+*  "items" with a value of an array of objects representing individual 
list
+*  items. Each of these has a key named title which contains a user 
name
+*  (including namespace). May have non-users too.
 * @return array Two column structure sorted active/inactive.
 * @todo Should link property be taken into account as actual name?
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/340662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30d67c85ab487fdcd7cfcb4b13a039cbf4912033
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Replacing UsageException with ApiUsageException

2017-03-01 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340660 )

Change subject: Replacing UsageException with ApiUsageException
..

Replacing UsageException with ApiUsageException

UsageException is deprecated in MediaWiki 1.29 in favor of
AptiUsageException

Change-Id: I98062e9c1a7a06a1bf8c78cb3520ae13bb4e667d
---
M includes/SpecialCreateCollaborationHub.php
M includes/SpecialCreateHubFeature.php
M includes/content/CollaborationHubContentHandler.php
M includes/content/CollaborationListContentHandler.php
4 files changed, 5 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/60/340660/1

diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 7829849..7528058 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -205,7 +205,7 @@
try {
$api = new ApiMain( $der, true );
$api->execute();
-   } catch ( UsageException $e ) {
+   } catch ( ApiUsageException $e ) {
return Status::newFatal(
$context->msg( 
'collaborationkit-hub-edit-apierror',
$e->getCodeString() )
diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index ecb1c28..434fd6e 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -184,7 +184,7 @@
try {
$api = new ApiMain( $der, true );
$api->execute();
-   } catch ( UsageException $e ) {
+   } catch ( ApiUsageException $e ) {
return Status::newFatal(
$context->msg(

'collaborationkit-hub-edit-apierror',
@@ -247,7 +247,7 @@
try {
$api = new ApiMain( $der, true );
$api->execute();
-   } catch ( UsageException $e ) {
+   } catch ( ApiUsageException $e ) {
return Status::newFatal(
$context->msg(
'collaborationkit-hub-edit-apierror',
diff --git a/includes/content/CollaborationHubContentHandler.php 
b/includes/content/CollaborationHubContentHandler.php
index 1d42d21..6238ccf 100644
--- a/includes/content/CollaborationHubContentHandler.php
+++ b/includes/content/CollaborationHubContentHandler.php
@@ -177,7 +177,7 @@
try {
$api = new ApiMain( $der, true );
$api->execute();
-   } catch ( UsageException $e ) {
+   } catch ( ApiUsageException $e ) {
return Status::newFatal(
$context->msg( 
'collaborationkit-hub-edit-apierror',
$e->getCodeString() ) );
diff --git a/includes/content/CollaborationListContentHandler.php 
b/includes/content/CollaborationListContentHandler.php
index 8000c1f..ca2838b 100644
--- a/includes/content/CollaborationListContentHandler.php
+++ b/includes/content/CollaborationListContentHandler.php
@@ -203,7 +203,7 @@
try {
$api = new ApiMain( $der, true );
$api->execute();
-   } catch ( UsageException $e ) {
+   } catch ( ApiUsageException $e ) {
return Status::newFatal(
$context->msg( 
'collaborationkit-hub-edit-apierror',
$e->getCodeString() )

-- 
To view, visit https://gerrit.wikimedia.org/r/340660
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98062e9c1a7a06a1bf8c78cb3520ae13bb4e667d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Restricting line length to ~80 characters

2017-03-01 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340574 )

Change subject: Restricting line length to ~80 characters
..

Restricting line length to ~80 characters

Change-Id: Ic300023c67b553a35ff12cba55024d3595dbfd05
---
M CollaborationKit.hooks.php
M includes/CollaborationHubContentEditor.php
M includes/CollaborationListContentEditor.php
M includes/SpecialCreateCollaborationHub.php
M includes/SpecialCreateHubFeature.php
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubContentHandler.php
M includes/content/CollaborationHubTOC.php
M includes/content/CollaborationKitImage.php
M includes/content/CollaborationListContent.php
M includes/content/CollaborationListContentHandler.php
11 files changed, 562 insertions(+), 214 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/74/340574/1

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index 4404754..085a13e 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -19,9 +19,12 @@
$title = $sktemplate->getTitle();
$request = $sktemplate->getRequest();
if ( isset( $links['views']['edit'] ) ) {
-   if ( $title->hasContentModel( 
'CollaborationListContent' ) || $title->hasContentModel( 
'CollaborationHubContent' ) ) {
+   if ( $title->hasContentModel( 
'CollaborationListContent' )
+   || $title->hasContentModel( 
'CollaborationHubContent' ) ) {
// Edit as JSON
-   $active = in_array( $request->getVal( 'action' 
), [ 'edit', 'submit' ] )
+   $active = in_array(
+   $request->getVal( 'action' ),
+   [ 'edit', 'submit' ] )
&& $request->getVal( 'format' ) === 
'application/json';
$links['actions']['editasjson'] = [
'class' => $active ? 'selected' : false,
@@ -29,18 +32,21 @@
$links['views']['edit']['href'],
[ 'format' => 
'application/json' ]
),
-   'text' => wfMessage( 
'collaborationkit-editjsontab' )->text()
+   'text' => wfMessage( 
'collaborationkit-editjsontab' )
+   ->text()
];
if ( $active ) {
// Make it not be selected when editing 
json.
$links['views']['edit']['class'] = 
false;
}
}
-   if ( !in_array( $request->getVal( 'action' ), [ 'edit', 
'submit' ] ) && $title->hasContentModel( 'CollaborationHubContent' ) ) {
+   if ( !in_array( $request->getVal( 'action' ), [ 'edit', 
'submit' ] ) 
+   && $title->hasContentModel( 
'CollaborationHubContent' ) ) {
// Add feature
$links['actions']['addnewfeature'] = [
'class' => '',
-   'href' => SpecialPage::getTitleFor( 
'CreateHubFeature' )->getFullURL( [ 'collaborationhub' => $title->getFullText() 
] ),
+   'href' => SpecialPage::getTitleFor( 
'CreateHubFeature' )
+   ->getFullURL( [ 
'collaborationhub' => $title->getFullText() ] ),
'text' => wfMessage( 
'collaborationkit-hub-addpage' )->text()
];
}
@@ -49,7 +55,8 @@
}
 
/**
-* Register the {{#transcludelist:...}} and 
 hooks
+* Register the {{#transcludelist:...}} and 

+* hooks
 *
 * #transcludelist is to allow users to transclude a CollaborationList 
with
 * custom options.  allows enabling our 
style
@@ -60,9 +67,15 @@
 * @param Parser $parser
 */
public static function onParserFirstCallInit( $parser ) {
-   $parser->setFunctionHook( 'transcludelist', 
'CollaborationListContent::transcludeHook' );
+   $parser->setFunctionHook(
+   'transcludelist',
+   'CollaborationListContent::transcludeHook'
+   );
// Hack for transclusion.
-   $parser->setHook( 'collaborationkitloadliststyles', 
'CollaborationListContent::loadStyles' );
+   

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Re-adding style change to ext.CollaborationKit.hub.styles.less

2017-02-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340442 )

Change subject: Re-adding style change to ext.CollaborationKit.hub.styles.less
..

Re-adding style change to ext.CollaborationKit.hub.styles.less

This change was approved in an earlier commit but accidentally taken
out. I am re-adding it.

Change-Id: I238341f6d506b3c20862033ed05c263c33536875
---
M modules/ext.CollaborationKit.hub.styles.less
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/42/340442/1

diff --git a/modules/ext.CollaborationKit.hub.styles.less 
b/modules/ext.CollaborationKit.hub.styles.less
index 8f5c16e..9ac5995 100644
--- a/modules/ext.CollaborationKit.hub.styles.less
+++ b/modules/ext.CollaborationKit.hub.styles.less
@@ -62,9 +62,13 @@
h2 {
display: inline;
margin: 0;
-   padding: 0 0 .25em;
+   padding: 0;
border-style: none;
}
+
+   .mw-ck-hub-section-main {
+   padding-top: .25em;
+   }
}
.mw-ck-hub-section-buttons {
display: inline;

-- 
To view, visit https://gerrit.wikimedia.org/r/340442
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I238341f6d506b3c20862033ed05c263c33536875
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding 'use strict' statements to JavaScript files

2017-02-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340439 )

Change subject: Adding 'use strict' statements to JavaScript files
..

Adding 'use strict' statements to JavaScript files

Change-Id: Ib7a89ce2d770554cd6c7063535262f7f0fb0b738
---
M modules/ext.CollaborationKit.hubtheme.js
M modules/ext.CollaborationKit.iconbrowser.js
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.members.js
M modules/ext.CollaborationKit.list.ui.js
5 files changed, 9 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/39/340439/1

diff --git a/modules/ext.CollaborationKit.hubtheme.js 
b/modules/ext.CollaborationKit.hubtheme.js
index de88c43..4ede07e 100644
--- a/modules/ext.CollaborationKit.hubtheme.js
+++ b/modules/ext.CollaborationKit.hubtheme.js
@@ -1,4 +1,6 @@
 ( function ( $, mw, OO ) {
+   'use strict';
+
var getColourBlock, getThumbnail, ImageProcessDialog, 
ColourProcessDialog, openColourBrowser, openImageBrowser, setupPage;
 
/**
diff --git a/modules/ext.CollaborationKit.iconbrowser.js 
b/modules/ext.CollaborationKit.iconbrowser.js
index f8c3112..3495a34 100644
--- a/modules/ext.CollaborationKit.iconbrowser.js
+++ b/modules/ext.CollaborationKit.iconbrowser.js
@@ -1,4 +1,6 @@
 ( function ( $, mw, OO ) {
+   'use strict';
+
var ProcessDialog, openItUp, setupPage;
 
/**
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 510c9b1..916e3d9 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -1,4 +1,6 @@
 ( function ( $, mw ) {
+   'use strict';
+
var deleteItem, getCurrentJson, saveJson, reorderList, getListOfTitles, 
getColId;
 
/**
diff --git a/modules/ext.CollaborationKit.list.members.js 
b/modules/ext.CollaborationKit.list.members.js
index 728217f..1649d1d 100644
--- a/modules/ext.CollaborationKit.list.members.js
+++ b/modules/ext.CollaborationKit.list.members.js
@@ -1,4 +1,5 @@
 ( function ( $, mw, OO ) {
+   'use strict';
 
var addSelf, curUserIsInList, LE;
 
diff --git a/modules/ext.CollaborationKit.list.ui.js 
b/modules/ext.CollaborationKit.list.ui.js
index a792af1..71cfaa0 100644
--- a/modules/ext.CollaborationKit.list.ui.js
+++ b/modules/ext.CollaborationKit.list.ui.js
@@ -1,4 +1,6 @@
 ( function ( $, mw, OO ) {
+   'use strict';
+
var addItem, modifyItem, modifyExistingItem, LE;
 
LE = require( 'ext.CollaborationKit.list.edit' );

-- 
To view, visit https://gerrit.wikimedia.org/r/340439
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7a89ce2d770554cd6c7063535262f7f0fb0b738
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Removing unimplemented/commented-out code

2017-02-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340437 )

Change subject: Removing unimplemented/commented-out code
..

Removing unimplemented/commented-out code

They will possibly be implemented at a later date but in the meantime
it is not necessary to keep them in the master branch.

Change-Id: Iaacf5ea405119d03146a6712fc7d91b1eea4f9d9
---
D includes/ApiEditCollaborationHub.php
M includes/content/CollaborationHubContentHandler.php
D includes/content/CollaborationHubDiffEngine.php
M includes/content/CollaborationListContentHandler.php
4 files changed, 0 insertions(+), 66 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/37/340437/1

diff --git a/includes/ApiEditCollaborationHub.php 
b/includes/ApiEditCollaborationHub.php
deleted file mode 100644
index 5fddd6d..000
--- a/includes/ApiEditCollaborationHub.php
+++ /dev/null
@@ -1,14 +0,0 @@
-extractRequestParams();
-   }
-
-   // TODO Implement this
-}
diff --git a/includes/content/CollaborationHubContentHandler.php 
b/includes/content/CollaborationHubContentHandler.php
index 29a9181..144ea14 100644
--- a/includes/content/CollaborationHubContentHandler.php
+++ b/includes/content/CollaborationHubContentHandler.php
@@ -91,13 +91,6 @@
}
 
/**
-* @return string
-*/
-   /*protected function getDiffEngineClass() {
-   return 'CollaborationHubDiffEngine';
-   }*/
-
-   /**
 * @return bool
 */
public function isParserCacheSupported() {
diff --git a/includes/content/CollaborationHubDiffEngine.php 
b/includes/content/CollaborationHubDiffEngine.php
deleted file mode 100644
index 2ef7055..000
--- a/includes/content/CollaborationHubDiffEngine.php
+++ /dev/null
@@ -1,32 +0,0 @@
-https://gerrit.wikimedia.org/r/340437
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaacf5ea405119d03146a6712fc7d91b1eea4f9d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Removing commented out functions from SpecialCreateCollabora...

2017-02-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340427 )

Change subject: Removing commented out functions from 
SpecialCreateCollaborationHub
..

Removing commented out functions from SpecialCreateCollaborationHub

Implementation of the import-related features is long-deferred,
and we do not quite know what the UI for it will be, so removing
it in the meantime.

Change-Id: I6d25553a42bc5235e00a626581be90c0b4586f67
---
M includes/SpecialCreateCollaborationHub.php
1 file changed, 0 insertions(+), 48 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/27/340427/1

diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 73a534c..4790a68 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -91,27 +91,6 @@
'default' => 'lightgrey'
];
 
-   /* Comment this out until it's actually implemented (T135408)
-   // Content source options
-   $fields['content_source'] = [
-   'type' => 'select',
-   'options' => $this->getOptions( [
-   'collaborationkit-createhub-new' => 'new',
-   'collaborationkit-createhub-import' => 'import',
-   'collaborationkit-createhub-clone' => 'clone',
-   ] ),
-   'default' => 'new', // might want to change default to 
clone from the default? (TODO add a canned default as example and stuff: 
T136470)
-   'label-message' => 'collaborationkit-createhub-content',
-   'cssclass' => 'mw-ck-source-options-input'
-   ];
-   $fields['source'] = [
-   'type' => 'text',
-   'label-message' => 'collaborationkit-createhub-source',
-   'hide-if' => [ '===', 'wpcontent_source', 'new' ],
-   'cssclass' => 'mw-ck-source-input'
-   ];
-   */
-
$fields['introduction'] = [
'type' => 'textarea',
'rows' => 5,
@@ -159,33 +138,6 @@
) {
return Status::newFatal( 
'collaborationkit-createhub-nopermission' );
}
-
-   /* Comment this out until it's actually implemented (T135408)
-   // ACTUAL STUFF HERE
-   if ( $data['content_source'] !== 'new' ) { // Importing from 
wikitext
-   $source = Title::newFromText( $data['source'] );
-   if ( !$source ) {
-   return Status::newFatal( 
'collaborationkit-createhub-invalidsource' );
-   }
-
-   if ( $data['content_source'] === 'clone' ) {
-   // Copy another hub
-   // Just copy some of the bits...
-
-   // TODO prefill the actual content
-   } elseif ( $data['content_source'] === 'import' ) {
-   // Do some magic based on the source:
-   // If wikiproject x project: get module list, 
recreate modules
-   // If regular page: pull headers
-
-   // TODO prefill the actual content
-   }
-   // Render preview?
-   } else {
-
-   // ...?
-   }
-   */
 
$title = Title::newFromText( $pagename );
if ( !$title ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/340427
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d25553a42bc5235e00a626581be90c0b4586f67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Removing duplicate implementations of escape/unescapeForHuma...

2017-02-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340425 )

Change subject: Removing duplicate implementations of 
escape/unescapeForHumanEditable functions
..

Removing duplicate implementations of escape/unescapeForHumanEditable functions

Change-Id: I03a667fedc638647e5bf2c814d6220c7bb899869
---
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationListContent.php
2 files changed, 14 insertions(+), 53 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/25/340425/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 1fb55df..c64666d 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -824,12 +824,12 @@
 
$out = '';
foreach ( $this->content as $item ) {
-   $out .= $this->escapeForHumanEditable( $item['title'] );
+   $out .= self::escapeForHumanEditable( $item['title'] );
if ( isset ( $item['image'] ) ) {
-   $out .= '|image=' . 
$this->escapeForHumanEditable( $item['image'] );
+   $out .= '|image=' . 
self::escapeForHumanEditable( $item['image'] );
}
if ( isset( $item['displayTitle'] ) ) {
-   $out .= '|display_title=' . 
$this->escapeForHumanEditable( $item['displayTitle'] );
+   $out .= '|display_title=' . 
self::escapeForHumanEditable( $item['displayTitle'] );
}
if ( substr( $out, -1 ) === '|' ) {
$out = substr( $out, 0, strlen( $out ) - 1 );
@@ -848,7 +848,7 @@
 * @todo Unclear if this is best approach. Alternative might be
 *  to use  Or an obscure unicode character like ␊ (U+240A).
 */
-   private function escapeForHumanEditable( $text ) {
+   public static function escapeForHumanEditable( $text ) {
if ( strpos( $text, '{{!}}' ) !== false ) {
// Maybe we should use \| too, but that's not MW like.
throw new MWContentSerializationException( "{{!}} in 
content" );
@@ -871,7 +871,7 @@
 * @param string $text
 * @return string Unescaped text
 */
-   private static function unescapeForHumanEditable( $text ) {
+   public static function unescapeForHumanEditable( $text ) {
$text = strtr( $text, [
'n'=> "\\n",
'\n' => "\n",
diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index a3fb1bf..e3f86e7 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -656,19 +656,19 @@
// Use two to separate columns
$out .= self::HUMAN_COLUMN_SPLIT;
if ( isset( $column->label ) ) {
-   $out .= $this->escapeForHumanEditable( 
$column->label );
+   $out .= 
CollaborationHubContent::escapeForHumanEditable( $column->label );
} else {
$out .= 'column';
}
if ( isset( $column->notes ) ) {
-   $out .= '|notes=' . 
$this->escapeForHumanEditable( $column->notes );
+   $out .= '|notes=' . 
CollaborationHubContent::escapeForHumanEditable( $column->notes );
}
$out .= self::HUMAN_COLUMN_SPLIT2;
 
foreach ( $column->items as $item ) {
-   $out .= $this->escapeForHumanEditable( 
$item->title );
+   $out .= 
CollaborationHubContent::escapeForHumanEditable( $item->title );
if ( isset ( $item->notes ) ) {
-   $out .= '|' . 
$this->escapeForHumanEditable( $item->notes );
+   $out .= '|' . 
CollaborationHubContent::escapeForHumanEditable( $item->notes );
} else {
$out .= '|';
}
@@ -676,19 +676,19 @@
if ( $item->link === false ) {
$out .= '|nolink';
} else {
-   $out .= "|link=" . 
$this->escapeForHumanEditable( $item->link );
+   $out .= "|link=" . 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Cleanup of CollaborationListContent.php

2017-02-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340423 )

Change subject: Cleanup of CollaborationListContent.php
..

Cleanup of CollaborationListContent.php

Change-Id: I078470d8eeffb33a5b57cfab8dcbc523fe919c5d
---
M includes/content/CollaborationListContent.php
1 file changed, 2 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/23/340423/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index aa0ecc1..e8a47f7 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -25,7 +25,7 @@
const HUMAN_DESC_SPLIT = "\n---\n";
// Splitter denoting the beginning of a list column
const HUMAN_COLUMN_SPLIT = "\n-~-~-\n";
-   // Splitter denoting the beginning og the list itself within the column
+   // Splitter denoting the beginning of the list itself within the column
const HUMAN_COLUMN_SPLIT2 = "\n-\n";
 
/** @var $decoded boolean Have we decoded the data yet */
@@ -108,10 +108,7 @@
 
// Special handling for DISPLAYMODE
if ( $name == 'DISPLAYMODE' ) {
-   if ( $value == 'members' || $value == 'normal' || 
$value == 'error' ) {
-   return true;
-   }
-   return false;
+   return ( $value == 'members' || $value == 'normal' || 
$value == 'error' );
}
 
// Force intrepretation as boolean for certain options

-- 
To view, visit https://gerrit.wikimedia.org/r/340423
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I078470d8eeffb33a5b57cfab8dcbc523fe919c5d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing drag-and-drop UI

2017-02-28 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340334 )

Change subject: Fixing drag-and-drop UI
..

Fixing drag-and-drop UI

Because the axis was set to "y" despite there also being an x
dimension, it made the drag and drop very jittery. This change
fixes that.

Change-Id: I8f1ddb7d21b083e7d38bb12a489cc5bedc8c518a
---
M modules/ext.CollaborationKit.list.ui.js
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/34/340334/1

diff --git a/modules/ext.CollaborationKit.list.ui.js 
b/modules/ext.CollaborationKit.list.ui.js
index f6bdc03..a792af1 100644
--- a/modules/ext.CollaborationKit.list.ui.js
+++ b/modules/ext.CollaborationKit.list.ui.js
@@ -300,7 +300,6 @@
if ( !mw.config.get( 'wgCollaborationKitIsMemberList' ) ) {
$list.sortable( {
placeholder: 'mw-ck-list-dragplaceholder',
-   axis: 'y',
forcePlaceholderSize: true,
handle: '.mw-ck-list-movebutton',
opacity: 0.6,

-- 
To view, visit https://gerrit.wikimedia.org/r/340334
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f1ddb7d21b083e7d38bb12a489cc5bedc8c518a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding hub section main bodies to their own container and se...

2017-02-26 Thread Harej (Code Review)
Harej has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/339813 )

Change subject: Adding hub section main bodies to their own container and 
setting padding
..


Adding hub section main bodies to their own container and setting padding

I think having the buttons become in-line with the H2 headers broke
padding. This fixes that by having everything after the top being
in a container div, with padding-top set to 0.25 em.

Change-Id: Id4fc1f85a23993d1ad1955c655dcef9e25195365
---
M includes/content/CollaborationHubContent.php
M modules/ext.CollaborationKit.hub.styles.less
2 files changed, 6 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Isarra: Looks good to me, approved



diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index aa135bc..bf3f983 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -594,7 +594,7 @@
$text = $contentOutput->getRawText();
}
 
-   $html .= $text;
+   $html .= Html::rawElement( 'div', [ 'class' => 
'mw-ck-hub-section-main' ], $text );
 
// register as template for stuff
$output->addTemplate( $spTitle, 
$spTitle->getArticleID(), $spRev->getId() );
diff --git a/modules/ext.CollaborationKit.hub.styles.less 
b/modules/ext.CollaborationKit.hub.styles.less
index b5bcb8b..468deb6 100644
--- a/modules/ext.CollaborationKit.hub.styles.less
+++ b/modules/ext.CollaborationKit.hub.styles.less
@@ -61,13 +61,17 @@
 
h2 {
display: inline;
+   padding: 0;
margin: 0;
-   padding: 0 0 .25em;
border-bottom-style: none;
border-top-style: none;
border-left-style: none;
border-right-style: none;
}
+
+   .mw-ck-hub-section-main {
+   padding-top: .25em;
+   }
}
.mw-ck-hub-section-buttons {
display: inline;

-- 
To view, visit https://gerrit.wikimedia.org/r/339813
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id4fc1f85a23993d1ad1955c655dcef9e25195365
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 
Gerrit-Reviewer: Harej 
Gerrit-Reviewer: Isarra 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Remove JS functionality for logged-out users for join button.

2017-02-25 Thread Harej (Code Review)
Harej has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/339812 )

Change subject: Remove JS functionality for logged-out users for join button.
..


Remove JS functionality for logged-out users for join button.

The project join button assumes the existence of a user account. Logged
out users lack this, so this removes the "join" button from the member
list itself. The button is still technically there on the hub page, but
the JavaScript functionality is removed, so logged out users can still
technically join projects (to the extent they're already allowed to join
WikiProjects).

Change-Id: Iadc48eca8f9ed65d32578148b0cd54903c5d4e7f
---
M modules/ext.CollaborationKit.list.members.js
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Isarra: Looks good to me, approved



diff --git a/modules/ext.CollaborationKit.list.members.js 
b/modules/ext.CollaborationKit.list.members.js
index c873679..bb72d2c 100644
--- a/modules/ext.CollaborationKit.list.members.js
+++ b/modules/ext.CollaborationKit.list.members.js
@@ -88,7 +88,10 @@
};
 
$( function () {
-   if ( mw.config.get( 'wgCollaborationKitAssociatedMemberList' ) 
) {
+   // Workflow assumes existence of username, so we filter against 
it
+   // However, since !curUserIsInList, the button will still 
render. It will just use no-JS
+   // behavior instead.
+   if ( mw.config.get( 'wgCollaborationKitAssociatedMemberList' ) 
&& !mw.user.isAnon() ) {
memberListPage = mw.config.get( 
'wgCollaborationKitAssociatedMemberList' );
curUserIsInList( memberListPage ); // removes Join 
button if user already is member
new mw.Api().get( {
@@ -108,7 +111,7 @@
}
 
if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) &&
-   !curUserIsInList()
+   !curUserIsInList() && !mw.user.isAnon()  // Workflow 
assumes existence of username
) {
$list = $( '.mw-ck-list' );
$list.before(

-- 
To view, visit https://gerrit.wikimedia.org/r/339812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iadc48eca8f9ed65d32578148b0cd54903c5d4e7f
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 
Gerrit-Reviewer: Harej 
Gerrit-Reviewer: Isarra 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing member list-related bug

2017-02-25 Thread Harej (Code Review)
Harej has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/339811 )

Change subject: Fixing member list-related bug
..


Fixing member list-related bug

If you tried to delete a member in the "inactive" column of a member
list it led to an error caused by column 1 being a pseudcolumn. This
patch fixes that.

Change-Id: If89c9990d427d61f44517afb4db2df14afa9fe32
---
M modules/ext.CollaborationKit.list.edit.js
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Isarra: Looks good to me, approved



diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index a768ce5..c90269a 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -29,6 +29,11 @@
title = $item.data( 'collabkit-item-title' ),
colId = getColId( $item );
 
+   if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) ) {
+   // Member lists' Column 1 is a pseudocolumn
+   colId = 0;
+   }
+
$spinner = $.createSpinner( {
size: 'small',
type: 'inline'

-- 
To view, visit https://gerrit.wikimedia.org/r/339811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If89c9990d427d61f44517afb4db2df14afa9fe32
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 
Gerrit-Reviewer: Harej 
Gerrit-Reviewer: Isarra 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Support for redirects upon page move

2017-02-25 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339820 )

Change subject: Support for redirects upon page move
..

Support for redirects upon page move

Change-Id: I46c09d35ab532afc7d96b77531ebc348efbf52aa
---
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubContentHandler.php
M includes/content/CollaborationListContentHandler.php
3 files changed, 52 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/20/339820/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index dfb0d33..e0c649d 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -352,7 +352,7 @@
 
$membersPageName = $title->getFullText() . '/' . wfMessage( 
'collaborationkit-hub-pagetitle-members' )->inContentLanguage()->text();
$membersTitle = Title::newFromText( $membersPageName );
-   if ( $membersTitle->exists() || $membersContent !== null ) {
+   if ( ( $membersTitle->exists() && 
$membersTitle->getContentModel() == 'CollaborationListContent' ) || 
$membersContent !== null ) {
$membersPageID = $membersTitle->getArticleID();
$output->addJsConfigVars( 
'wgCollaborationKitAssociatedMemberList', $membersPageID );
 
diff --git a/includes/content/CollaborationHubContentHandler.php 
b/includes/content/CollaborationHubContentHandler.php
index 0df3534..6d7c704 100644
--- a/includes/content/CollaborationHubContentHandler.php
+++ b/includes/content/CollaborationHubContentHandler.php
@@ -105,6 +105,29 @@
}
 
/**
+* @return bool
+*/
+   public function supportsRedirects() {
+   return true;
+   }
+
+   /**
+* Turns CollaborationHubContent page into redirect
+*
+* Note that wikitext redirects are created, as generally, this content 
model
+* is used in namespaces that support wikitext, and wikitext redirects 
are
+* expected.
+*
+* @param Title $destination The page to redirect to
+* @param string $text Text to include in the redirect.
+* @return Content
+*/
+   public function makeRedirectContent( Title $destination, $text = '' ) {
+   $handler = new WikitextContentHandler();
+   return $handler->makeRedirectContent( $destination, $text );
+   }
+
+   /**
 * Edit a Collaboration Hub via the edit API
 * @param Title $title
 * @param string $displayName
diff --git a/includes/content/CollaborationListContentHandler.php 
b/includes/content/CollaborationListContentHandler.php
index d8f11c3..b443d04 100644
--- a/includes/content/CollaborationListContentHandler.php
+++ b/includes/content/CollaborationListContentHandler.php
@@ -129,9 +129,37 @@
return false;
}
 */
+
+   /**
+* @return bool
+*/
public function supportsDirectApiEditing() {
return true;
}
+
+   /**
+* @return bool
+*/
+   public function supportsRedirects() {
+   return true;
+   }
+
+   /**
+* Turns CollaborationListContent page into redirect
+*
+* Note that wikitext redirects are created, as generally, this content 
model
+* is used in namespaces that support wikitext, and wikitext redirects 
are
+* expected.
+*
+* @param Title $destination The page to redirect to
+* @param string $text Text to include in the redirect.
+* @return Content
+*/
+   public function makeRedirectContent( Title $destination, $text = '' ) {
+   $handler = new WikitextContentHandler();
+   return $handler->makeRedirectContent( $destination, $text );
+   }
+
/**
 * Posts the newly created "members" list on-wiki.
 *

-- 
To view, visit https://gerrit.wikimedia.org/r/339820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46c09d35ab532afc7d96b77531ebc348efbf52aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fix CollaborationKitToC section link behavior

2017-02-25 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339817 )

Change subject: Fix CollaborationKitToC section link behavior
..

Fix CollaborationKitToC section link behavior

The internal name for a feature's display name is "displayTitle"
not "display_title".

Change-Id: I83fca73e2367ed93360597cc82c05fcf792c5405
---
M includes/content/CollaborationHubTOC.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/17/339817/1

diff --git a/includes/content/CollaborationHubTOC.php 
b/includes/content/CollaborationHubTOC.php
index d3ef18e..8196a4f 100644
--- a/includes/content/CollaborationHubTOC.php
+++ b/includes/content/CollaborationHubTOC.php
@@ -56,8 +56,8 @@
continue;
}
$title = Title::newFromText( $item['title'] );
-   if ( isset( $item['display_title'] ) ) {
-   $displayTitle = $item['display_title'];
+   if ( isset( $item['displayTitle'] ) ) {
+   $displayTitle = $item['displayTitle'];
} else {
$displayTitle = $title->getSubpageText();
}

-- 
To view, visit https://gerrit.wikimedia.org/r/339817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83fca73e2367ed93360597cc82c05fcf792c5405
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Resolve redirects on Collaboration Hub

2017-02-25 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339814 )

Change subject: Resolve redirects on Collaboration Hub
..

Resolve redirects on Collaboration Hub

If an embedded page is a redirect, CollaborationHubContent will
resolve the redirect through a new method called redirectProof.

Change-Id: I5a251c426c3664c07e2dedea95b010836d070920
---
M includes/content/CollaborationHubContent.php
1 file changed, 22 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/14/339814/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index dfb0d33..0f84631 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -155,6 +155,24 @@
}
 
/**
+* Resolves the redirect of a Title if it is in fact a redirect.
+*
+* Consistent with general MediaWiki behavior, this function does
+* not resolve double redirects.
+*
+* @param Title $title Title which may or may not be a redirect
+* @return Title
+*/
+   public function redirectProof( Title $title ) {
+   if ( $title->isRedirect() ) {
+   $articleID = $title->getArticleID();
+   $wikipage = WikiPage::newFromID( $articleID );
+   return $wikipage->getRedirectTarget();
+   }
+   return $title;
+   }
+
+   /**
 * @return string
 */
public function getIntroduction() {
@@ -351,7 +369,7 @@
}
 
$membersPageName = $title->getFullText() . '/' . wfMessage( 
'collaborationkit-hub-pagetitle-members' )->inContentLanguage()->text();
-   $membersTitle = Title::newFromText( $membersPageName );
+   $membersTitle = $this->redirectProof( Title::newFromText( 
$membersPageName ) );
if ( $membersTitle->exists() || $membersContent !== null ) {
$membersPageID = $membersTitle->getArticleID();
$output->addJsConfigVars( 
'wgCollaborationKitAssociatedMemberList', $membersPageID );
@@ -425,7 +443,7 @@
 */
protected function getParsedAnnouncements( Title $title, ParserOptions 
$options, $announcementsText = null ) {
$announcementsSubpageName = wfMessage( 
'collaborationkit-hub-pagetitle-announcements' )->inContentLanguage()->text();
-   $announcementsTitle = Title::newFromText( $title->getFullText() 
. '/' . $announcementsSubpageName );
+   $announcementsTitle = $this->redirectProof( Title::newFromText( 
$title->getFullText() . '/' . $announcementsSubpageName ) );
 
if ( $announcementsTitle->exists() || $announcementsText !== 
null ) {
if ( $announcementsText === null ) {
@@ -515,7 +533,7 @@
if ( !isset( $item['title'] ) || $item['title'] == '' ) 
{
continue;
}
-   $spTitle = Title::newFromText( $item['title'] );
+   $spTitle = $this->redirectProof( Title::newFromText( 
$item['title'] ) );
$spRev = Revision::newFromTitle( $spTitle );
 
// open element and do header
@@ -607,7 +625,7 @@
static $tocLinks = []; // All used ids for the sections for the 
toc
$linkRenderer = $wgParser->getLinkRenderer();
 
-   $spTitle = Title::newFromText( $contentItem['title'] );
+   $spTitle = $this->redirectProof( Title::newFromText( 
$contentItem['title'] ) );
$spRev = Revision::newFromTitle( $spTitle );
 
// Get display name

-- 
To view, visit https://gerrit.wikimedia.org/r/339814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a251c426c3664c07e2dedea95b010836d070920
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding hub section main bodies to their own container and se...

2017-02-25 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339813 )

Change subject: Adding hub section main bodies to their own container and 
setting padding
..

Adding hub section main bodies to their own container and setting padding

I think having the buttons become in-line with the H2 headers broke
padding. This fixes that by having everything after the top being
in a container div, with padding-top set to 0.25 em.

Change-Id: Id4fc1f85a23993d1ad1955c655dcef9e25195365
---
M includes/content/CollaborationHubContent.php
M modules/ext.CollaborationKit.hub.styles.less
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/13/339813/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index dfb0d33..dbad498 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -568,7 +568,7 @@
$text = $contentOutput->getRawText();
}
 
-   $html .= $text;
+   $html .= Html::rawElement( 'div', [ 'class' => 
'mw-ck-hub-section-main' ], $text );
 
// register as template for stuff
$output->addTemplate( $spTitle, 
$spTitle->getArticleId(), $spRev->getId() );
diff --git a/modules/ext.CollaborationKit.hub.styles.less 
b/modules/ext.CollaborationKit.hub.styles.less
index b5bcb8b..c664627 100644
--- a/modules/ext.CollaborationKit.hub.styles.less
+++ b/modules/ext.CollaborationKit.hub.styles.less
@@ -62,12 +62,15 @@
h2 {
display: inline;
margin: 0;
-   padding: 0 0 .25em;
border-bottom-style: none;
border-top-style: none;
border-left-style: none;
border-right-style: none;
}
+
+   .mw-ck-hub-section-main {
+   padding-top: .25em;
+   }
}
.mw-ck-hub-section-buttons {
display: inline;

-- 
To view, visit https://gerrit.wikimedia.org/r/339813
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4fc1f85a23993d1ad1955c655dcef9e25195365
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Remove JS functionality for logged-out users for join button.

2017-02-25 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339812 )

Change subject: Remove JS functionality for logged-out users for join button.
..

Remove JS functionality for logged-out users for join button.

The project join button assumes the existence of a user account. Logged
out users lack this, so this removes the "join" button from the member
list itself. The button is still technically there on the hub page, but
the JavaScript functionality is removed, so logged out users can still
technically join projects (to the extent they're already allowed to join
WikiProjects).

Change-Id: Iadc48eca8f9ed65d32578148b0cd54903c5d4e7f
---
M modules/ext.CollaborationKit.list.members.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/12/339812/1

diff --git a/modules/ext.CollaborationKit.list.members.js 
b/modules/ext.CollaborationKit.list.members.js
index c873679..e4f353c 100644
--- a/modules/ext.CollaborationKit.list.members.js
+++ b/modules/ext.CollaborationKit.list.members.js
@@ -88,7 +88,7 @@
};
 
$( function () {
-   if ( mw.config.get( 'wgCollaborationKitAssociatedMemberList' ) 
) {
+   if ( mw.config.get( 'wgCollaborationKitAssociatedMemberList' ) 
&& mw.user.getId() != 0 ) {
memberListPage = mw.config.get( 
'wgCollaborationKitAssociatedMemberList' );
curUserIsInList( memberListPage ); // removes Join 
button if user already is member
new mw.Api().get( {
@@ -108,7 +108,7 @@
}
 
if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) &&
-   !curUserIsInList()
+   !curUserIsInList() && mw.user.getId() != 0
) {
$list = $( '.mw-ck-list' );
$list.before(

-- 
To view, visit https://gerrit.wikimedia.org/r/339812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadc48eca8f9ed65d32578148b0cd54903c5d4e7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing member list-related bug

2017-02-24 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339811 )

Change subject: Fixing member list-related bug
..

Fixing member list-related bug

If you tried to delete a member in the "inactive" column of a member
list it led to an error caused by column 1 being a pseudcolumn. This
patch fixes that.

Change-Id: If89c9990d427d61f44517afb4db2df14afa9fe32
---
M modules/ext.CollaborationKit.list.edit.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/11/339811/1

diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index a768ce5..c90269a 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -29,6 +29,11 @@
title = $item.data( 'collabkit-item-title' ),
colId = getColId( $item );
 
+   if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) ) {
+   // Member lists' Column 1 is a pseudocolumn
+   colId = 0;
+   }
+
$spinner = $.createSpinner( {
size: 'small',
type: 'inline'

-- 
To view, visit https://gerrit.wikimedia.org/r/339811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If89c9990d427d61f44517afb4db2df14afa9fe32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Re-inserting quote marks taken out during style changes

2017-02-23 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/339374 )

Change subject: Re-inserting quote marks taken out during style changes
..

Re-inserting quote marks taken out during style changes

The quote marks play a functional role here and without them 
Special:CreateCollaborationHub breaks.

Change-Id: I749897bf478ff7bee75b190a2c8ea3138f8db3e9
---
M includes/content/CollaborationListContentHandler.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/74/339374/1

diff --git a/includes/content/CollaborationListContentHandler.php 
b/includes/content/CollaborationListContentHandler.php
index cfb0759..36c 100644
--- a/includes/content/CollaborationListContentHandler.php
+++ b/includes/content/CollaborationListContentHandler.php
@@ -111,7 +111,7 @@
'options' => [
'mode' => 'normal'
],
-   'description' => $initialDescription
+   'description' => "$initialDescription"  // Do not take 
out these quote marks
];
 
$newMemberListJson = FormatJson::encode( $newMemberList, "\t", 
FormatJson::ALL_OK );

-- 
To view, visit https://gerrit.wikimedia.org/r/339374
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I749897bf478ff7bee75b190a2c8ea3138f8db3e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Centering non-square images

2017-02-18 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338528 )

Change subject: Centering non-square images
..

Centering non-square images

Bug: T158284
Change-Id: If2d6c00789e562a1e0db36728f364cb4d82897bb
---
M includes/content/CollaborationKitImage.php
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.list.styles.less
3 files changed, 46 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/28/338528/1

diff --git a/includes/content/CollaborationKitImage.php 
b/includes/content/CollaborationKitImage.php
index ffc7f68..ee12e0f 100644
--- a/includes/content/CollaborationKitImage.php
+++ b/includes/content/CollaborationKitImage.php
@@ -26,6 +26,8 @@
 * @param string $options['fallback'] If the specified image is null or 
doesn't exist. Valid
 *  options are none', a valid icon ID, or an arbitrary string to 
use a seed. (Note: if you
 *  specify a label, then that will serve as the fallback.)
+* @param bool $options['optimizeForSquare'] Fetch an image such that 
it's ideal for shoving
+*  into a square frame. Default is false.
 * @return string HTML elements or wikitext, depending on 
$options['renderAsWikitext']
 */
public static function makeImage( $image, $width, $options = [] ) {
@@ -38,6 +40,7 @@
$colour = isset( $options['colour'] ) ? $options['colour'] : '';
$css = isset( $options['css'] ) ? $options['css'] : '';
$renderAsWikitext = isset( $options['renderAsWikitext'] ) ? 
$options['renderAsWikitext'] : false;
+   $optimizeForSquare = isset( $options['optimizeForSquare'] ) ? 
$options['optimizeForSquare'] : false;
$label = isset( $options['label'] ) ? $options['label'] : '';
 
if ( !isset( $options['fallback'] ) ) {
@@ -61,11 +64,24 @@
 
// Are we loading an image file or constructing a div based on 
an icon class?
if ( wfFindFile( $image ) ) {
-   $imageCode = self::makeImageFromFile( $image, $classes, 
$width, $link,
-   $renderAsWikitext, $label );
+   $imageObj = wfFindFile( $image );
+
+   $squareAdjustmentAxis = null;
+   if ( $optimizeForSquare ) {
+   $fullHeight = $imageObj->getHeight();
+   $fullWidth = $imageObj->getWidth();
+   $ratio = $fullWidth / $fullHeight;  // get 
ratio of width to height
+   if ( $ratio > 1 ) {
+   $squareAdjustmentAxis = 'x';
+   $classes[] = 'mw-ck-adjustedimage-x';
+   } elseif ( $ratio < 1 ) {  // If image is a 
perfect square (ratio == 1) nothing needs to be done
+   $squareAdjustmentAxis = 'y';
+   $classes[] = 'mw-ck-adjustedimage-y';
+   }
+   }
+   $imageCode = self::makeImageFromFile( $imageObj, 
$width, $link, $renderAsWikitext, $label, $squareAdjustmentAxis );
} elseif ( in_array( $image, $cannedIcons ) ) {
-   $imageCode = self::makeImageFromIcon( $image, $classes, 
$width, $colour,
-   $link, $renderAsWikitext, $label );
+   $imageCode = self::makeImageFromIcon( $image, $width, 
$colour, $link, $renderAsWikitext, $label );
}
 
// Finishing up
@@ -77,16 +93,18 @@
/**
 * @return string
 */
-   protected static function makeImageFromFile( $image, $classes, $width, 
$link,
-   $renderAsWikitext, $label ) {
+   protected static function makeImageFromFile( $imageObj, $width, $link, 
$renderAsWikitext, $label, $squareAdjustmentAxis ) {
// This assumes that colours cannot be assigned to images.
// This is currently true, but who knows what the future might 
hold!
 
global $wgParser;
 
-   $imageObj = wfFindFile( $image );
$imageTitle = $imageObj->getTitle();
$imageFullName = $imageTitle->getFullText();
+
+   if ( $squareAdjustmentAxis == 'x' ) {
+   $width = 'x' . $width;  // i.e. "x64px"
+   }
 
$wikitext = "[[{$imageFullName}|{$width}px";
 
@@ -123,8 +141,7 @@
/**
 * @return string
 */
-   protected static function makeImageFromIcon( $image, $classes, $width, 
$colour, $link,
-   $renderAsWikitext, $label ) {
+   protected static function makeImageFromIcon( $image, 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: [WIP] Hub theme widget re-design

2017-02-16 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338317 )

Change subject: [WIP] Hub theme widget re-design
..

[WIP] Hub theme widget re-design

Bug: T157630
Change-Id: I670fce13f2a39d350460f27ac57b0d1ca0521104
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/CollaborationHubContentEditor.php
M includes/SpecialCreateCollaborationHub.php
D modules/ext.CollaborationKit.colour.js
M modules/ext.CollaborationKit.edit.styles.less
D modules/ext.CollaborationKit.hubimage.js
A modules/ext.CollaborationKit.hubtheme.js
R modules/ext.CollaborationKit.hubtheme.styles.less
R modules/ext.CollaborationKit.icon.styles.less
11 files changed, 402 insertions(+), 337 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/17/338317/1

diff --git a/extension.json b/extension.json
index d2bc720..8dddecd 100644
--- a/extension.json
+++ b/extension.json
@@ -95,7 +95,7 @@
"ext.CollaborationKit.edit.styles": {
"styles": "ext.CollaborationKit.edit.styles.less"
},
-   "ext.CollaborationKit.iconbrowser": {
+   "ext.CollaborationKit.icon": {
"scripts": "ext.CollaborationKit.icon.js",
"dependencies": [
"oojs-ui",
@@ -110,38 +110,26 @@
"collaborationkit-icon-launchbutton",
"cancel"
],
-   "styles": "ext.CollaborationKit.iconbrowser.styles.less"
+   "styles": "ext.CollaborationKit.icon.styles.less"
},
-   "ext.CollaborationKit.hubimagebrowser": {
-   "scripts": "ext.CollaborationKit.hubimage.js",
+   "ext.CollaborationKit.hubtheme": {
+   "scripts": "ext.CollaborationKit.hubtheme.js",
"dependencies": [
"oojs-ui",
"oojs-ui.styles.icons-movement",
+   "oojs-ui.styles.icons-editing-core",
"mediawiki.widgets",
"mediawiki.widgets.UserInputWidget",
"mediawiki.widgets.MediaSearch",
-   "mediawiki.api"
+   "mediawiki.api",
+   "ext.CollaborationKit.icons"
],
"messages": [
"collaborationkit-hubimage-browser",
"collaborationkit-hubimage-select",
-   "collaborationkit-hubimage-launchbutton",
-   "cancel"
-   ]
-   },
-   "ext.CollaborationKit.colourbrowser": {
-   "scripts": "ext.CollaborationKit.colour.js",
-   "dependencies": [
-   "oojs-ui",
-   "oojs-ui.styles.icons-movement",
-   "mediawiki.widgets",
-   "mediawiki.widgets.UserInputWidget"
-   ],
-   "messages": [
+   "cancel",
"collaborationkit-colour-browser",
"collaborationkit-colour-select",
-   "collaborationkit-colour-launchbutton",
-   "cancel",
"collaborationkit-darkred",
"collaborationkit-red",
"collaborationkit-darkgrey",
@@ -166,7 +154,9 @@
"collaborationkit-khaki",
"collaborationkit-black"
],
-   "styles": 
"ext.CollaborationKit.colourbrowser.styles.less"
+   "styles": [
+   "ext.CollaborationKit.hubtheme.styles.less"
+   ]
},
"ext.CollaborationKit.list.edit": {
"scripts": "ext.CollaborationKit.list.edit.js",
diff --git a/i18n/en.json b/i18n/en.json
index f52fe47..3bfbec4 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -87,10 +87,8 @@
"collaborationkit-icon-launchbutton": "Browse icons",
"collaborationkit-icon-browser": "Icon browser",
"collaborationkit-icon-select": "Select",
-   "collaborationkit-colour-launchbutton": "Browse colors",
"collaborationkit-colour-browser": "Color browser",
"collaborationkit-colour-select": "Select",
-   "collaborationkit-hubimage-launchbutton": "Browse images",
"collaborationkit-hubimage-browser": "Media browser",

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Making page title input look more like Special:MovePage

2017-02-13 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337382 )

Change subject: Making page title input look more like Special:MovePage
..

Making page title input look more like Special:MovePage

Bug: T155859
Change-Id: I58ca09d73812166e3f99710ab1fa9f02dc59687b
---
M includes/SpecialCreateCollaborationHub.php
M modules/ext.CollaborationKit.edit.styles.less
2 files changed, 17 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/82/337382/1

diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index c78b2bb..cd35a5d 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -49,13 +49,13 @@
'options' => $namespaceChoices,
'cssclass' => 'mw-ck-namespace-input',
'label-message' => 
'collaborationkit-createhub-title',
-   'help-message' => 
'collaborationkit-createhub-title-help',
'required' => true
],
'title' => [
'type' => 'text',
'cssclass' => 'mw-ck-title-input',
'placeholder-message' => 
'collaborationkit-createhub-title-placeholder',
+   'help-message' => 
'collaborationkit-createhub-title-help',
'required' => true
],
// Display name can be different from page title
diff --git a/modules/ext.CollaborationKit.edit.styles.less 
b/modules/ext.CollaborationKit.edit.styles.less
index bb133e6..d4660e9 100644
--- a/modules/ext.CollaborationKit.edit.styles.less
+++ b/modules/ext.CollaborationKit.edit.styles.less
@@ -35,6 +35,22 @@
}
 }
 
+.mw-htmlform-field-HTMLSelectField.mw-ck-namespace-input {
+   margin-top: 1.2em !important;
+}
+
+.mw-ck-namespace-input {
+   width: 15em;
+   display: inline-table !important;
+}
+
+.mw-ck-title-input {
+   width: 24.75em;
+   display: inline-table !important;
+   padding-left: 0.25em;
+   margin-top: 0 !important;
+}
+
 .mw-ck-theme-darkred {
.ck-customeditor-toolbars( @darkred );
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/337382
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58ca09d73812166e3f99710ab1fa9f02dc59687b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Function documentation.

2017-02-13 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337375 )

Change subject: Function documentation.
..

Function documentation.

Bug: T149375
Change-Id: I5b39a14bf8e545f167a96dc0341443d85c10d02f
---
M CollaborationKit.hooks.php
M includes/CollaborationHubContentEditor.php
M includes/CollaborationListContentEditor.php
M includes/ResourceLoaderListStyleModule.php
M includes/SpecialCreateHubFeature.php
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubContentHandler.php
M includes/content/CollaborationHubDiffEngine.php
M includes/content/CollaborationHubTOC.php
M includes/content/CollaborationKitImage.php
M includes/content/CollaborationListContent.php
M includes/content/CollaborationListContentHandler.php
M modules/ext.CollaborationKit.hubimage.js
M modules/ext.CollaborationKit.icon.js
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.ui.js
16 files changed, 373 insertions(+), 153 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/75/337375/1

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index 3650353..ab56d6d 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -1,12 +1,18 @@
 setFunctionHook( 'transcludelist', 
'CollaborationListContent::transcludeHook' );
@@ -63,8 +69,8 @@
 * Declares JSON as the code editor language for CollaborationKit pages.
 *
 * This hook only runs if the CodeEditor extension is enabled.
-* @param $title Title
-* @param &$lang string Page language.
+* @param Title $title
+* @param string &$lang Page language.
 * @return bool
 */
public static function onCodeEditorGetPageLanguage( $title, &$lang ) {
@@ -89,8 +95,8 @@
/**
 * For the table of contents on subpages of a CollaborationHub
 *
-* @param $out OutputPage
-* @param $text string the HTML text to be added
+* @param OutputPage $out
+* @param string $text the HTML text to be added
 * @return bool
 */
public static function onOutputPageBeforeHTML( &$out, &$text ) {
@@ -132,8 +138,8 @@
 * Eventually, the TOC will be output by onOutputPageBeforeHTML hook if 
this
 * hook signals it is ok.
 *
-* @param $out OutputPage
-* @param $pout ParserOutput
+* @param OutputPage $out
+* @param ParserOutput $pout
 */
public static function onOutputPageParserOutput( OutputPage $out, 
ParserOutput $pout ) {
if ( $out->getProperty( 'CollaborationHubSubpage' ) ) {
@@ -153,7 +159,7 @@
/**
 * Register __NOCOLLABORATIONHUBTOC__ as a magic word.
 *
-* @param &$magickWords Array All double underscore magic ids
+* @param Array &$magicWords All double underscore magic ids
 */
public static function onGetDoubleUnderscoreIDs( array &$magicWords ) {
$magicWords[] = 'nocollaborationhubtoc';
diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index 8f5d75a..9af0ad8 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -1,7 +1,12 @@
  element
 */
public static function setCollabkitTheme( OutputPage $out, $skin, 
&$bodyAttribs ) {
@@ -175,7 +183,8 @@
/**
 * Converts input from the editing form into the text/x-collabkit
 * serialization used for processing the edit.
-* @param &$request WebRequest
+* 
+* @param WebRequest &$request
 * @return string|null
 */
protected function importContentFormData( &$request ) {
diff --git a/includes/CollaborationListContentEditor.php 
b/includes/CollaborationListContentEditor.php
index 7dd6865..6f49384 100644
--- a/includes/CollaborationListContentEditor.php
+++ b/includes/CollaborationListContentEditor.php
@@ -1,7 +1,13 @@
 addModuleStyles( 'ext.CollaborationKit.edit.styles' );
}
 
+   /**
+* Prepares a modified edit form
+*/
protected function showContentForm() {
if ( $this->contentFormat !== 
CollaborationListContentHandler::FORMAT_WIKI ) {
return parent::showContentForm();
@@ -63,6 +72,12 @@
$out->addHtml( Html::rawElement( 'div', [ 'class' => 
'mw-collabkit-modifiededitform' ], $partFields ) );
}
 
+   /**
+* Takes contents of edit form and serializes it.
+*
+* @param WebRequest $request
+* @return string
+*/
protected function importContentFormData( &$request ) {
$format = $request->getVal( 'format', 
CollaborationListContentHandler::FORMAT_WIKI );
if ( $format !== 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Changing "add item" button to be per column

2017-02-12 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337352 )

Change subject: Changing "add item" button to be per column
..

Changing "add item" button to be per column

Except for member list, which only gets it in the first column. Because the 
second column is fake and trying to add anything to that column causes 
explosions.

Change-Id: I64264000c84d3db05a148f2f4f3f0234c7d83562
---
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.ui.js
2 files changed, 14 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/52/337352/1

diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index ed3eb46..e30d948 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -1,10 +1,6 @@
 ( function ( $, mw, OO ) {
var deleteItem, getCurrentJson, saveJson, addItem, reorderList, 
getListOfTitles, modifyItem, modifyExistingItem, addSelf, curUserIsInList, 
getCol;
 
-   addItem = function () {
-   modifyItem( {} );
-   };
-
getColId = function ( $item ) {
var $col, id;
 
@@ -265,7 +261,6 @@
};
 
module.exports = {
-   addItem: addItem,
getColId: getColId,
deleteItem: deleteItem,
getListOfTitles: getListOfTitles,
diff --git a/modules/ext.CollaborationKit.list.ui.js 
b/modules/ext.CollaborationKit.list.ui.js
index 50e304d..f093aab 100644
--- a/modules/ext.CollaborationKit.list.ui.js
+++ b/modules/ext.CollaborationKit.list.ui.js
@@ -1,6 +1,9 @@
 ( function ( $, mw, OO ) {
-
var LE = require( 'ext.CollaborationKit.list.edit' );
+
+   addItem = function ( colId ) {
+   modifyItem( { itemColId: colId } );
+   };
 
/**
 * @param {Object} itemToEdit The name of the title to modify, or false 
to add new.
@@ -204,7 +207,7 @@
};
 
$( function () {
-   var $list, buttonMsg, memberListPage;
+   var $list, $column, buttonMsg, memberListPage;
 
if ( !mw.config.get( 'wgEnableCollaborationKitListEdit' ) ) {
// This page is not a list, or user does not have edit 
rights.
@@ -212,6 +215,11 @@
}
 
$list = $( '.mw-ck-list' );
+   if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) ) {
+   $column = $( 
'.mw-ck-list-column[data-collabkit-column-id=0] .mw-ck-list-item:last-child' );
+   } else {
+   $column = $( '.mw-ck-list-item:last-child' );
+   }
$list.find( '.mw-ck-list-item' ).each( function () {
var deleteButton,
moveButton,
@@ -333,7 +341,7 @@
buttonMsg = mw.config.get( 'wgCollaborationKitIsMemberList' ) ?
'collaborationkit-list-add-user' :
'collaborationkit-list-add';
-   $list.after(
+   $column.after(
$( '' )
// FIXME There is probably a way to add the 
class without
// extra div.
@@ -343,7 +351,9 @@
label: mw.msg( buttonMsg ),
icon: 'add',
flags: 'constructive'
-   } ).on( 'click', LE.addItem )
+   } ).on( 'click', function( id = $( 
event.target ).closest( '.mw-ck-list-column' ).data( 'collabkit-column-id' ) ) {
+   addItem( id )
+   } )
.$element
)
);

-- 
To view, visit https://gerrit.wikimedia.org/r/337352
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64264000c84d3db05a148f2f4f3f0234c7d83562
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Unit tests for CollaborationKit

2017-02-12 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337254 )

Change subject: Unit tests for CollaborationKit
..

Unit tests for CollaborationKit

Bug: T144556
Change-Id: I4ca457076e1c1f2aaee262575f9b5d5df50117e2
---
M includes/content/CollaborationKitImage.php
M tests/phpunit/CollaborationHubContentTest.php
M tests/phpunit/CollaborationHubTOCTest.php
M tests/phpunit/CollaborationKitImageTest.php
M tests/phpunit/CollaborationListContentHandlerTest.php
M tests/phpunit/CollaborationListContentTest.php
6 files changed, 386 insertions(+), 38 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/54/337254/1

diff --git a/includes/content/CollaborationKitImage.php 
b/includes/content/CollaborationKitImage.php
index 9434a44..cae3880 100644
--- a/includes/content/CollaborationKitImage.php
+++ b/includes/content/CollaborationKitImage.php
@@ -24,6 +24,7 @@
 * @param $options['fallback'] string If the specified image is null or 
doesn't exist. Valid
 *  options are none', a valid icon ID, or an arbitrary string to 
use a seed. (Note: if you
 *  specify a label, then that will serve as the fallback.)
+* @param $options['testImage'] string Name of an image forced to exist 
for test purposes
 * @return string HTML elements or wikitext, depending on 
$options['renderAsWikitext']
 */
public static function makeImage( $image, $width, $options = [] ) {
@@ -54,22 +55,30 @@
$options[ 'fallback' ] = 'none';
}
}
+   if ( !isset( $options[ 'testImage' ] ) ) {
+   $options[ 'testImage' ] = null;
+   }
 
$cannedIcons = self::getCannedIcons();
 
-   // Use fallback icon or random icon if stated image doesn't 
exist
-   if ( $image === null || $image == '' || ( !wfFindFile( $image ) 
&& !in_array( $image, $cannedIcons ) ) ) {
-   if ( $options[ 'fallback' ] == 'none' ) {
-   return '';
-   } elseif ( in_array( $options[ 'fallback' ], 
$cannedIcons ) ) {
-   $image = $options[ 'fallback' ];
-   } else {
-   $image = $cannedIcons[ hexdec( sha1( $options[ 
'fallback' ] )[0] ) % 27];
+   // testImage overrides all
+   if ( $options[ 'testImage' ] === null ) {
+   // Use fallback icon or random icon if stated image 
doesn't exist
+   if ( $image === null || $image == '' || ( !wfFindFile( 
$image ) && !in_array( $image, $cannedIcons ) ) ) {
+   if ( $options[ 'fallback' ] == 'none' ) {
+   return '';
+   } elseif ( in_array( $options[ 'fallback' ], 
$cannedIcons ) ) {
+   $image = $options[ 'fallback' ];
+   } else {
+   $image = $cannedIcons[ hexdec( sha1( 
$options[ 'fallback' ] )[0] ) % 27];
+   }
}
+   } else {
+   $image = $options[ 'testImage' ];
}
 
// Are we loading an image file or constructing a div based on 
an icon class?
-   if ( wfFindFile( $image ) ) {
+   if ( wfFindFile( $image ) || $options[ 'testImage' ] !== null ) 
{
$imageCode = self::makeImageFromFile( $image, $options[ 
'classes' ], $width, $options[ 'link' ],
$options[ 'renderAsWikitext' ], $options[ 
'label' ] );
} elseif ( in_array( $image, $cannedIcons ) ) {
diff --git a/tests/phpunit/CollaborationHubContentTest.php 
b/tests/phpunit/CollaborationHubContentTest.php
index 0315bcf..64dc44d 100644
--- a/tests/phpunit/CollaborationHubContentTest.php
+++ b/tests/phpunit/CollaborationHubContentTest.php
@@ -73,7 +73,7 @@
'',
];
$actual = $content->getIntroduction();
-   $this->assertEquals( $expected[$id], $actual, $id );
+   $this->assertEquals( $expected[ $id ], $actual, $id );
}
 
/**
@@ -86,7 +86,7 @@
'',
];
$actual = $content->getFooter();
-   $this->assertEquals( $expected[$id], $actual, $id );
+   $this->assertEquals( $expected[ $id ], $actual, $id );
}
 
/**
@@ -99,7 +99,7 @@
[],
];
$actual = $content->getContent();
-   $this->assertEquals( $expected[$id], $actual, $id );
+   $this->assertEquals( $expected[ $id ], $actual, $id );

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Changing default hub image behavior and adding placeholder box

2017-02-08 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336742 )

Change subject: Changing default hub image behavior and adding placeholder box
..

Changing default hub image behavior and adding placeholder box

Bug: T157633
Change-Id: Ia69c23ae820881659a6f46b790e79379c28db5e4
---
M modules/ext.CollaborationKit.hubimage.js
1 file changed, 15 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/42/336742/1

diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index accd674..cdb16b5 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -23,17 +23,22 @@
 
ProcessDialog.super.prototype.initialize.apply( this, arguments 
);
 
-   // Default image search flow:
-   // First work off of existing value for hub image, if it exists
-   // If no hub image (new hub creation), search display title or 
page title
-   // If nothing specified, fill in a filename for a generic icon
+   // Default image order of preference:
+   // Display name > Page title > Nothing
 
-   if ( $( 'input[name=wpdisplay_name]' ).val() !== '' ) {
-   defaultSearchTerm = $( 'input[name=wpdisplay_name]' 
).val();
-   } else if ( $( 'input[name=wptitle]' ).val() !== '' ) {
+   defaultSearchTerm = '';
+
+   if ( mw.config.get( 'wgTitle' ) !== undefined ) {
+   defaultSearchTerm = mw.config.get( 'wgTitle' );
+   }
+   if ( $( 'input[name=wptitle]' ).val() !== '' && $( 
'input[name=wptitle]' ).val() !== undefined ) {
defaultSearchTerm = $( 'input[name=wptitle]' ).val();
-   } else {
-   defaultSearchTerm = 'OOjs UI icon puzzle-ltr.svg';
+   }
+   if ( $( 'input[name=wpdisplay_name]' ).val() !== '' && $( 
'input[name=wpdisplay_name]' ).val() !== undefined ) {
+   defaultSearchTerm = $( 'input[name=wpdisplay_name]' 
).val();
+   }
+   if ( $( 'input[name=wpCollabHubDisplayName]' ).val() !== '' && 
$( 'input[name=wpCollabHubDisplayName]' ).val() !== undefined) {
+   defaultSearchTerm = $( 
'input[name=wpCollabHubDisplayName]' ).val();
}
 
this.content = new mw.widgets.MediaSearchWidget();
@@ -103,7 +108,7 @@
 
$( 'div.mw-ck-hub-image-input input' ).css( 'display', 'none' );
$( 'div.mw-ck-hub-image-input div.oo-ui-textInputWidget' )
-   .append( '' )
+   .append( '' )
.append( hubimageBrowserButton.$element )
.append( '' );
// Load current hub image
@@ -121,10 +126,7 @@
.done( function ( data ) {
$( 'img.hubimagePreview' )
.attr( 'src', data.query.pages[ 0 
].imageinfo[ 0 ].thumburl )
-   .css( 'margin-bottom', '10px' )
-   .css( 'width', '100px' )
.css( 'height', 'auto' )
-   .css( 'display', 'block' );
}
);
}

-- 
To view, visit https://gerrit.wikimedia.org/r/336742
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia69c23ae820881659a6f46b790e79379c28db5e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Changing default color to lightgrey.

2017-02-08 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336724 )

Change subject: Changing default color to lightgrey.
..

Changing default color to lightgrey.

Bug: T157627
Change-Id: I03ced8f401c77316d17ec7264d2d4725fce80769
---
M includes/CollaborationHubContentEditor.php
M includes/SpecialCreateCollaborationHub.php
M includes/content/CollaborationHubContent.php
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/24/336724/1

diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index e6edcf3..8f5d75a 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -58,7 +58,7 @@
$colours[ 'collaborationkit-' . $colour ] = $colour;
}
if ( $parts[4] == '' ) {
-   $selectedColour = 'darkblue';
+   $selectedColour = 'lightgrey';
} else {
$selectedColour = $parts[4];
}
diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 4401229..c56750e 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -71,7 +71,7 @@
'cssclass' => 'mw-ck-colour-input',
'label-message' => 'collaborationkit-hubedit-colour',
'options' => $this->getOptions( $colours ),
-   'default' => 'darkblue'
+   'default' => 'lightgrey'
];
 
/* Comment this out until it's actually implemented (T135408)
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 439f753..451a1f3 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -121,7 +121,7 @@
 
// Set colour to default if empty or missing
if ( !isset( $data->colour ) || $data->colour 
== '' ) {
-   $this->themeColour = 'darkblue';
+   $this->themeColour = 'lightgrey';
} else {
$this->themeColour = $data->colour;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/336724
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03ced8f401c77316d17ec7264d2d4725fce80769
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding messages for errors in Collaboration List editing tools.

2017-02-07 Thread Harej (Code Review)
Harej has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/336174 )

Change subject: Adding messages for errors in Collaboration List editing tools.
..


Adding messages for errors in Collaboration List editing tools.

Bug: T155651
Change-Id: Iba8c53fb92f0ccdc9e48401efc3f5e6b4959d9f8
---
M i18n/en.json
M i18n/qqq.json
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.ui.js
4 files changed, 14 insertions(+), 6 deletions(-)

Approvals:
  jenkins-bot: Verified
  Isarra: Looks good to me, approved



diff --git a/i18n/en.json b/i18n/en.json
index c977116..adff1ec 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -44,6 +44,10 @@
"collaborationkit-list-add-summary": "/* $1 */ Adding to list.",
"collaborationkit-list-add-self-summary": "/* $1 */ Joining project.",
"collaborationkit-list-alreadyadded": "You are already a member of this 
project.",
+   "collaborationkit-list-error-editconflict": "There was an edit 
conflict, and your change was not saved. Please refresh the page and try 
again.",
+   "collaborationkit-list-error-couldnotgetpage": "The page failed to 
load. Please refresh the page and try again.",
+   "collaborationkit-list-error-generic": "There was an error. Please 
refresh the page and try again.",
+   "collaborationkit-list-error-saving": "Your edits to the list did not 
save. Please refresh the page and try again.",
"collaborationkit-list-move": "Re-order this item",
"collaborationkit-list-move-summary": "/* $1 */ Reordering item [[$1]]",
"collaborationkit-list-move-popup": "Successfully saved: $1 was 
re-ordered.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4a77816..adcc79e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -47,6 +47,10 @@
"collaborationkit-list-add-summary": "Edit summary when adding a new 
item to CollaborationKit list page",
"collaborationkit-list-add-self-summary": "Edit summary if the user 
clicked the one-click add self to membership list button 
(collaborationkit-list-add-self).",
"collaborationkit-list-alreadyadded": "Error if the user pressed the 
button labelled by collaborationkit-list-add-self but is already on the list",
+   "collaborationkit-list-error-editconflict": "Error that appears if 
there is an edit conflict",
+   "collaborationkit-list-error-couldnotgetpage": "Error that appears if 
the requested page fails to load.",
+   "collaborationkit-list-error-generic": "A generic error on 
CollaborationListContent and its associated editing tools",
+   "collaborationkit-list-error-saving": "Error that appears when the page 
fails to save following edits",
"collaborationkit-list-move": "Tooltip for move icon on list editor",
"collaborationkit-list-move-summary": "Edit summary for moving an item 
on a CollaborationKit list. $1 = Item that is being moved.",
"collaborationkit-list-move-popup": "Popup notification for telling 
users an item was moved on a CollaborationKit list. $1 = Item being moved.",
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index f8e305f..ed3eb46 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -177,7 +177,7 @@
 
// Must be missing.
// FIXME sane error handling.
-   alert( 'Edit conflict detected' );
+   alert( mw.msg( 
'collaborationkit-list-error-editconflict' ) );
location.reload();
throw new Error( 'Item ' + title + ' is 
missing' );
};
@@ -227,7 +227,7 @@
) {
mw.log( 'Could not get page ' + pageId );
// FIXME better error handling
-   alert( 'Unhandled error fetching page with 
ajax' );
+   alert( mw.msg( 
'collaborationkit-list-error-couldnotgetpage' ) );
throw new Error( 'Could not get page' );
}
rev = data.query.pages[ pageId ].revisions[ 0 ];
@@ -240,7 +240,7 @@
res.content = JSON.parse( rev[ '*' ] );
callback( res );
} ).fail(
-   function () { alert( 'Unhandled ajax error' ); }
+   function () { alert( mw.msg( 
'collaborationkit-list-error-generic' ) ); }
);
};
 
@@ -260,7 +260,7 @@
basetimestamp: params.timestamp
} ).done( callback ).fail( function () {
// FIXME proper error handling.
-   alert( 'Unhandled error saving page' );
+ 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Updating hub-related tests; new files for future tests.

2017-02-06 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336375 )

Change subject: Updating hub-related tests; new files for future tests.
..

Updating hub-related tests; new files for future tests.

Change-Id: Ia37e3a4d9f5d5f1451e86a20515222d774b94462
---
M includes/content/CollaborationHubContentHandler.php
M tests/phpunit/CollaborationHubContentTest.php
A tests/phpunit/CollaborationHubTOCTest.php
A tests/phpunit/CollaborationKitImageTest.php
A tests/phpunit/CollaborationListContentHandlerTest.php
A tests/phpunit/CollaborationListContentTest.php
A tests/phpunit/SpecialCreateCollaborationHubTest.php
A tests/phpunit/SpecialCreateHubFeatureTest.php
8 files changed, 36 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/75/336375/1

diff --git a/includes/content/CollaborationHubContentHandler.php 
b/includes/content/CollaborationHubContentHandler.php
index b334213..71631d3 100644
--- a/includes/content/CollaborationHubContentHandler.php
+++ b/includes/content/CollaborationHubContentHandler.php
@@ -71,7 +71,7 @@
 * @return CollaborationHubContent
 */
public function makeEmptyContent() {
-   return new CollaborationHubContent( '{ "display_name": "", 
"introduction": "", "content": [] }' );
+   return new CollaborationHubContent( '{ "display_name": "", 
"introduction": "", "footer": "", "content": [] }' );
}
 
/**
diff --git a/tests/phpunit/CollaborationHubContentTest.php 
b/tests/phpunit/CollaborationHubContentTest.php
index f3da086..8964d54 100644
--- a/tests/phpunit/CollaborationHubContentTest.php
+++ b/tests/phpunit/CollaborationHubContentTest.php
@@ -9,7 +9,7 @@
$content = new CollaborationHubContent(
'{ "introduction": "Test content", "display_name": 
"foo",'
. '"footer": "More test content", "content": ['
-   . '{ "title": "Me!", "image": "cool.png" }'
+   . '{ "title": "Project:Wow", "image": "cool.png", 
"display_name": "Wow!" }'
. '] }'
);
$this->content = TestingAccessWrapper::newFromObject( $content 
);
@@ -27,7 +27,7 @@
[ $this->m(
'{ "introduction": "\'\'Test\'\' content", 
"display_name": "foo",'
. '"footer": "\'\'\'Test\'\'\' content footer", 
"content": ['
-   . '{ "title": "Me!", "image": "cool.png" }'
+   . '{ "title": "Project:Wow", "image": 
"cool.png", "display_name": "Wow!" }'
. '] }'
), 0 ],
[ ( new CollaborationHubContentHandler 
)->makeEmptyContent(), 1 ],
@@ -47,11 +47,11 @@
[ '{ afdsfda }' ],
[ '{ "introduction": 1, "display_name": "", "content": 
"" }' ],
[ '{ "display_name": [ "doggy" ], "content": "" }' ],
-   [ '{ "page_type": "food", "display_name": "", 
"content": "" }' ],
-   [ '{ "page_type": {}, "display_name": "", "content": "" 
}' ],
+   [ '{ "display_name": "", "content": "" }' ],
# FIXME Empty objects aren't being rejected like they 
should be.
# [ '{ "display_name": "", "content": {} }' ],
[ '{ "display_name": "", "content": [], "footer": [] }' 
],
+   [ '{ "display_name": "Legit", "content": { "title": 
"Project:Test/Test", "image": "bell", "display_title": "Test" } }']
];
}
 
@@ -94,7 +94,7 @@
 */
public function testContent( CollaborationHubContent $content, $id ) {
$expected = [
-   [ [ "title" => "Me!", "image" => "cool.png", 
"displayTitle" => null ] ],
+   [ [ "title" => "Project:Wow", "image" => "cool.png", 
"displayTitle" => null ] ],
[],
[],
];
@@ -133,12 +133,10 @@
public function testGetParsedContent() {
$this->markTestIncomplete();
// FIXME implement.
-   // getParsedContent does not appear to be entirely stable yet.
}
 
public function testFillParserOutput() {
$this->markTestIncomplete();
// FIXME implement.
-   // fillParserOutput does not appear to be entirely stable yet.
}
 }
diff --git a/tests/phpunit/CollaborationHubTOCTest.php 
b/tests/phpunit/CollaborationHubTOCTest.php
new file mode 100644
index 000..699217b
--- /dev/null
+++ b/tests/phpunit/CollaborationHubTOCTest.php
@@ -0,0 +1,5 @@
+https://gerrit.wikimedia.org/r/336375
To unsubscribe, visit 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Namespace selector for CreateCollaborationHub

2017-02-06 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336195 )

Change subject: Namespace selector for CreateCollaborationHub
..

Namespace selector for CreateCollaborationHub

Page is created in the namespace selected from the dropdown. I gutted the 
validation callback because I couldn't figure out how to get it to work with 
two pieces of input, so I just do title validation at a later stage.

The final product should *not* look like this. I know Isarra is working on the 
styling so I am deferring to her.

Bug: T155859
Change-Id: Ided3791360ebb127d96c380be015090e449a2115
---
M i18n/en.json
M i18n/qqq.json
M includes/SpecialCreateCollaborationHub.php
3 files changed, 33 insertions(+), 43 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/95/336195/1

diff --git a/i18n/en.json b/i18n/en.json
index c977116..1165642 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -9,7 +9,8 @@
"collaborationkit-desc": "Tools for building WikiProjects and on-wiki 
collaborative workspaces",
"createcollaborationhub": "Create new Collaboration Hub",
"createhubfeature": "Create a new Collaboration Hub feature",
-   "collaborationkit-createhub-title": "Page title",
+   "collaborationkit-createhub-namespace": "Namespace",
+   "collaborationkit-createhub-title": "Hub name",
"collaborationkit-createhub-invalidtitle": "The specified title is 
invalid.",
"collaborationkit-createhub-exists": "A page already exists with the 
specified title.",
"collaborationkit-createhub-nopermission": "You do not have permission 
to create a Collaboration Hub with this title",
@@ -118,7 +119,7 @@
"collaborationkit-createhub-wrongnamespace": "This page name cannot be 
used as a Collaboration Hub. Collaboration Hubs can only be created in the 
{{PLURAL:$1|$2 namespace|following namespaces: $2}}.",
"createcollaborationhub-text": "You are creating a new Collaboration 
Hub, a workspace for organizing a project. Once this page is created, you will 
be able to add features and make other edits.",
"collaborationkit-createhub-title-help": "Where to create the 
Collaboration Hub",
-   "collaborationkit-createhub-title-placeholder": "Project:...",
+   "collaborationkit-createhub-title-placeholder": "My New Project",
"collaborationkit-hubedit-displayname-help": "Used to refer to the 
project on other pages. Only needed if different from the page title.",
"collaborationkit-hubedit-image-help": "An image or icon to represent 
the project",
"collaborationkit-hubedit-introduction-placeholder": "Introduce your 
project here! Tell us what you want to do.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4a77816..4adf7ea 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -12,7 +12,8 @@
"collaborationkit-desc": 
"{{desc|name=CollaborationKit|url=https://www.mediawiki.org/wiki/Extension:CollaborationKit}};,
"createcollaborationhub": "Header for Special:CreateCollaborationHub",
"createhubfeature": "Header for Special:CreateHubFeature. Hubs are the 
WikiProject pages as a whole, and \"features\" are the sections inside them.",
-   "collaborationkit-createhub-title": "Label for target page title input 
on Special:CreateCollaborationHub\n{{Identical|Page title}}",
+   "collaborationkit-createhub-namespace": "Label for namespace of page 
title input on Special:CreateCollaborationHub",
+   "collaborationkit-createhub-title": "Label for target page title input 
(without namespace) on Special:CreateCollaborationHub",
"collaborationkit-createhub-invalidtitle": "Error message for an 
invalid title",
"collaborationkit-createhub-exists": "Error message for attempting to 
create a page that already exists",
"collaborationkit-createhub-nopermission": "Error message for no 
permission to edit/create/whatever",
diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 4401229..aafb639 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -34,14 +34,28 @@
 * @return array
 */
protected function getFormFields() {
+   $allowedNamespaces = $this->getConfig()->get( 
'CollaborationListAllowedNamespaces' );
+   $namespaceNames = $this->getLanguage()->getNamespaces();
+   $namespaceChoices = [];
+   foreach ( $allowedNamespaces as $nsIndex => $nsCanBeUsed ) {
+   $namespaceChoices[ $namespaceNames[ $nsIndex ] ] = 
$nsIndex;
+   }
 
$fields = [
// autofilled from how they got here, hopefully
+
+   'namespace' => [
+   'type' => 'select',
+   'options' => 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding messages for errors in Collaboration List editing tools.

2017-02-05 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336174 )

Change subject: Adding messages for errors in Collaboration List editing tools.
..

Adding messages for errors in Collaboration List editing tools.

Bug: T155651
Change-Id: Iba8c53fb92f0ccdc9e48401efc3f5e6b4959d9f8
---
M i18n/en.json
M i18n/qqq.json
M modules/ext.CollaborationKit.list.edit.js
M modules/ext.CollaborationKit.list.ui.js
4 files changed, 14 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/74/336174/1

diff --git a/i18n/en.json b/i18n/en.json
index c977116..adff1ec 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -44,6 +44,10 @@
"collaborationkit-list-add-summary": "/* $1 */ Adding to list.",
"collaborationkit-list-add-self-summary": "/* $1 */ Joining project.",
"collaborationkit-list-alreadyadded": "You are already a member of this 
project.",
+   "collaborationkit-list-error-editconflict": "There was an edit 
conflict, and your change was not saved. Please refresh the page and try 
again.",
+   "collaborationkit-list-error-couldnotgetpage": "The page failed to 
load. Please refresh the page and try again.",
+   "collaborationkit-list-error-generic": "There was an error. Please 
refresh the page and try again.",
+   "collaborationkit-list-error-saving": "Your edits to the list did not 
save. Please refresh the page and try again.",
"collaborationkit-list-move": "Re-order this item",
"collaborationkit-list-move-summary": "/* $1 */ Reordering item [[$1]]",
"collaborationkit-list-move-popup": "Successfully saved: $1 was 
re-ordered.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4a77816..adcc79e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -47,6 +47,10 @@
"collaborationkit-list-add-summary": "Edit summary when adding a new 
item to CollaborationKit list page",
"collaborationkit-list-add-self-summary": "Edit summary if the user 
clicked the one-click add self to membership list button 
(collaborationkit-list-add-self).",
"collaborationkit-list-alreadyadded": "Error if the user pressed the 
button labelled by collaborationkit-list-add-self but is already on the list",
+   "collaborationkit-list-error-editconflict": "Error that appears if 
there is an edit conflict",
+   "collaborationkit-list-error-couldnotgetpage": "Error that appears if 
the requested page fails to load.",
+   "collaborationkit-list-error-generic": "A generic error on 
CollaborationListContent and its associated editing tools",
+   "collaborationkit-list-error-saving": "Error that appears when the page 
fails to save following edits",
"collaborationkit-list-move": "Tooltip for move icon on list editor",
"collaborationkit-list-move-summary": "Edit summary for moving an item 
on a CollaborationKit list. $1 = Item that is being moved.",
"collaborationkit-list-move-popup": "Popup notification for telling 
users an item was moved on a CollaborationKit list. $1 = Item being moved.",
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index f8e305f..1f8be3c 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -177,7 +177,7 @@
 
// Must be missing.
// FIXME sane error handling.
-   alert( 'Edit conflict detected' );
+   alert( mw.msg( 
'collaborationkit-list-error-editconflict' );
location.reload();
throw new Error( 'Item ' + title + ' is 
missing' );
};
@@ -227,7 +227,7 @@
) {
mw.log( 'Could not get page ' + pageId );
// FIXME better error handling
-   alert( 'Unhandled error fetching page with 
ajax' );
+   alert( mw.msg( 
'collaborationkit-list-error-couldnotgetpage' ) );
throw new Error( 'Could not get page' );
}
rev = data.query.pages[ pageId ].revisions[ 0 ];
@@ -240,7 +240,7 @@
res.content = JSON.parse( rev[ '*' ] );
callback( res );
} ).fail(
-   function () { alert( 'Unhandled ajax error' ); }
+   function () { alert( mw.msg( 
'collaborationkit-list-error-generic' ) ); }
);
};
 
@@ -260,7 +260,7 @@
basetimestamp: params.timestamp
} ).done( callback ).fail( function () {
// FIXME proper error handling.
-   alert( 'Unhandled error 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow Title object to optionally be passed as a parameter to...

2017-02-05 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336173 )

Change subject: Allow Title object to optionally be passed as a parameter to 
getWikitextForTransclusion() and convert().
..

Allow Title object to optionally be passed as a parameter to 
getWikitextForTransclusion() and convert().

CollaborationKit requires the name of the template from which wikitext is being 
gotten for transclusion. This parameter allows the Parser to pass the title 
through the Content class and so on. It is defined as an optional variable so 
nothing should break.

Change-Id: Id45fb7558f5c7031f8cab819d63c581c7902a0c2
---
M includes/content/AbstractContent.php
M includes/content/Content.php
M includes/content/MessageContent.php
M includes/content/TextContent.php
M includes/parser/Parser.php
5 files changed, 14 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/336173/1

diff --git a/includes/content/AbstractContent.php 
b/includes/content/AbstractContent.php
index 811b241..6b92501 100644
--- a/includes/content/AbstractContent.php
+++ b/includes/content/AbstractContent.php
@@ -439,12 +439,13 @@
 *
 * @param string $toModel
 * @param string $lossy
+* @param Title $refTitle The referenced Title. Optional.
 *
 * @return Content|bool
 *
 * @see Content::convert()
 */
-   public function convert( $toModel, $lossy = '' ) {
+   public function convert( $toModel, $lossy = '', $refTitle = null ) {
if ( $this->getModel() === $toModel ) {
// nothing to do, shorten out.
return $this;
diff --git a/includes/content/Content.php b/includes/content/Content.php
index 6a0a63b..b15bb88 100644
--- a/includes/content/Content.php
+++ b/includes/content/Content.php
@@ -47,7 +47,7 @@
 
/**
 * @since 1.21
-*
+* @param Title $refTitle The referenced Title. Optional.
 * @return string|bool The wikitext to include when another page 
includes this
 * content, or false if the content is not includable in a wikitext 
page.
 *
@@ -57,7 +57,7 @@
 * @todo Used in WikiPage and MessageCache to get message text. Not so
 *  nice. What should we use instead?!
 */
-   public function getWikitextForTransclusion();
+   public function getWikitextForTransclusion( $refTitle = null );
 
/**
 * Returns a textual representation of the content suitable for use in 
edit
@@ -512,11 +512,12 @@
 * @param string $lossy Optional flag, set to "lossy" to allow lossy 
conversion. If lossy
 * conversion is not allowed, full round-trip conversion is expected to 
work without losing
 * information.
+* @param Title $refTitle The referenced Title. Optional.
 *
 * @return Content|bool A content object with the content model 
$toModel, or false if
 * that conversion is not supported.
 */
-   public function convert( $toModel, $lossy = '' );
+   public function convert( $toModel, $lossy = '', $refTitle );
// @todo ImagePage and CategoryPage interfere with per-content action 
handlers
// @todo nice integration of GeSHi syntax highlighting
//   [11:59]  Hooks are ugly; make CodeHighlighter interface and a
diff --git a/includes/content/MessageContent.php 
b/includes/content/MessageContent.php
index 4b58989..e2eb37e 100644
--- a/includes/content/MessageContent.php
+++ b/includes/content/MessageContent.php
@@ -97,11 +97,12 @@
}
 
/**
+* @param Title $refTitle The referenced Title. Optional.
 * @return string
 *
 * @see Content::getWikitextForTransclusion
 */
-   public function getWikitextForTransclusion() {
+   public function getWikitextForTransclusion( $refTitle = null ) {
return $this->getWikitext();
}
 
diff --git a/includes/content/TextContent.php b/includes/content/TextContent.php
index 7bb4def..fb08c77 100644
--- a/includes/content/TextContent.php
+++ b/includes/content/TextContent.php
@@ -134,11 +134,11 @@
 * and then returns the text string. The conversion may be lossy.
 *
 * @note this allows any text-based content to be transcluded as if it 
was wikitext.
-*
+* @param Title $refTitle The referenced Title. Optional.
 * @return string|bool The raw text, or false if the conversion failed.
 */
-   public function getWikitextForTransclusion() {
-   $wikitext = $this->convert( CONTENT_MODEL_WIKITEXT, 'lossy' );
+   public function getWikitextForTransclusion( $refTitle = null ) {
+   $wikitext = $this->convert( CONTENT_MODEL_WIKITEXT, 'lossy', 
$refTitle );
 
if ( $wikitext ) {
return 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Preventing hub transclusion from causing exception.

2017-02-05 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336172 )

Change subject: Preventing hub transclusion from causing exception.
..

Preventing hub transclusion from causing exception.

When a CollaborationHubContent page is transcluded, it will return the hub 
image and intro. It can't do more because much of CollaborationHubContent 
relies on fillParserOutput (i.e. straight HTML) rather than something like 
wikitext that can be fed into the parser. Would be worth investigating to see 
if this can be fixed.

Bug: T157228
Change-Id: Id0d27a755e6cec02ec0efaf8fc99df54139724e6
---
M includes/content/CollaborationHubContent.php
1 file changed, 7 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/72/336172/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 439f753..8599222 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -716,12 +716,13 @@
 */
public function convert( $toModel, $lossy = '' ) {
if ( $toModel === CONTENT_MODEL_WIKITEXT && $lossy === 'lossy' 
) {
-   global $wgContLang;
-   // using wgContLang is kind of icky. Maybe we should 
transclude
-   // from mediawiki namespace, or give up on not 
splitting the
-   // parser cache and just use {{int:... (?)
-   $renderOpts = $this->getFullRenderListOptions();
-   $text = $this->convertToWikitext( $wgContLang, 
$renderOpts );
+   // Not ideal at all, but without access to the name of 
the page being transcluded, we
+   // can't embed the rest of the page. This is just a 
holdover to prevent the thing from
+   // throwing an exception.
+   $this->decode();
+   $image = $this->getImage();
+   $intro = $this->getIntroduction();
+   $text = "[[File:$image|200px|left]]\n$intro";
return ContentHandler::makeContent( $text, null, 
$toModel );
} elseif ( $toModel === CONTENT_MODEL_JSON ) {
return ContentHandler::makeContent( 
$this->getNativeData(), null, $toModel );

-- 
To view, visit https://gerrit.wikimedia.org/r/336172
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0d27a755e6cec02ec0efaf8fc99df54139724e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Flex wrap support for legacy browsers.

2017-02-05 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336109 )

Change subject: Flex wrap support for legacy browsers.
..

Flex wrap support for legacy browsers.

Change-Id: I0182ece38de23aa0eeac782026c50280e93a6287
---
M modules/ext.CollaborationKit.list.styles.less
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/modules/ext.CollaborationKit.list.styles.less 
b/modules/ext.CollaborationKit.list.styles.less
index 08ded8b..9bea1ce 100644
--- a/modules/ext.CollaborationKit.list.styles.less
+++ b/modules/ext.CollaborationKit.list.styles.less
@@ -43,6 +43,9 @@
 /* Multilist stuff */
 .mw-ck-multilist {
.flex-display;
+   -webkit-flex-wrap: wrap;
+   -moz-flex-wrap: wrap;
+   -ms-flex-wrap: wrap;
flex-wrap: wrap;
margin: 0 -.5em;
 
@@ -53,6 +56,9 @@
margin: .5em;
min-width: 20em; // Todo something smarter for mobile/genuinely 
narrow things?
max-width: 35em;
+   -webkit-flex-basis: 25em;
+   -moz-flex-basis: 25em;
+   -ms-flex-basis: 25em;
flex-basis: 25em;
box-sizing: border-box;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/336109
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0182ece38de23aa0eeac782026c50280e93a6287
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Slight button re-styling

2017-02-04 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336053 )

Change subject: Slight button re-styling
..

Slight button re-styling

Making section edit/view buttons framed; Otherwise, it's hard to differentiate 
them from the content.

Also making the bottom buttons non-primary to avoid theme clashes. Also adding 
icons.

Change-Id: I7ea8558e8c45790613e2605905244a1bd28ad115
---
M includes/content/CollaborationHubContent.php
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/53/336053/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 7564871..dc8ae17 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -448,14 +448,16 @@
$html .= new OOUI\ButtonWidget( [
'label' => wfMessage( 
'collaborationkit-hub-manage' )->inContentLanguage()->text(),
'href' => $title->getLocalURL( [ 'action' => 
'edit' ] ),
-   'flags' => [ 'primary', 'progressive' ]
+   'flags' => [ 'progressive' ],
+   'icon' => 'edit'
] );
 
// TODO make sure they have create permission, too
$html .= new OOUI\ButtonWidget( [
'label' => wfMessage( 
'collaborationkit-hub-addpage' )->inContentLanguage()->text(),
'href' => SpecialPage::getTitleFor( 
'CreateHubFeature' )->getFullUrl( [ 'collaborationhub' => $title->getFullText() 
] ),
-   'flags' => [ 'primary', 'progressive' ]
+   'flags' => [ 'progressive' ],
+   'icon' => 'add'
] );
}
 
@@ -642,7 +644,7 @@
$html = new OOUI\ButtonWidget( [
'label' => $message,
'href' => $link,
-   'framed' => false,
+   'framed' => true,
'icon' => $icon
] );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/336053
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ea8558e8c45790613e2605905244a1bd28ad115
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing bug caused by non-existent image being used

2017-02-04 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336050 )

Change subject: Fixing bug caused by non-existent image being used
..

Fixing bug caused by non-existent image being used

Change-Id: I142685bd7dbd3e9f9d082d490423e5633f771921
---
M includes/content/CollaborationListContent.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/50/336050/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index c2763be..960c76d 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -397,7 +397,10 @@
if ( $definedImage !== null && is_string( $definedImage ) ) {
$imageTitle = Title::newFromText( $definedImage, 
NS_FILE );
if ( $imageTitle ) {
-   $image = wfFindFile( $imageTitle )->getName();
+   $imageObj = wfFindFile( $imageTitle );
+   if ( $imageObj ) {
+   $image = $imageObj->getName();
+   }
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/336050
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I142685bd7dbd3e9f9d082d490423e5633f771921
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Removing non-sensical line.

2017-02-03 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335979 )

Change subject: Removing non-sensical line.
..

Removing non-sensical line.

Change-Id: Id082bdd416bb8f7ec6bfd4f582c7f520528d17a5
---
M includes/content/CollaborationHubTOC.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/79/335979/1

diff --git a/includes/content/CollaborationHubTOC.php 
b/includes/content/CollaborationHubTOC.php
index 20dde3a..5bc8606 100644
--- a/includes/content/CollaborationHubTOC.php
+++ b/includes/content/CollaborationHubTOC.php
@@ -16,7 +16,6 @@
$linkCounter = 1;
while ( in_array( $link2, $this->tocLinks ) ) {
$link2 = $link . '_' . $linkCounter;
-   $spPageLinkCounter++;
}
$this->tocLinks[] = $link2;
return $link2;

-- 
To view, visit https://gerrit.wikimedia.org/r/335979
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id082bdd416bb8f7ec6bfd4f582c7f520528d17a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Refactored image- and icon-related functionality.

2017-02-03 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335772 )

Change subject: Refactored image- and icon-related functionality.
..

Refactored image- and icon-related functionality.

This replaces the CollaborationKitIcon class with a new CollaborationKitImage 
class that handles image and icon loading for the whole extension.

This also fixes the bug with list icons.

Bug: T148083
Bug: T148084
Change-Id: If932d2e80ca65c612c6f66c43ab926be00941634
---
M extension.json
M includes/SpecialCreateHubFeature.php
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubTOC.php
D includes/content/CollaborationKitIcon.php
A includes/content/CollaborationKitImage.php
M includes/content/CollaborationListContent.php
M includes/content/CollaborationListContentSchema.php
8 files changed, 329 insertions(+), 234 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/72/335772/1

diff --git a/extension.json b/extension.json
index a7bafb7..3f334da 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CollaborationKit",
-   "version": "0.3",
+   "version": "0.4",
"author": [ "Kim Schoonover", "Brian Wolff", "James Hare" ],
"url": "https://www.mediawiki.org/wiki/Extension:CollaborationKit;,
"descriptionmsg": "collaborationkit-desc",
@@ -22,7 +22,7 @@
"CollaborationHubContentHandler": 
"includes/content/CollaborationHubContentHandler.php",
"CollaborationHubContentEditor": 
"includes/CollaborationHubContentEditor.php",
"CollaborationHubTOC": 
"includes/content/CollaborationHubTOC.php",
-   "CollaborationKitIcon": 
"includes/content/CollaborationKitIcon.php",
+   "CollaborationKitImage": 
"includes/content/CollaborationKitImage.php",
"CollaborationListContent": 
"includes/content/CollaborationListContent.php",
"CollaborationListContentHandler": 
"includes/content/CollaborationListContentHandler.php",
"CollaborationListContentEditor": 
"includes/CollaborationListContentEditor.php",
diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index b64176b..7063467 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -20,7 +20,7 @@
$output = $this->getContext()->getOutput();
$output->addModules( 'ext.CollaborationKit.iconbrowser' );
$output->addModuleStyles( 'ext.CollaborationKit.edit.styles' );
-   $output->addJsConfigVars( 'wgCollaborationKitIconList', 
CollaborationKitIcon::getCannedIcons() );
+   $output->addJsConfigVars( 'wgCollaborationKitIconList', 
CollaborationKitImage::getCannedIcons() );
parent::execute( $par );
}
 
@@ -43,7 +43,7 @@
$defaultFeatureName = '';
}
 
-   $icons = CollaborationKitIcon::getCannedIcons();
+   $icons = CollaborationKitImage::getCannedIcons();
$iconChoices = array_combine( $icons, $icons );
 
$fields = [
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index edf956c..e958571 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -356,7 +356,8 @@
'maxItems' => 3,
'defaultSort' => 'random',
'columns' => [ $activeCol ],
-   'showColumnHeaders' => false
+   'showColumnHeaders' => false,
+   'iconWidth' => 32
]
);
 
@@ -661,8 +662,7 @@
 */
protected function getTableOfContents( Title $title, ParserOptions 
$options ) {
$toc = new CollaborationHubTOC();
-
-   return $toc->renderTOC( $this->content, $this->themeColour );
+   return $toc->renderToC( $this->content );
}
 
/**
@@ -673,7 +673,7 @@
 * @return string
 */
public function getParsedImage( $image, $size = 200 ) {
-   return CollaborationKitIcon::makeIconOrImage( 
$this->getImage(), $size, 'puzzlepiece' );
+   return CollaborationKitImage::makeImage( $image, $size, [ 
'fallback' => 'puzzlepiece' ] );
}
 
/**
diff --git a/includes/content/CollaborationHubTOC.php 
b/includes/content/CollaborationHubTOC.php
index 5ebdaf4..20dde3a 100644
--- a/includes/content/CollaborationHubTOC.php
+++ b/includes/content/CollaborationHubTOC.php
@@ -1,7 +1,5 @@
 getSubpageText();
}

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Clarifying messages.

2017-01-27 Thread Harej (Code Review)
Harej has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/334730 )

Change subject: Clarifying messages.
..


Clarifying messages.

Bug: T155653
Change-Id: I3e85f4fed0d331f9c8517507bd50b911c511f7b7
---
M i18n/en.json
1 file changed, 12 insertions(+), 12 deletions(-)

Approvals:
  jenkins-bot: Verified
  Isarra: Looks good to me, approved



diff --git a/i18n/en.json b/i18n/en.json
index d5ed66b..c977116 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -6,12 +6,12 @@
"bawolff"
]
},
-   "collaborationkit-desc": "Next-generation WikiProjects and 
collaborative workspaces for wikis",
+   "collaborationkit-desc": "Tools for building WikiProjects and on-wiki 
collaborative workspaces",
"createcollaborationhub": "Create new Collaboration Hub",
"createhubfeature": "Create a new Collaboration Hub feature",
"collaborationkit-createhub-title": "Page title",
"collaborationkit-createhub-invalidtitle": "The specified title is 
invalid.",
-   "collaborationkit-createhub-exists": "A page already exists with the 
specified title, and there is no support yet for imports",
+   "collaborationkit-createhub-exists": "A page already exists with the 
specified title.",
"collaborationkit-createhub-nopermission": "You do not have permission 
to create a Collaboration Hub with this title",
"collaborationkit-createhub-editsummary": "Created new Collaboration 
Hub",
"collaborationkit-createhubfeature-collaborationhub": "Parent 
Collaboration Hub",
@@ -29,14 +29,14 @@
"collaborationkit-createhubfeature-freetext": "Generic wiki page",
"collaborationkit-createhubfeature-articlelist": "List of pages",
"collaborationkit-list-isempty": "This list has no columns or items.",
-   "collaborationkit-list-emptycolumn": "This list has no items in it.",
+   "collaborationkit-list-emptycolumn": "This column has no items in it.",
"collaborationkit-list-invalid": "This content does not meet the 
requirements of the CollaborationListContent schema. This may happen as a 
result of a software update. The content is reproduced below.",
-   "collaborationkit-list-notlist": "[[$1]] is not a CollaborationKit list 
page",
+   "collaborationkit-list-notlist": "[[$1]] is not a Collaboration List 
page",
"collaborationkit-list-taglist": "'''{{PLURAL:$2|Tagged:|Tags:}}''' $1 
",
"collaborationkit-list-toomanytags": "You are not allowed to specify 
more than {{PLURAL:$1|one tag|$1 tags}}.",
"collaborationkit-list-delete": "Remove item",
"collaborationkit-list-delete-summary": "/* $1 */ Deleting from list.",
-   "collaborationkit-list-delete-popup": "List was saved with $1 deleted.",
+   "collaborationkit-list-delete-popup": "Successfully saved: $1 was 
deleted from the list.",
"collaborationkit-list-delete-popup-title": "Item Deleted",
"collaborationkit-list-add": "Add new item to list",
"collaborationkit-list-add-user": "Add user to list",
@@ -46,7 +46,7 @@
"collaborationkit-list-alreadyadded": "You are already a member of this 
project.",
"collaborationkit-list-move": "Re-order this item",
"collaborationkit-list-move-summary": "/* $1 */ Reordering item [[$1]]",
-   "collaborationkit-list-move-popup": "List was saved with new order for 
$1",
+   "collaborationkit-list-move-popup": "Successfully saved: $1 was 
re-ordered.",
"collaborationkit-list-move-popup-title": "Page Saved",
"collaborationkit-list-newitem-title": "Add item to list",
"collaborationkit-list-newitem-label": "Add to list",
@@ -63,12 +63,12 @@
"collaborationkit-hubedit-colour": "Hub theme Color",
"collaborationkit-hubedit-content": "Features",
"collaborationkit-editjsontab": "Edit as JSON",
-   "collaborationkit-hub-announcements-initial": "A new collaboration hub 
has been set up!",
+   "collaborationkit-hub-announcements-initial": "A new Collaboration Hub 
has been set up!",
"collaborationkit-hub-members-description": "Our members are below. 
Those who have not edited in over a month are moved to the inactive section.",
"collaborationkit-hub-members-header": "Meet our members!",
"collaborationkit-hub-members-signup": "Join",
"collaborationkit-hub-members-view": "View full list",
-   "collaborationkit-hub-missingpage-note": "This feature does not exist. 
You can create a new project feature using the button below.",
+   "collaborationkit-hub-missingpage-note": "This feature does not exist. 
You can create a new feature using the button below.",
"collaborationkit-hub-missingpage-create": "Create feature",
"collaborationkit-hub-pagetitle-members": "Members",
"collaborationkit-hub-pagetitle-announcements": "Announcements",
@@ 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Clarifying messages.

2017-01-27 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334730 )

Change subject: Clarifying messages.
..

Clarifying messages.

Bug: T155653
Change-Id: I3e85f4fed0d331f9c8517507bd50b911c511f7b7
---
M i18n/en.json
1 file changed, 12 insertions(+), 12 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/30/334730/1

diff --git a/i18n/en.json b/i18n/en.json
index d5ed66b..c977116 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -6,12 +6,12 @@
"bawolff"
]
},
-   "collaborationkit-desc": "Next-generation WikiProjects and 
collaborative workspaces for wikis",
+   "collaborationkit-desc": "Tools for building WikiProjects and on-wiki 
collaborative workspaces",
"createcollaborationhub": "Create new Collaboration Hub",
"createhubfeature": "Create a new Collaboration Hub feature",
"collaborationkit-createhub-title": "Page title",
"collaborationkit-createhub-invalidtitle": "The specified title is 
invalid.",
-   "collaborationkit-createhub-exists": "A page already exists with the 
specified title, and there is no support yet for imports",
+   "collaborationkit-createhub-exists": "A page already exists with the 
specified title.",
"collaborationkit-createhub-nopermission": "You do not have permission 
to create a Collaboration Hub with this title",
"collaborationkit-createhub-editsummary": "Created new Collaboration 
Hub",
"collaborationkit-createhubfeature-collaborationhub": "Parent 
Collaboration Hub",
@@ -29,14 +29,14 @@
"collaborationkit-createhubfeature-freetext": "Generic wiki page",
"collaborationkit-createhubfeature-articlelist": "List of pages",
"collaborationkit-list-isempty": "This list has no columns or items.",
-   "collaborationkit-list-emptycolumn": "This list has no items in it.",
+   "collaborationkit-list-emptycolumn": "This column has no items in it.",
"collaborationkit-list-invalid": "This content does not meet the 
requirements of the CollaborationListContent schema. This may happen as a 
result of a software update. The content is reproduced below.",
-   "collaborationkit-list-notlist": "[[$1]] is not a CollaborationKit list 
page",
+   "collaborationkit-list-notlist": "[[$1]] is not a Collaboration List 
page",
"collaborationkit-list-taglist": "'''{{PLURAL:$2|Tagged:|Tags:}}''' $1 
",
"collaborationkit-list-toomanytags": "You are not allowed to specify 
more than {{PLURAL:$1|one tag|$1 tags}}.",
"collaborationkit-list-delete": "Remove item",
"collaborationkit-list-delete-summary": "/* $1 */ Deleting from list.",
-   "collaborationkit-list-delete-popup": "List was saved with $1 deleted.",
+   "collaborationkit-list-delete-popup": "Successfully saved: $1 was 
deleted from the list.",
"collaborationkit-list-delete-popup-title": "Item Deleted",
"collaborationkit-list-add": "Add new item to list",
"collaborationkit-list-add-user": "Add user to list",
@@ -46,7 +46,7 @@
"collaborationkit-list-alreadyadded": "You are already a member of this 
project.",
"collaborationkit-list-move": "Re-order this item",
"collaborationkit-list-move-summary": "/* $1 */ Reordering item [[$1]]",
-   "collaborationkit-list-move-popup": "List was saved with new order for 
$1",
+   "collaborationkit-list-move-popup": "Successfully saved: $1 was 
re-ordered.",
"collaborationkit-list-move-popup-title": "Page Saved",
"collaborationkit-list-newitem-title": "Add item to list",
"collaborationkit-list-newitem-label": "Add to list",
@@ -63,12 +63,12 @@
"collaborationkit-hubedit-colour": "Hub theme Color",
"collaborationkit-hubedit-content": "Features",
"collaborationkit-editjsontab": "Edit as JSON",
-   "collaborationkit-hub-announcements-initial": "A new collaboration hub 
has been set up!",
+   "collaborationkit-hub-announcements-initial": "A new Collaboration Hub 
has been set up!",
"collaborationkit-hub-members-description": "Our members are below. 
Those who have not edited in over a month are moved to the inactive section.",
"collaborationkit-hub-members-header": "Meet our members!",
"collaborationkit-hub-members-signup": "Join",
"collaborationkit-hub-members-view": "View full list",
-   "collaborationkit-hub-missingpage-note": "This feature does not exist. 
You can create a new project feature using the button below.",
+   "collaborationkit-hub-missingpage-note": "This feature does not exist. 
You can create a new feature using the button below.",
"collaborationkit-hub-missingpage-create": "Create feature",
"collaborationkit-hub-pagetitle-members": "Members",

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Allowing empty columns to have labels and descriptions

2017-01-26 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334494 )

Change subject: Allowing empty columns to have labels and descriptions
..

Allowing empty columns to have labels and descriptions

Bug: T155661
Change-Id: I1b5171d97b290552215272db3e72e1f1dfa93df0
---
M includes/content/CollaborationListContent.php
1 file changed, 12 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/94/334494/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 12253d6..cdfea78 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -734,12 +734,12 @@
}
 
private static function convertFromHumanEditableColumn( $column ) {
+   // Adding newline so that HUMAN_COLUMN_SPLIT2 correctly triggers
+   $column = $column . "\n";
+
$columnItem = [ 'items' => [] ];
 
$columnContent = explode( self::HUMAN_COLUMN_SPLIT2, $column );
-   if ( count( $columnContent ) == 1 ) {
-   return $columnItem;
-   }
 
$parts = explode( "|", $columnContent[0] );
 
@@ -775,11 +775,15 @@
}
}
 
-   $listLines = explode( "\n", $columnContent[1] );
-   foreach ( $listLines as $line ) {
-   // Skip empty lines
-   if ( trim( $line ) !== '' ) {
-   $columnItem['items'][] = 
self::convertFromHumanEditableItemLine( $line );
+   if ( count( $columnContent ) == 1 ) {
+   return $columnItem;
+   } else {
+   $listLines = explode( "\n", $columnContent[1] );
+   foreach ( $listLines as $line ) {
+   // Skip empty lines
+   if ( trim( $line ) !== '' ) {
+   $columnItem['items'][] = 
self::convertFromHumanEditableItemLine( $line );
+   }
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/334494
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b5171d97b290552215272db3e72e1f1dfa93df0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: [WIP] Fixing bugs causing JS-based browsers to stall

2017-01-23 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333803 )

Change subject: [WIP] Fixing bugs causing JS-based browsers to stall
..

[WIP] Fixing bugs causing JS-based browsers to stall

Also specifying default hub image in the absence of input

Bug: T155615
Bug: T155579
Change-Id: I0966e7c5fd6c1d0e4878187bc212fa3facf6e264
---
M includes/SpecialCreateHubFeature.php
M modules/ext.CollaborationKit.colour.js
M modules/ext.CollaborationKit.hubimage.js
M modules/ext.CollaborationKit.icon.js
4 files changed, 46 insertions(+), 18 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/03/333803/1

diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index a1af255..b64176b 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -65,7 +65,8 @@
'cssclass' => 'mw-ck-icon-input',
'label-message' => 
'collaborationkit-createhubfeature-icon',
'help-message' => 
'collaborationkit-createhubfeature-icon-help',
-   'options' => $iconChoices
+   'options' => $iconChoices,
+   'default' => 'circlestar'
],
'contenttype' => [
'type' => 'radio',
diff --git a/modules/ext.CollaborationKit.colour.js 
b/modules/ext.CollaborationKit.colour.js
index 9841661..18df988 100644
--- a/modules/ext.CollaborationKit.colour.js
+++ b/modules/ext.CollaborationKit.colour.js
@@ -59,6 +59,8 @@
classes: [ 'mw-ck-colourchoice-container' ]
} );
 
+   this.radioSelect.selectItemByData( $( '.mw-ck-colour-input 
select' ).val() );
+
this.content.$element.append( this.radioSelect.$element );
 
this.$body.append( this.content.$element );
diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index 1c02c01..365249d 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -17,9 +17,28 @@
// Use the initialize() method to add content to the dialog's $body,
// to initialize widgets, and to set up event handlers.
ProcessDialog.prototype.initialize = function () {
+   var defaultSearchTerm;
+
ProcessDialog.super.prototype.initialize.apply( this, arguments 
);
 
-   this.content = new mw.widgets.MediaSearchWidget();
+   // Default image search flow:
+   // First work off of existing value for hub image, if it exists
+   // If no hub image (new hub creation), search display title or 
page title
+   // If nothing specified, fill in a filename for a generic icon
+
+   if ( $( '.mw-ck-hub-image-input input' ).val() != '' ) {
+   defaultSearchTerm = $( '.mw-ck-hub-image-input input' 
).val();
+   } else if ( $( 'input[name=wpdisplay_name]' ).val() != '' ) {
+   defaultSearchTerm = $( 'input[name=wpdisplay_name]' 
).val();
+   } else if ( $( 'input[name=wptitle]' ).val() != '' ) {
+   defaultSearchTerm = $( 'input[name=wptitle]' ).val();
+   } else {
+   defaultSearchTerm = 'OOjs UI icon puzzle-ltr.svg';
+   }
+
+   this.content = new mw.widgets.MediaSearchWidget( {
+   value: defaultSearchTerm
+   } );
this.$body.append( this.content.$element );
};
 
@@ -30,24 +49,27 @@
 
dialog = this;
if ( action ) {
-   return new OO.ui.Process( function () {
-   fileObj = 
dialog.content.getResults().getSelectedItem().getData();
-   fileUrl = fileObj.thumburl;
-   fileTitle = new mw.Title( fileObj.title );
-   fileTitle = fileTitle.title + '.' + 
fileTitle.ext;
+   if ( $( '.mw-ck-hub-image-input input' ).val() != '' ) {
+   return new OO.ui.Process( function () {
+   fileObj = 
dialog.content.getResults().getSelectedItem().getData();
+   fileUrl = fileObj.thumburl;
+   fileTitle = new mw.Title( fileObj.title 
);
+   fileTitle = fileTitle.title + '.' + 
fileTitle.ext;
 
-   // Generate preview
-   $( 'img.hubimagePreview' )
-   .attr( 'style', 'display:block' )
-

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Restoring help-message icons for image browser and icon brow...

2017-01-22 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333481 )

Change subject: Restoring help-message icons for image browser and icon browser.
..

Restoring help-message icons for image browser and icon browser.

Note that colour browser never had a help-message icon to begin with.

Bug: T155649
Change-Id: Iddf8a18a431d7b5d28445a66e1ea154c891c0375
---
M modules/ext.CollaborationKit.colour.js
M modules/ext.CollaborationKit.hubimage.js
M modules/ext.CollaborationKit.icon.js
3 files changed, 6 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/81/333481/1

diff --git a/modules/ext.CollaborationKit.colour.js 
b/modules/ext.CollaborationKit.colour.js
index 6d777d0..9841661 100644
--- a/modules/ext.CollaborationKit.colour.js
+++ b/modules/ext.CollaborationKit.colour.js
@@ -135,9 +135,8 @@
 
curColour = $( 'div.mw-ck-colour-input select option:selected' 
).val();
 
-   $( 'div.oo-ui-fieldLayout-field div.mw-ck-colour-input' ).css( 
'display', 'none' );
-   $( '.mw-ck-colour-input' ).addClass( 'colour-browser-field' );
-   $( '.mw-ck-colour-input' ).append(
+   $( '.mw-ck-colour-input .oo-ui-dropdownWidget' ).css( 
'display', 'none' );
+   $( '.mw-ck-colour-input .mw-ck-colour-input' ).append(
$( '' )
.append( getColourBlock( curColour ) )
.append(
diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index 916a619..1c02c01 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -79,14 +79,13 @@
hubimageBrowserButton.setLabel( mw.msg( 
'collaborationkit-hubimage-launchbutton' ) );
hubimageBrowserButton.on( 'click', openItUp );
 
-   $( 'div.mw-ck-hub-image-input' ).addClass( 'hubimage-browser-field' );
-   $( 'div.mw-ck-hub-image-input div' ).css( 'display', 'none' );
-   $( 'div.mw-ck-hub-image-input' )
+   $( 'div.mw-ck-hub-image-input input' ).css( 'display', 'none' );
+   $( 'div.mw-ck-hub-image-input div.oo-ui-textInputWidget' )
.append( '' )
.append( hubimageBrowserButton.$element )
.append( '' );
// Load current hub image
-   if ( $( 'div.mw-ck-hub-image-input input' ).val() !== undefined ) {
+   if ( $( 'div.mw-ck-hub-image-input input' ).val() !== '' ) {
currentImageFilename = 'File:' + $( 'div.mw-ck-hub-image-input 
input' ).val();
currentImage = new mw.Api()
.get( {
diff --git a/modules/ext.CollaborationKit.icon.js 
b/modules/ext.CollaborationKit.icon.js
index bf0d283..db1ed04 100644
--- a/modules/ext.CollaborationKit.icon.js
+++ b/modules/ext.CollaborationKit.icon.js
@@ -100,8 +100,7 @@
iconBrowserButton.setLabel( mw.msg( 
'collaborationkit-icon-launchbutton' ) );
iconBrowserButton.on( 'click', openItUp );
 
-   $( 'div.mw-ck-icon-input' ).addClass( 'icon-browser-field' );
-   $( 'div.mw-ck-icon-input div' ).css( 'display', 'none' );
+   $( 'div.mw-ck-icon-input .oo-ui-comboBoxInputWidget' ).css( 'display', 
'none' );
$( 'div.mw-ck-icon-input' )
.append( '' )
.append( iconBrowserButton.$element );

-- 
To view, visit https://gerrit.wikimedia.org/r/333481
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddf8a18a431d7b5d28445a66e1ea154c891c0375
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing bug that would cause formatting problems when first c...

2017-01-21 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333480 )

Change subject: Fixing bug that would cause formatting problems when first 
column is empty
..

Fixing bug that would cause formatting problems when first column is empty

Bug: T155660
Change-Id: Id4ff3cf232e2a6361662cb55ba34c828b7015ab7
---
M includes/content/CollaborationListContent.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/80/333480/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 5f6e7fc..12253d6 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -287,7 +287,7 @@
$text .= "\n";
 
if ( count( $column->items ) === 0 ) {
-   $text .= 
"\n{{mediawiki:collaborationkit-list-emptycolumn}}\n";
+   $text .= 
"\n{{mediawiki:collaborationkit-list-emptycolumn}}\n";
continue;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/333480
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4ff3cf232e2a6361662cb55ba34c828b7015ab7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Accounting for member lists with zero items

2017-01-21 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333478 )

Change subject: Accounting for member lists with zero items
..

Accounting for member lists with zero items

Bug: T155871
Change-Id: Ia7ab5739aef18ec830eae192325b884a03b5d5b4
---
M includes/content/CollaborationListContent.php
1 file changed, 22 insertions(+), 18 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/78/333478/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index bb9103b..5f6e7fc 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -960,26 +960,30 @@
 * @return Array [ 'active' => [..], 'inactive' => '[..]' ]
 */
private function filterActiveUsers( $userList ) {
-   $users = array_keys( $userList );
-   $dbr = wfGetDB( DB_REPLICA );
-   $res = $dbr->select(
-   'querycachetwo',
-   'qcc_title',
-   [
-   'qcc_namespace' => NS_USER,
-   // TODO: Perhaps should use batching.
-   'qcc_title' => $users,
-   'qcc_type' => 'activeusers'
-   ],
-   __METHOD__
-   );
+   if ( count( $userList ) > 0 ) {
+   $users = array_keys( $userList );
+   $dbr = wfGetDB( DB_REPLICA );
+   $res = $dbr->select(
+   'querycachetwo',
+   'qcc_title',
+   [
+   'qcc_namespace' => NS_USER,
+   // TODO: Perhaps should use batching.
+   'qcc_title' => $users,
+   'qcc_type' => 'activeusers'
+   ],
+   __METHOD__
+   );
 
-   $active = [];
-   foreach ( $res as $row ) {
-   $active[$row->qcc_title] = $userList[$row->qcc_title];
-   unset( $userList[$row->qcc_title] );
+   $active = [];
+   foreach ( $res as $row ) {
+   $active[$row->qcc_title] = 
$userList[$row->qcc_title];
+   unset( $userList[$row->qcc_title] );
+   }
+   return [ 'active' => $active, 'inactive' => $userList ];
+   } else {
+   return [ 'active' => [], 'inactive' => [] ];
}
-   return [ 'active' => $active, 'inactive' => $userList ];
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/333478
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7ab5739aef18ec830eae192325b884a03b5d5b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: One-click project join from within the hub.

2017-01-21 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333434 )

Change subject: One-click project join from within the hub.
..

One-click project join from within the hub.

Clicking the blue "Join" button on a hub will now have you join as a member 
just in one click. You are then taken to the member list.

Once you join as a member, the blue "Join" member disappears.

Going to the member page's action=edit remains as a no-JS fallback

Change-Id: Iebbf8d2c1c06912f73a1f52f74c34fb42e78d9c3
---
M includes/content/CollaborationHubContent.php
M modules/ext.CollaborationKit.colour.js
M modules/ext.CollaborationKit.list.edit.js
3 files changed, 72 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/34/333434/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 2ea7cd1..edf956c 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -233,7 +233,7 @@
$html .= Html::rawElement(
'div',
[ 'class' => 'mw-ck-hub-members' ],
-   $this->getMembersBlock( $title, $options )
+   $this->getMembersBlock( $title, $options, 
$output )
);
// get parsed intro
$html .= Html::rawElement(
@@ -290,6 +290,9 @@
'ext.CollaborationKit.blots',
'ext.CollaborationKit.list.styles'
] );
+   $output->addModules( [
+   'ext.CollaborationKit.list.edit'
+   ] );
$output->setEnableOOUI( true );
}
}
@@ -320,7 +323,7 @@
 * @param $options ParserOptions
 * @return string
 */
-   protected function getMembersBlock( Title $title, ParserOptions 
$options ) {
+   protected function getMembersBlock( Title $title, ParserOptions 
$options, ParserOutput &$output ) {
global $wgParser;
 
$html = '';
@@ -333,6 +336,10 @@
$membersPageName = $title->getFullText() . '/' . wfMessage( 
'collaborationkit-hub-pagetitle-members' )->inContentLanguage()->text();
$membersTitle = Title::newFromText( $membersPageName );
if ( $membersTitle->exists() ) {
+
+   $membersPageID = $membersTitle->getArticleID();
+   $output->addJsConfigVars( 
'wgCollaborationKitAssociatedMemberList', $membersPageID );
+
// rawElement is used because we don't want [edit] 
links or usual header behavior
$html .= Html::rawElement(
'h3',
@@ -362,7 +369,8 @@
$membersJoinButton = new OOUI\ButtonWidget( [
'label' => wfMessage( 
'collaborationkit-hub-members-signup' )->inContentLanguage()->text(),
'href' => $membersTitle->getEditURL(), // Going 
through editor is non-JS fallback
-   'flags' => [ 'primary', 'progressive' ]
+   'flags' => [ 'primary', 'progressive' ],
+   'classes' => [ 'mw-ck-members-join' ]
] );
 
OutputPage::setupOOUI();
diff --git a/modules/ext.CollaborationKit.colour.js 
b/modules/ext.CollaborationKit.colour.js
index 6d777d0..64e8a18 100644
--- a/modules/ext.CollaborationKit.colour.js
+++ b/modules/ext.CollaborationKit.colour.js
@@ -86,7 +86,7 @@
);
 
// Set form value
-   $( 'div.mw-ck-colour-input select 
option[value=' + toAppend + ']' )
+   $( 'div.mw-ck-colour input select 
option[value=' + toAppend + ']' )
.attr( 'selected', 'selected' );
 
dialog.close( { action: action } );
diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 03da66b..cba46c0 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -32,10 +32,11 @@
/**
 * Find if the current user is already is in list.
 *
+* @param {int} destinationPage The Page ID of the list if not the 
current page.
 * @return {boolean}
 */
-   curUserIsInList = function curUserIsInList() {
-   var titleObj, escapedText, currentUser;
+   curUserIsInList = function ( destinationPage ) {
+   var titleObj, escapedText, currentUser, wrapper;

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Fixing JS color selector.

2017-01-20 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/26 )

Change subject: Fixing JS color selector.
..

Fixing JS color selector.

I just want to state for the record that I resolved this bug by adding a single 
hyphen.

Bug: T155664
Change-Id: Iea685eba8c83048ef876ac5141693accbd607e07
---
M modules/ext.CollaborationKit.colour.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/26/26/1

diff --git a/modules/ext.CollaborationKit.colour.js 
b/modules/ext.CollaborationKit.colour.js
index ca738f0..6d777d0 100644
--- a/modules/ext.CollaborationKit.colour.js
+++ b/modules/ext.CollaborationKit.colour.js
@@ -86,7 +86,7 @@
);
 
// Set form value
-   $( 'div.mw-ck-colourinput select option[value=' 
+ toAppend + ']' )
+   $( 'div.mw-ck-colour-input select 
option[value=' + toAppend + ']' )
.attr( 'selected', 'selected' );
 
dialog.close( { action: action } );

-- 
To view, visit https://gerrit.wikimedia.org/r/26
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea685eba8c83048ef876ac5141693accbd607e07
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Changing color names internally to match interface names.

2017-01-20 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/07 )

Change subject: Changing color names internally to match interface names.
..

Changing color names internally to match interface names.

Bug: T155609
Change-Id: Ia09673e4ce0c22a83e5df9cbe482821072d4a4de
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/CollaborationHubContentEditor.php
M includes/SpecialCreateCollaborationHub.php
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubContentSchema.php
M includes/content/CollaborationKitIcon.php
M includes/content/CollaborationListContent.php
M modules/ext.CollaborationKit.colourbrowser.styles.less
M modules/ext.CollaborationKit.edit.styles.less
M modules/ext.CollaborationKit.hub.styles.less
M modules/ext.CollaborationKit.hub.subpage.styles.less
M modules/ext.CollaborationKit.list.styles.less
M modules/ext.CollaborationKit.mixins.less
15 files changed, 405 insertions(+), 405 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/07/07/1

diff --git a/extension.json b/extension.json
index 427f70d..a7bafb7 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "CollaborationKit",
-   "version": "0.2",
+   "version": "0.3",
"author": [ "Kim Schoonover", "Brian Wolff", "James Hare" ],
"url": "https://www.mediawiki.org/wiki/Extension:CollaborationKit;,
"descriptionmsg": "collaborationkit-desc",
@@ -142,28 +142,28 @@
"collaborationkit-colour-select",
"collaborationkit-colour-launchbutton",
"cancel",
-   "collaborationkit-red1",
-   "collaborationkit-red2",
-   "collaborationkit-grey1",
-   "collaborationkit-grey2",
-   "collaborationkit-blue1",
-   "collaborationkit-blue2",
-   "collaborationkit-blue3",
-   "collaborationkit-blue4",
-   "collaborationkit-blue5",
-   "collaborationkit-blue6",
-   "collaborationkit-purple1",
-   "collaborationkit-purple2",
-   "collaborationkit-purple3",
-   "collaborationkit-purple4",
-   "collaborationkit-purple5",
-   "collaborationkit-yellow1",
-   "collaborationkit-yellow2",
-   "collaborationkit-yellow3",
-   "collaborationkit-yellow4",
-   "collaborationkit-green1",
-   "collaborationkit-green2",
-   "collaborationkit-green3",
+   "collaborationkit-darkred",
+   "collaborationkit-red",
+   "collaborationkit-darkgrey",
+   "collaborationkit-lightgrey",
+   "collaborationkit-skyblue",
+   "collaborationkit-blue",
+   "collaborationkit-bluegrey",
+   "collaborationkit-navyblue",
+   "collaborationkit-darkblue",
+   "collaborationkit-aquamarine",
+   "collaborationkit-violet",
+   "collaborationkit-purple",
+   "collaborationkit-mauve",
+   "collaborationkit-lightmauve",
+   "collaborationkit-salmon",
+   "collaborationkit-orange",
+   "collaborationkit-yellow",
+   "collaborationkit-gold",
+   "collaborationkit-pastelyellow",
+   "collaborationkit-forestgreen",
+   "collaborationkit-brightgreen",
+   "collaborationkit-khaki",
"collaborationkit-black"
],
"styles": 
"ext.CollaborationKit.colourbrowser.styles.less"
@@ -212,28 +212,28 @@
"selectorWithVariant": 
".mw-ck-theme-{variant}.mw-ck-list-{name} ul",
"class": "ResourceLoaderListStyleModule",
"variants": {
-   "red1": { "color": "#700", "global": true },
-   "red2": { "color": "#b11", "global": true },
-   "grey1": { "color": 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Changing where the __NOEDITSECTION__ thing is

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332720 )

Change subject: Changing where the __NOEDITSECTION__ thing is
..

Changing where the __NOEDITSECTION__ thing is

Change-Id: I371f58900baa7d7a2b6ebe67337fbf42e9abb590
---
M includes/content/CollaborationListContent.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/20/332720/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 543b609..44dd70e 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -195,7 +195,7 @@
$listOptions = $this->getFullRenderListOptions()
+ (array)$this->options
+ $this->getDefaultOptions();
-   $text = "__NOEDITSECTION__" . $this->convertToWikitext( $lang, 
$listOptions );
+   $text = $this->convertToWikitext( $lang, $listOptions );
$output = $wgParser->parse( $text, $title, $options, true, 
true, $revId );
if ( $this->displaymode == 'members' ) {
$isMemberList = true;
@@ -250,8 +250,8 @@
// Hack to force style loading even when we don't have a Parser 
reference.
$text = "\n";
 
-   // Ugly way to prevent unexpected column header TOCs from 
showing up
-   $text .= "__NOTOC__";
+   // Ugly way to prevent unexpected column header TOCs and 
edit-section buttons from showing up
+   $text .= "__NOTOC__ __NOEDITSECTION__";
 
if ( $includeDesc ) {
$text .= $this->getDescription() . "\n";

-- 
To view, visit https://gerrit.wikimedia.org/r/332720
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I371f58900baa7d7a2b6ebe67337fbf42e9abb590
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Changing header and descriptive text for Special:CreateColla...

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332717 )

Change subject: Changing header and descriptive text for 
Special:CreateCollaborationHub
..

Changing header and descriptive text for Special:CreateCollaborationHub

Bug: T155596
Change-Id: I4d79c85c53dc1fa84107dd1e83c7efb6b7e0c66c
---
M i18n/en.json
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/17/332717/1

diff --git a/i18n/en.json b/i18n/en.json
index 8808f8e..522c987 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -3,7 +3,7 @@
"authors": [ "Isarra", "Harej", "bawolff" ]
},
"collaborationkit-desc": "Next-generation WikiProjects and 
collaborative workspaces for wikis",
-   "createcollaborationhub": "Create new Collaboration Hub project",
+   "createcollaborationhub": "Create new Collaboration Hub",
"createhubfeature": "Create a new Collaboration Hub feature",
"collaborationkit-createhub-title": "Page title",
"collaborationkit-createhub-invalidtitle": "The specified title is 
invalid.",
@@ -112,7 +112,7 @@
"collaborationkit-column-active": "Active members",
"collaborationkit-column-inactive": "Inactive members",
"collaborationkit-createhub-wrongnamespace": "This page name cannot be 
used as a Collaboration Hub. Collaboration Hubs can only be created in the 
{{PLURAL:$1|$2 namespace|following namespaces: $2}}.",
-   "createcollaborationhub-text": "You are creating a new Collaboration 
Hub. Once the page is created, you will be able to add features, as well as 
edit any of this later.",
+   "createcollaborationhub-text": "You are creating a new Collaboration 
Hub, a workspace for organizing a project. Once this page is created, you will 
be able to add features and make other edits.",
"collaborationkit-createhub-title-help": "Where to create the Hub",
"collaborationkit-createhub-title-placeholder": "Project:...",
"collaborationkit-hubedit-displayname-help": "Used to refer to the 
project on other pages. Only needed if different from the page title.",

-- 
To view, visit https://gerrit.wikimedia.org/r/332717
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d79c85c53dc1fa84107dd1e83c7efb6b7e0c66c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Forces column number in member lists to be 0 for JS editor p...

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332706 )

Change subject: Forces column number in member lists to be 0 for JS editor 
purposes
..

Forces column number in member lists to be 0 for JS editor purposes

Member lists are rendered as two-column but are actually one column in the 
underlying JSON. This causes cognitive dissonance. Resolving by pretending 
there is only one column.

Bug: T155485
Change-Id: I25c7ac9e61bbf2e3451e6d9d1d20ef6b6d384803
---
M modules/ext.CollaborationKit.list.edit.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/06/332706/1

diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 613e90c..2fda755 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -54,6 +54,11 @@
modifyExistingItem = function ( itemName, colId ) {
getCurrentJson( mw.config.get( 'wgArticleId' ), function ( res 
) {
var done = false;
+   // Member lists pretend to have two columns (active and 
inactive),
+   // but in the source code, it's only one column. This 
forces that.
+   if ( mw.config.get( 'wgCollaborationKitIsMemberList' ) 
) {
+   colId = 0;
+   }
$.each( res.content.columns[ colId ].items, function ( 
index ) {
if ( this.title === itemName ) {
done = true;

-- 
To view, visit https://gerrit.wikimedia.org/r/332706
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I25c7ac9e61bbf2e3451e6d9d1d20ef6b6d384803
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Hide anchor icons on member lists.

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332681 )

Change subject: Hide anchor icons on member lists.
..

Hide anchor icons on member lists.

Bug: T155484
Change-Id: I14a7faa5e035e86d52b91b1cb554f9555c6b4f7a
---
M modules/ext.CollaborationKit.list.edit.js
1 file changed, 64 insertions(+), 59 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/81/332681/1

diff --git a/modules/ext.CollaborationKit.list.edit.js 
b/modules/ext.CollaborationKit.list.edit.js
index 613e90c..39191eb 100644
--- a/modules/ext.CollaborationKit.list.edit.js
+++ b/modules/ext.CollaborationKit.list.edit.js
@@ -533,6 +533,7 @@
} );
 
// Icon instead of button to avoid conflict with 
jquery.ui
+
moveButton = new OO.ui.IconWidget( {
framed: false,
icon: 'move',
@@ -561,70 +562,74 @@
}
} );
 
-   $moveWrapper = $( '' )
-   .addClass( 'mw-ck-list-movebutton' )
-   .addClass( 'mw-ck-list-button' )
-   .append( moveButton.$element );
-
-   $editWrapper = $( '' )
-   .addClass( 'mw-ck-list-editbutton' )
-   .addClass( 'mw-ck-list-button' )
-   .append( editButton.$element );
-
-   $item.find( '.mw-ck-list-title' )
-   .append( $delWrapper )
-   .append( $moveWrapper )
-   .append( $editWrapper );
-   } );
-
-   $list.sortable( {
-   placeholder: 'mw-ck-list-dragplaceholder',
-   axis: 'y',
-   forcePlaceholderSize: true,
-   handle: '.mw-ck-list-movebutton',
-   opacity: 0.6,
-   scroll: true,
-   items: '.mw-ck-list-item',
-   cursor: 'grabbing', // Also overriden in CSS
-   start: function ( e ) {
-   $( e.target )
-   .addClass( 'mw-ck-dragging' )
-   .data( 'startTitleList', 
getListOfTitles( $list ) );
-   },
-   stop: function ( e, ui ) {
-   var oldListTitles, newListTitles, $target, i, 
j, changed, count;
-
-   $target = $( e.target );
-   $target.removeClass( 'mw-ck-dragging' );
-   oldListTitles = $target.data( 'startTitleList' 
);
-   newListTitles = getListOfTitles( $list );
-   $target.data( 'startTitleList', null );
-   // FIXME better error handling
-   if ( oldListTitles.length !== 
newListTitles.length ) {
-   throw new Error( 'We somehow lost a 
column?!' );
+   if ( !mw.config.get( 'wgCollaborationKitIsMemberList' ) 
) {
+   $moveWrapper = $( '' )
+   .addClass( 'mw-ck-list-movebutton' )
+   .addClass( 'mw-ck-list-button' )
+   .append( moveButton.$element );
}
 
-   changed = false;
-   count = 0;
-   for ( i = 0; i < oldListTitles.length; i++ ) {
-   count += oldListTitles.length;
-   count -= newListTitles.length;
-   for ( j = 0; j < oldListTitles[ i 
].length; j++ ) {
-   if ( oldListTitles[ i ][ j ] 
!== newListTitles[ i ][ j ] ) {
-   changed = true;
-   break;
+   $editWrapper = $( '' )
+   .addClass( 'mw-ck-list-editbutton' )
+   .addClass( 'mw-ck-list-button' )
+   .append( editButton.$element );
+
+   $item.find( '.mw-ck-list-title' )
+   .append( $delWrapper )
+   .append( $moveWrapper )
+   .append( $editWrapper );
+   } );
+
+   

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Disable edit section links on CollaborationLists

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332440 )

Change subject: Disable edit section links on CollaborationLists
..

Disable edit section links on CollaborationLists

Until such a time as we implement proper behavior for editing sections (i.e. 
individual columns), we should not enable this link that just leads to an error 
anyway.

Change-Id: I967d998f7ac41becb01d80288803e6b13fdc8fe7
---
M includes/content/CollaborationListContent.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/40/332440/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 5715615..6e084e2 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -195,7 +195,7 @@
$listOptions = $this->getFullRenderListOptions()
+ (array)$this->options
+ $this->getDefaultOptions();
-   $text = $this->convertToWikitext( $lang, $listOptions );
+   $text = "__NOEDITSECTION__" . $this->convertToWikitext( $lang, 
$listOptions );
$output = $wgParser->parse( $text, $title, $options, true, 
true, $revId );
if ( $this->displaymode == 'members' ) {
$isMemberList = true;

-- 
To view, visit https://gerrit.wikimedia.org/r/332440
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I967d998f7ac41becb01d80288803e6b13fdc8fe7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Enforce requirement that columns and list items in Collabora...

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332438 )

Change subject: Enforce requirement that columns and list items in 
CollaborationLists be objects.
..

Enforce requirement that columns and list items in CollaborationLists be 
objects.

Bug: T154701
Change-Id: I49e87cdaaa951119ae0b2558bf4d5649ae2e6990
---
M includes/content/CollaborationListContent.php
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/38/332438/1

diff --git a/includes/content/CollaborationListContent.php 
b/includes/content/CollaborationListContent.php
index 6ea7367..412ccd0 100644
--- a/includes/content/CollaborationListContent.php
+++ b/includes/content/CollaborationListContent.php
@@ -54,9 +54,24 @@
if ( !isset( $data->description ) || !isset( $data->columns ) 
|| !isset( $data->options ) || !isset( $data->displaymode ) ) {
return false;
}
+
$jsonAsArray = json_decode( json_encode( $data ), true );
+
try {
EventLogging::schemaValidate( $jsonAsArray, $listSchema 
);
+   // FIXME: The schema should be enforcing data type 
requirements, but it isn't.
+   // Again, this is probably EventLogging.
+   for ( $i = 0 ; $i < count( $jsonAsArray[ "columns" ] ) 
; $i++ ) {
+   if ( !is_array( $jsonAsArray[ "columns" ][ $i ] 
) ) {
+   return false;
+   } else {
+   for ( $j = 0 ; $j < count( 
$jsonAsArray[ "columns" ][ $i ][ "items" ] ) ; $j++ ) {
+   if ( !is_array( $jsonAsArray[ 
"columns" ][ $i ][ "items" ][ $j ] ) ) {
+   return false;
+   }
+   }
+   }
+   }
return true;
} catch ( JsonSchemaException $e ) {
return false;

-- 
To view, visit https://gerrit.wikimedia.org/r/332438
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49e87cdaaa951119ae0b2558bf4d5649ae2e6990
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: And now the second half.

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332437 )

Change subject: And now the second half.
..

And now the second half.

Bug: T155454
Change-Id: Ia57bf4c19d45a2554728e56e10eedd00d1a5148a
---
M modules/ext.CollaborationKit.hubimage.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/37/332437/1

diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index e198c8f..5c8a544 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -88,7 +88,7 @@
 
// Load current hub image
if ( $( 'div.mw-ck-hubimageinput input' ).val() !== undefined ) {
-   currentImageFilename = 'File:' + $( 'input#wpCollabHubImage' 
).val();
+   currentImageFilename = 'File:' + $( 'div.mw-ck-hubimageinput 
input' ).val();
currentImage = new mw.Api()
.get( {
action: 'query',

-- 
To view, visit https://gerrit.wikimedia.org/r/332437
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia57bf4c19d45a2554728e56e10eedd00d1a5148a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Updating name of selector for hub image pre-population in ed...

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332435 )

Change subject: Updating name of selector for hub image pre-population in edit 
mode
..

Updating name of selector for hub image pre-population in edit mode

Bug: T155454
Change-Id: Ia9572759bcf69a29a2c90ce1d5ddf3830480bb96
---
M modules/ext.CollaborationKit.hubimage.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/35/332435/1

diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index a5264fa..e198c8f 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -87,7 +87,7 @@
$( 'div.mw-ck-hubimageinput input' ).css( 'display', 'none' );
 
// Load current hub image
-   if ( $( 'input#wpCollabHubImage' ).val() !== undefined ) {
+   if ( $( 'div.mw-ck-hubimageinput input' ).val() !== undefined ) {
currentImageFilename = 'File:' + $( 'input#wpCollabHubImage' 
).val();
currentImage = new mw.Api()
.get( {

-- 
To view, visit https://gerrit.wikimedia.org/r/332435
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9572759bcf69a29a2c90ce1d5ddf3830480bb96
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Making it so that the browse images button only shows up once.

2017-01-17 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332433 )

Change subject: Making it so that the browse images button only shows up once.
..

Making it so that the browse images button only shows up once.

Bug: T155454
Change-Id: I0dbeb6da58423234aa3939c597816bf59d6887d9
---
M modules/ext.CollaborationKit.hubimage.js
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/33/332433/1

diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index 76d1b4f..a5264fa 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -44,7 +44,7 @@
.css( 'margin-bottom', 
'10px' );
 
// Set form value
-   $( '.mw-ck-hubimageinput input, 
div#wpCollabHubImage input' ).val( fileTitle );
+   $( '.mw-ck-hubimageinput input' 
).val( fileTitle );
 
dialog.close( { action: action 
} );
} );
@@ -79,12 +79,12 @@
hubimageBrowserButton.setLabel( mw.msg( 
'collaborationkit-hubimage-launchbutton' ) );
hubimageBrowserButton.on( 'click', openItUp );
 
-   $( 'div.mw-ck-hubimageinput, div#wpCollabHubImage' ).addClass( 
'hubimage-browser-field' );
-   $( 'div.mw-ck-hubimageinput label, div#wpCollabHubImage' )
+   $( 'div.mw-ck-hubimageinput' ).addClass( 'hubimage-browser-field' );
+   $( 'div.mw-ck-hubimageinput label' )
.append( '' )
.append( hubimageBrowserButton.$element )
.append( '' );
-   $( 'div.mw-ck-hubimageinput input, div#wpCollabHubImage input' ).css( 
'display', 'none' );
+   $( 'div.mw-ck-hubimageinput input' ).css( 'display', 'none' );
 
// Load current hub image
if ( $( 'input#wpCollabHubImage' ).val() !== undefined ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/332433
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0dbeb6da58423234aa3939c597816bf59d6887d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Using media browser in core instead of VisualEditor

2017-01-11 Thread Harej (Code Review)
Harej has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331803 )

Change subject: Using media browser in core instead of VisualEditor
..

Using media browser in core instead of VisualEditor

Bug: T154951
Change-Id: I0cd376d0f444b94e51dc6a57bd2cd6a6ce74d02d
---
M extension.json
M modules/ext.CollaborationKit.hubimage.js
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/03/331803/1

diff --git a/extension.json b/extension.json
index 0d2401d..4b8d88d 100644
--- a/extension.json
+++ b/extension.json
@@ -124,7 +124,7 @@
"oojs-ui.styles.icons-movement",
"mediawiki.widgets",
"mediawiki.widgets.UserInputWidget",
-   "ext.visualEditor.mwimage",
+   "mediawiki.widgets.MediaSearch",
"mediawiki.api"
],
"messages": [
diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index a0b627d..ba61989 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -18,7 +18,7 @@
ProcessDialog.prototype.initialize = function () {
ProcessDialog.super.prototype.initialize.apply( this, 
arguments );
 
-   this.content = new ve.ui.MWMediaSearchWidget();
+   this.content = new mw.widgets.MediaSearchWidget();
this.$body.append( this.content.$element );
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/331803
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0cd376d0f444b94e51dc6a57bd2cd6a6ce74d02d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Failsafe for if thumbnail fails to load for some reason.

2016-11-26 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Failsafe for if thumbnail fails to load for some reason.
..

Failsafe for if thumbnail fails to load for some reason.

This is a result of an issue we are having on our Labs staging wiki.

Change-Id: Ia3413505a107a14f95c3552725e4d6928022a8dd
---
M modules/ext.CollaborationKit.hubimage.js
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/74/323674/1

diff --git a/modules/ext.CollaborationKit.hubimage.js 
b/modules/ext.CollaborationKit.hubimage.js
index 19249f2..a0b627d 100644
--- a/modules/ext.CollaborationKit.hubimage.js
+++ b/modules/ext.CollaborationKit.hubimage.js
@@ -99,6 +99,8 @@
$( 'img.hubimagePreview' )
.attr( 'src', data.query.pages[ 
-1 ].imageinfo[ 0 ].thumburl )
.css( 'margin-bottom', '10px' )
+   .css( 'width', '200px' )
+   .css( 'height', 'auto' )
.css( 'display', 'block' );
}
);

-- 
To view, visit https://gerrit.wikimedia.org/r/323674
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3413505a107a14f95c3552725e4d6928022a8dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Purges cache upon adding a new feature to a hub.

2016-11-20 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Purges cache upon adding a new feature to a hub.
..

Purges cache upon adding a new feature to a hub.

This is so that there's no "feature does not exist" text when the hub is loaded 
for the first time after the new feature is created.

For hub *creation*, it just creates the subpages first to short-circuit this 
problem altogether.

Bug: T149022
Change-Id: I12bd045104cd61e1cad4b9725d58736a80fdd3f1
---
M includes/SpecialCreateCollaborationHub.php
M includes/SpecialCreateHubFeature.php
2 files changed, 20 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/07/322607/1

diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index d0153b0..8588078 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -160,22 +160,6 @@
return Status::newFatal( 
'collaborationkit-createhub-invalidtitle' );
}
 
-   $result = CollaborationHubContentHandler::edit(
-   $title,
-   $data['display_name'],
-   $data['icon'],
-   $data['colour'],
-   $data['introduction'],
-   '',
-   [],
-   $this->msg( 'collaborationkit-createhub-editsummary' 
)->inContentLanguage()->plain(),
-   $this->getContext()
-   );
-
-   if ( !$result->isGood() ) {
-   return $result;
-   }
-
$memberListTitle = Title::newFromText( $data['title'] . '/' . 
$this->msg( 'collaborationkit-hub-pagetitle-members' ) );
if ( !$memberListTitle ) {
return Status::newFatal( 
'collaborationkit-createhub-invalidtitle' );
@@ -217,6 +201,22 @@
$e->getCodeString() ) );
}
 
+   $result = CollaborationHubContentHandler::edit(
+   $title,
+   $data['display_name'],
+   $data['icon'],
+   $data['colour'],
+   $data['introduction'],
+   '',
+   [],
+   $this->msg( 'collaborationkit-createhub-editsummary' 
)->inContentLanguage()->plain(),
+   $this->getContext()
+   );
+
+   if ( !$result->isGood() ) {
+   return $result;
+   }
+
// Once all the pages we want to create are created, we send 
them to the first one
$this->getOutput()->redirect( $title->getFullUrl() );
return Status::newGood();
diff --git a/includes/SpecialCreateHubFeature.php 
b/includes/SpecialCreateHubFeature.php
index 070649b..9f15d56 100644
--- a/includes/SpecialCreateHubFeature.php
+++ b/includes/SpecialCreateHubFeature.php
@@ -189,7 +189,7 @@
$initialContent = ''; // Create empty page by default; 
exception is if there needs to be something such as JSON.
if ( $contentModel == 'CollaborationListContent' ) {
// FIXME why are we redefining this here? Can't we 
reuse something from collaborationlistcontenthandler, which already has default 
content?
-   $initialContent = '{ "columns": [ { "items":[], 
"options":{}, "description":"" } ] }';
+   $initialContent = '{ "displaymode": "normal", 
"columns": [ { "items":[] } ], "options":{}, "description":"" }';
}
 
$summary = $this->msg( 
'collaborationkit-createhubfeature-editsummary' )->plain();
@@ -218,6 +218,9 @@
$e->getCodeString() ) );
}
 
+   // Purge the hub's cache so that it doesn't say "feature does 
not exist"
+   $hubTitleObject->invalidateCache();
+
// Once all the pages we want to create are created, we send 
them to the first one
$this->getOutput()->redirect( $title->getFullUrl() );
return Status::newGood();

-- 
To view, visit https://gerrit.wikimedia.org/r/322607
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12bd045104cd61e1cad4b9725d58736a80fdd3f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding hub image selector and embedding icon and color selec...

2016-11-17 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Adding hub image selector and embedding icon and color 
selectors in proper places.
..

Adding hub image selector and embedding icon and color selectors in proper 
places.

Adds VisualEditor as a dependency.

Change-Id: I1c2a2f028f647390ec8cd98741c9b2dcf5bf7e31
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/CollaborationHubContentEditor.php
M includes/SpecialCreateCollaborationHub.php
M modules/ext.CollaborationKit.colour.js
A modules/ext.CollaborationKit.hubimage.js
M modules/ext.CollaborationKit.icon.js
8 files changed, 155 insertions(+), 16 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/29/39/1

diff --git a/extension.json b/extension.json
index c120287..ea49f1f 100644
--- a/extension.json
+++ b/extension.json
@@ -111,6 +111,23 @@
"cancel"
]
},
+   "ext.CollaborationKit.hubimage": {
+   "scripts": "ext.CollaborationKit.hubimage.js",
+   "dependencies": [
+   "oojs-ui",
+   "oojs-ui.styles.icons-movement",
+   "mediawiki.widgets",
+   "mediawiki.widgets.UserInputWidget",
+   "ext.visualEditor.mwimage",
+   "mediawiki.api"
+   ],
+   "messages": [
+   "collaborationkit-hubimage-browser",
+   "collaborationkit-hubimage-select",
+   "collaborationkit-hubimage-launchbutton",
+   "cancel"
+   ]
+   },
"ext.CollaborationKit.colour": {
"scripts": "ext.CollaborationKit.colour.js",
"dependencies": [
diff --git a/i18n/en.json b/i18n/en.json
index 62f7fb9..c072ca0 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -92,6 +92,9 @@
"collaborationkit-colour-launchbutton": "Browse colors",
"collaborationkit-colour-browser": "Color browser",
"collaborationkit-colour-select": "Select",
+   "collaborationkit-hubimage-launchbutton": "Browse images",
+   "collaborationkit-hubimage-browser": "Media browser",
+   "collaborationkit-hubimage-select": "Select",
"collaborationkit-subpage-toc-label": "Part of a project:",
"collaborationkit-red1": "Dark red",
"collaborationkit-red2": "Red",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 51ea868..4a9d86c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -92,6 +92,9 @@
"collaborationkit-colour-launchbutton": "Button label for button that 
launches the hub colour browser",
"collaborationkit-colour-browser": "Header label for the hub colour 
browser",
"collaborationkit-colour-select": "Button for selecting a colour in the 
hub colour browser",
+   "collaborationkit-hubimage-launchbutton": "Button label for button that 
launches the hub image browser",
+   "collaborationkit-hubimage-browser": "Header label for the hub image 
browser",
+   "collaborationkit-hubimage-select": "Button for selecting an image in 
the hub image browser",
"collaborationkit-subpage-toc-label": "Label for the toc on a 
Collaboration Hub subpage",
"collaborationkit-red1": "Color label",
"collaborationkit-red2": "Color label",
diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index 8094556..66c7df9 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -9,6 +9,13 @@
// Make human readable the default format for editing, but still
// save as json. Can be overriden by url 
?format=application/json param.
$this->contentFormat = 
CollaborationHubContentHandler::FORMAT_WIKI;
+
+   // Nice JavaScript buttons
+   $out = $this->getContext()->getOutput();
+   $out->addModules( 'ext.CollaborationKit.colour' );
+   $out->addModules( 'ext.CollaborationKit.hubimage' );
+   $out->addModuleStyles( 
'ext.CollaborationKit.colourbrowser.styles' );
+   $out->addJsConfigVars( 'wgCollaborationKitColourList', 
CollaborationHubContent::getThemeColours() );
}
 
/**
diff --git a/includes/SpecialCreateCollaborationHub.php 
b/includes/SpecialCreateCollaborationHub.php
index 0551cdd..d0153b0 100644
--- a/includes/SpecialCreateCollaborationHub.php
+++ b/includes/SpecialCreateCollaborationHub.php
@@ -19,8 +19,10 @@
public function execute( $par ) {
$out = 

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Commenting out "remove" link in CollaborationHubContent pend...

2016-11-16 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Commenting out "remove" link in CollaborationHubContent pending 
proper implementation.
..

Commenting out "remove" link in CollaborationHubContent pending proper 
implementation.

Change-Id: I2d700d1a423892a9643cbc909767e8d610cf7979
---
M includes/content/CollaborationHubContent.php
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/73/321973/1

diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index a8408a0..15b1f00 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -612,14 +612,16 @@
}
 
}
-   if ( $title->userCan( 'edit' ) ) {
-   $sectionLinks['removeLink'] = $linkRenderer->makeLink(
-   $title,
-   wfMessage( 
'collaborationkit-hub-subpage-remove' )->inContentLanguage()->text(),
-   [],
-   [ 'action' => 'edit' ]
-   );
-   }
+   // Commenting out pending proper implementation.
+   //
+   // if ( $title->userCan( 'edit' ) ) {
+   //  $sectionLinks['removeLink'] = $linkRenderer->makeLink(
+   //  $title,
+   //  wfMessage( 
'collaborationkit-hub-subpage-remove' )->inContentLanguage()->text(),
+   //  [],
+   //  [ 'action' => 'edit' ]
+   //  );
+   //}
foreach ( $sectionLinks as $sectionLink ) {
$sectionLinksText .= $this->makeEditSectionLink( 
$sectionLink );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/321973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d700d1a423892a9643cbc909767e8d610cf7979
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Merge "Clean up css classes as .mw-ck-whatever-stuff"

2016-10-28 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Merge "Clean up css classes as .mw-ck-whatever-stuff"
..

Merge "Clean up css classes as .mw-ck-whatever-stuff"

Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
---
M CollaborationKit.hooks.php
M includes/content/CollaborationHubContent.php
2 files changed, 14 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/91/318491/1

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index d89ce7b..a1e16e1 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -97,6 +97,7 @@
 
if ( $parentHub
&& $out->getProperty( 'CollaborationHubSubpage' ) === 
'in-progress'
+   && count( Revision::newFromTitle( $parentHub 
)->getContent()->getContent() ) > 0
) {
$toc = new CollaborationHubTOC();
$out->prependHtml( $toc->renderSubpageToC( $parentHub ) 
);
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index d093be8..a8408a0 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -248,17 +248,25 @@
$this->getParsedAnnouncements( $title, $options 
)
);
// get table of contents
-   $html .= Html::rawElement(
-   'div',
-   [ 'class' => 'mw-ck-hub-toc' ],
-   $this->getTableOfContents( $title, $options )
-   );
+   if ( count( $this->getContent() ) > 0 ) {
+   $html .= Html::rawElement(
+   'div',
+   [ 'class' => 'mw-ck-hub-toc' ],
+   $this->getTableOfContents( $title, 
$options )
+   );
+   }
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get transcluded content
$html .= Html::rawElement(
'div',
[ 'class' => 'mw-ck-hub-content' ],
$this->getParsedContent( $title, $options, 
$output )
);
+
+   $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
// get footer
$html .= Html::rawElement(
'div',

-- 
To view, visit https://gerrit.wikimedia.org/r/318491
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Using JavaScript colour/hubimage browsers in action=edit mode.

2016-10-23 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Using JavaScript colour/hubimage browsers in action=edit mode.
..

Using JavaScript colour/hubimage browsers in action=edit mode.

Change-Id: I769eb8d6412d4c0b699011b309f24ffc1ca9d293
---
M includes/CollaborationHubContentEditor.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/46/317446/1

diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
index 4bacd07..c5af60a 100644
--- a/includes/CollaborationHubContentEditor.php
+++ b/includes/CollaborationHubContentEditor.php
@@ -29,7 +29,6 @@
 * @return array
 */
protected function getFormFields( $parts ) {
-
$fields = [
// Display name can be different from page title
'display_name' => new OOUI\FieldLayout(
@@ -152,8 +151,14 @@
$out = RequestContext::getMain()->getOutput();
$pageLang = $this->getTitle()->getPageLanguage();
 
-   $formFields = $this->getFormFields( $parts );
+   // Adding modules
+   $out->addModules( 'ext.CollaborationKit.colour' );
+   $out->addModules( 'ext.CollaborationKit.hubimage' );
+   $out->addModuleStyles( 
'ext.CollaborationKit.colourbrowser.styles' );
+   $out->addJsConfigVars( 'wgCollaborationKitIconList', 
CollaborationKitIcon::getCannedIcons() );
+   $out->addJsConfigVars( 'wgCollaborationKitColourList', 
CollaborationHubContent::getThemeColours() );
 
+   $formFields = $this->getFormFields( $parts );
$htmlForm = new OOUI\FieldsetLayout( [ 'items' => $formFields ] 
);
$out->enableOOUI();
$out->addHtml( $htmlForm );

-- 
To view, visit https://gerrit.wikimedia.org/r/317446
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I769eb8d6412d4c0b699011b309f24ffc1ca9d293
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Hub image selector.

2016-10-23 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Hub image selector.
..

Hub image selector.

This introduces VisualEditor as a dependency. So it goes.

Bug: T140165
Change-Id: Ifc629ad11550253ea6a5ff72547e41e266bcba2f
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A includes/CollaborationHubContentEditor.php
M includes/SpecialCreateCollaborationHub.php
A modules/ext.CollaborationKit.hubimage.js
6 files changed, 346 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/82/317382/1

diff --git a/extension.json b/extension.json
index f8145af..6e82298 100644
--- a/extension.json
+++ b/extension.json
@@ -103,6 +103,23 @@
"cancel"
]
},
+   "ext.CollaborationKit.hubimage": {
+   "scripts": "ext.CollaborationKit.hubimage.js",
+   "dependencies": [
+   "oojs-ui",
+   "oojs-ui.styles.icons-movement",
+   "mediawiki.widgets",
+   "mediawiki.widgets.UserInputWidget",
+   "ext.visualEditor.mwimage",
+   "mediawiki.api"
+   ],
+   "messages": [
+   "collaborationkit-hubimage-browser",
+   "collaborationkit-hubimage-select",
+   "collaborationkit-hubimage-launchbutton",
+   "cancel"
+   ]
+   },
"ext.CollaborationKit.colour": {
"scripts": "ext.CollaborationKit.colour.js",
"dependencies": [
diff --git a/i18n/en.json b/i18n/en.json
index 6813fa5..086e3da 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -86,6 +86,9 @@
"collaborationkit-colour-launchbutton": "Browse colors",
"collaborationkit-colour-browser": "Color browser",
"collaborationkit-colour-select": "Select",
+   "collaborationkit-hubimage-launchbutton": "Browse images",
+   "collaborationkit-hubimage-browser": "Media browser",
+   "collaborationkit-hubimage-select": "Select",
"collaborationkit-subpage-toc-label": "Part of a project:",
"collaborationkit-red1": "Dark red",
"collaborationkit-red2": "Red",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 55802ad..0a4ebb3 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -86,6 +86,9 @@
"collaborationkit-colour-launchbutton": "Button label for button that 
launches the hub colour browser",
"collaborationkit-colour-browser": "Header label for the hub colour 
browser",
"collaborationkit-colour-select": "Button for selecting a colour in the 
hub colour browser",
+   "collaborationkit-hubimage-launchbutton": "Button label for button that 
launches the hub image browser",
+   "collaborationkit-hubimage-browser": "Header label for the hub image 
browser",
+   "collaborationkit-hubimage-select": "Button for selecting an image in 
the hub image browser",
"collaborationkit-subpage-toc-label": "Label for the toc on a 
Collaboration Hub subpage",
"collaborationkit-red1": "Color label",
"collaborationkit-red2": "Color label",
diff --git a/includes/CollaborationHubContentEditor.php 
b/includes/CollaborationHubContentEditor.php
new file mode 100644
index 000..4bacd07
--- /dev/null
+++ b/includes/CollaborationHubContentEditor.php
@@ -0,0 +1,210 @@
+contentFormat = 
CollaborationHubContentHandler::FORMAT_WIKI;
+   }
+
+   /**
+* Build and return the aossociative array for the content source field.
+* @param $mapping array
+* @return array
+*/
+   protected function getOptions( $mapping ) {
+   $options = [];
+   foreach ( $mapping as $msgKey => $option ) {
+   $options[] = [ 'label' => wfMessage( $msgKey 
)->escaped(), 'data' => $option ];
+   }
+   return $options;
+   }
+
+   /**
+* @param $parts array
+* @return array
+*/
+   protected function getFormFields( $parts ) {
+
+   $fields = [
+   // Display name can be different from page title
+   'display_name' => new OOUI\FieldLayout(
+   new OOUI\TextInputWidget( [
+   'name' => 'wpCollabHubDisplayName',
+   'id' => 'wpCollabHubDisplayName',
+   'type' => 'text',
+   'cssclass' => 'mw-ck-displayinput',
+   'value' => $parts[0]
+

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: [WIP] Creating basic editing interface for CollaborationHubC...

2016-10-20 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: [WIP] Creating basic editing interface for 
CollaborationHubContent.
..

[WIP] Creating basic editing interface for CollaborationHubContent.

Change-Id: Ia2d3a18272bf20d691e0038daabe4c6d44ef802f
---
M CollaborationKit.hooks.php
M extension.json
M i18n/en.json
M i18n/qqq.json
A includes/CollaborationHubContentEditor.php
M includes/content/CollaborationHubContent.php
M includes/content/CollaborationHubContentHandler.php
7 files changed, 447 insertions(+), 25 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/15/317115/1

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index e2d439e..fc28f01 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -13,7 +13,7 @@
$title = $sktemplate->getTitle();
$request = $sktemplate->getRequest();
if ( isset( $links['views']['edit'] ) ) {
-   if ( $title->hasContentModel( 
'CollaborationListContent' ) ) {
+   if ( $title->hasContentModel( 
'CollaborationListContent' ) || $title->hasContentModel( 
'CollaborationHubContent' ) ) {
// Edit as JSON
$active = in_array( $request->getVal( 'action' 
), [ 'edit', 'submit' ] )
&& $request->getVal( 'format' ) === 
'application/json';
@@ -29,7 +29,8 @@
// Make it not be selected when editing 
json.
$links['views']['edit']['class'] = 
false;
}
-   } elseif ( $title->hasContentModel( 
'CollaborationHubContent' ) ) {
+   }
+   if ( $title->hasContentModel( 'CollaborationHubContent' 
) ) {
// Add feature
$links['actions']['addnewfeature'] = [
'class' => '',
diff --git a/extension.json b/extension.json
index 335ff7e..ebc1cac 100644
--- a/extension.json
+++ b/extension.json
@@ -20,13 +20,14 @@
"CollaborationKitHooks": "CollaborationKit.hooks.php",
"CollaborationHubContent": 
"includes/content/CollaborationHubContent.php",
"CollaborationHubContentHandler": 
"includes/content/CollaborationHubContentHandler.php",
+   "CollaborationHubContentEditor": 
"includes/CollaborationHubContentEditor.php",
"CollaborationHubTOC": 
"includes/content/CollaborationHubTOC.php",
"CollaborationKitIcon": 
"includes/content/CollaborationKitIcon.php",
"CollaborationListContent": 
"includes/content/CollaborationListContent.php",
"CollaborationListContentHandler": 
"includes/content/CollaborationListContentHandler.php",
+   "CollaborationListContentEditor": 
"includes/CollaborationListContentEditor.php",
"SpecialCreateCollaborationHub": 
"includes/SpecialCreateCollaborationHub.php",
"SpecialCreateHubFeature": 
"includes/SpecialCreateHubFeature.php",
-   "CollaborationListContentEditor": 
"includes/CollaborationListContentEditor.php",
"ResourceLoaderListStyleModule": 
"includes/ResourceLoaderListStyleModule.php"
},
"ContentHandlers": {
@@ -63,7 +64,8 @@
"CollaborationListContent::onArticleViewHeader"
],
"CustomEditor": [
-   "CollaborationListContent::onCustomEditor"
+   "CollaborationListContent::onCustomEditor",
+   "CollaborationHubContent::onCustomEditor"
],
"OutputPageBeforeHTML": [
"CollaborationKitHooks::onOutputPageBeforeHTML"
diff --git a/i18n/en.json b/i18n/en.json
index 806b387..2e9f509 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -61,6 +61,12 @@
"collaborationkit-list-newitem-description": "Description (optional)",
"collaborationkit-listedit-description": "Description",
"collaborationkit-listedit-list": "List items",
+   "collaborationkit-hubedit-displayname": "Name to display",
+   "collaborationkit-hubedit-introduction": "Introduction",
+   "collaborationkit-hubedit-footer": "Footer",
+   "collaborationkit-hubedit-image": "Hub image",
+   "collaborationkit-hubedit-colour": "Color",
+   "collaborationkit-hubedit-content": "Features",
"collaborationkit-editjsontab": "Edit as JSON",
"collaborationkit-hub-announcements-initial": "A new collaboration hub 
has been set up!",
"collaborationkit-hub-members-description": "Our members are below. 
Those who have not edited in over a month 

[MediaWiki-commits] [Gerrit] integration/config[master]: Adding VisualEditor as a dependency for CollaborationKit.

2016-10-19 Thread Harej (Code Review)
Harej has uploaded a new change for review.

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

Change subject: Adding VisualEditor as a dependency for CollaborationKit.
..

Adding VisualEditor as a dependency for CollaborationKit.

Change-Id: I773304a1e30bf625c47fbf23970593d2444a96b3
---
M zuul/parameter_functions.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/46/316746/1

diff --git a/zuul/parameter_functions.py b/zuul/parameter_functions.py
index 2fa8630..bb9f0f5 100644
--- a/zuul/parameter_functions.py
+++ b/zuul/parameter_functions.py
@@ -95,7 +95,7 @@
 'CirrusSearch': ['MwEmbedSupport', 'TimedMediaHandler', 'PdfHandler',
  'Cite'],
 'CodeEditor': ['WikiEditor'],
-'CollaborationKit': ['EventLogging'],
+'CollaborationKit': ['EventLogging', 'VisualEditor'],
 'ContentTranslation': ['Echo', 'EventLogging', 'GuidedTour',
'UniversalLanguageSelector', 'Wikidata'],
 'Disambiguator': ['VisualEditor'],

-- 
To view, visit https://gerrit.wikimedia.org/r/316746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I773304a1e30bf625c47fbf23970593d2444a96b3
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Harej 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


  1   2   >