Mailing List Archive

Using wikieditor with Extension:PageForms.
Hi, everybody,
To meet specific needs of my wiki I modified the wikieditor toolbar by adding some buttons like this in MediaWiki:Common.js:

var customizeToolbar = function() {
// TOOLBAR
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'annotations': {
'type': 'toolbar',
'label': 'Annotations'

}
}
} );

//GROUP
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'annotations',
'groups': {
'properties': {
'label': 'Properties'
}
}
} );

//BUTTONS
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'annotations',
'group': 'properties',
'tools': {
'aka': {
label: 'Also know as',
type: 'button',
icon: 'http://example.com/w/images/aka.png',
action: {
type: 'encapsulate',
options: {
pre: "[[Is_also_known_as::",
post: "]]"
}
}
}
}
} );

and everything works great when I write/edit free text articles.

My question is why these buttons don't appear in the wikieditor toolbar of a form I created with:

|-valign="top"
|style="background:#ffdead;"|'''Tune Annotations:'''
|colspan="4"|{{{field|f_annotation|input type=textarea|rows=5|cols=180|editor=wikieditor|autogrow|placeholder=Put here Annotations/Comments/Discussion Topics/Anectodes/...}}}

And linked this way:
{{#formredlink:target=Annotation:{{PAGENAME}}|form=TuneAnnotation|link text={{PAGENAME}}}}

Any suggestions?


==WIKI INFO:==
+-------------------+---------------------------------------------------------+
MediaWiki 1.33.1 (d35fba2) 15:11, December 17, 2019
PHP 7.2.17-0ubuntu0.18.04.1 (apache2handler)
MariaDB 10.1.38-MariaDB-0ubuntu0.18.04.1
ICU 60.2
Elasticsearch 5.6.16
Lua 5.1.5
LilyPond 2.18.2
+-------------------+----------------------------------------------------------+
Page Forms 4.5 (3135f8f) 14:16, April 29, 2019
+-------------------+----------------------------------------------------------+


Thanks so much.

Valerio Pelliccioni



_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Re: Using wikieditor with Extension:PageForms. [ In reply to ]
Hi Valerio,

I assume it's because the textareas within Page Forms forms don't have the
ID 'wpTextbox1'. Could you replace '#wpTextbox1' in the JavaScript with
just 'textarea', or would that mess up textareas that are not supposed to
get WikiEditor? If 'textarea' won't work, something like
'div.wikiEditor-ui-text textarea' might work. Something along those lines,
anyway.

-Yaron

On Thu, Jan 23, 2020 at 6:09 AM Valerio Pelliccioni <vmp@silkwood.it> wrote:

> Hi, everybody,
> To meet specific needs of my wiki I modified the wikieditor toolbar by
> adding some buttons like this in MediaWiki:Common.js:
>
> var customizeToolbar = function() {
> // TOOLBAR
> $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
> 'sections': {
> 'annotations': {
> 'type': 'toolbar',
> 'label': 'Annotations'
>
> }
> }
> } );
>
> //GROUP
> $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
> 'section': 'annotations',
> 'groups': {
> 'properties': {
> 'label': 'Properties'
> }
> }
> } );
>
> //BUTTONS
> $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
> 'section': 'annotations',
> 'group': 'properties',
> 'tools': {
> 'aka': {
> label: 'Also know as',
> type: 'button',
> icon: 'http://example.com/w/images/aka.png',
> action: {
> type: 'encapsulate',
> options: {
> pre: "[[Is_also_known_as::",
> post: "]]"
> }
> }
> }
> }
> } );
>
> and everything works great when I write/edit free text articles.
>
> My question is why these buttons don't appear in the wikieditor toolbar of
> a form I created with:
>
> |-valign="top"
> |style="background:#ffdead;"|'''Tune Annotations:'''
> |colspan="4"|{{{field|f_annotation|input
> type=textarea|rows=5|cols=180|editor=wikieditor|autogrow|placeholder=Put
> here Annotations/Comments/Discussion Topics/Anectodes/...}}}
>
> And linked this way:
> {{#formredlink:target=Annotation:{{PAGENAME}}|form=TuneAnnotation|link
> text={{PAGENAME}}}}
>
> Any suggestions?
>
>
> ==WIKI INFO:==
>
> +-------------------+---------------------------------------------------------+
> MediaWiki 1.33.1 (d35fba2) 15:11, December 17, 2019
> PHP 7.2.17-0ubuntu0.18.04.1 (apache2handler)
> MariaDB 10.1.38-MariaDB-0ubuntu0.18.04.1
> ICU 60.2
> Elasticsearch 5.6.16
> Lua 5.1.5
> LilyPond 2.18.2
>
> +-------------------+----------------------------------------------------------+
> Page Forms 4.5 (3135f8f) 14:16, April 29, 2019
>
> +-------------------+----------------------------------------------------------+
>
>
> Thanks so much.
>
> Valerio Pelliccioni
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Re: Using wikieditor with Extension:PageForms. [ In reply to ]
Yaron,
both 'textarea' and 'div.wikiEditor-ui-text textarea' don't work.
Buttons in free text articles are still present but not clickable, while within PageForms Form buttons are not present at all.

Valerio


?On 23/01/2020, 15:11, "MediaWiki-l on behalf of Yaron Koren" <mediawiki-l-bounces@lists.wikimedia.org on behalf of yaron@wikiworks.com> wrote:

Hi Valerio,

I assume it's because the textareas within Page Forms forms don't have the
ID 'wpTextbox1'. Could you replace '#wpTextbox1' in the JavaScript with
just 'textarea', or would that mess up textareas that are not supposed to
get WikiEditor? If 'textarea' won't work, something like
'div.wikiEditor-ui-text textarea' might work. Something along those lines,
anyway.

-Yaron

On Thu, Jan 23, 2020 at 6:09 AM Valerio Pelliccioni <vmp@silkwood.it> wrote:

> Hi, everybody,
> To meet specific needs of my wiki I modified the wikieditor toolbar by
> adding some buttons like this in MediaWiki:Common.js:
>
> var customizeToolbar = function() {
> // TOOLBAR
> $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
> 'sections': {
> 'annotations': {
> 'type': 'toolbar',
> 'label': 'Annotations'
>
> }
> }
> } );
>
> //GROUP
> $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
> 'section': 'annotations',
> 'groups': {
> 'properties': {
> 'label': 'Properties'
> }
> }
> } );
>
> //BUTTONS
> $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
> 'section': 'annotations',
> 'group': 'properties',
> 'tools': {
> 'aka': {
> label: 'Also know as',
> type: 'button',
> icon: 'http://example.com/w/images/aka.png',
> action: {
> type: 'encapsulate',
> options: {
> pre: "[[Is_also_known_as::",
> post: "]]"
> }
> }
> }
> }
> } );
>
> and everything works great when I write/edit free text articles.
>
> My question is why these buttons don't appear in the wikieditor toolbar of
> a form I created with:
>
> |-valign="top"
> |style="background:#ffdead;"|'''Tune Annotations:'''
> |colspan="4"|{{{field|f_annotation|input
> type=textarea|rows=5|cols=180|editor=wikieditor|autogrow|placeholder=Put
> here Annotations/Comments/Discussion Topics/Anectodes/...}}}
>
> And linked this way:
> {{#formredlink:target=Annotation:{{PAGENAME}}|form=TuneAnnotation|link
> text={{PAGENAME}}}}
>
> Any suggestions?
>
>
> ==WIKI INFO:==
>
> +-------------------+---------------------------------------------------------+
> MediaWiki 1.33.1 (d35fba2) 15:11, December 17, 2019
> PHP 7.2.17-0ubuntu0.18.04.1 (apache2handler)
> MariaDB 10.1.38-MariaDB-0ubuntu0.18.04.1
> ICU 60.2
> Elasticsearch 5.6.16
> Lua 5.1.5
> LilyPond 2.18.2
>
> +-------------------+----------------------------------------------------------+
> Page Forms 4.5 (3135f8f) 14:16, April 29, 2019
>
> +-------------------+----------------------------------------------------------+
>
>
> Thanks so much.
>
> Valerio Pelliccioni
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l




_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l