[Wikitech-l] Fetching edit notices via API

2019-04-28 Thread Huji Lee
Hi all,
Is there an API call that would allow you to retrieve the edit notice for a
page?
Huji

PS: I would ask it on Discourse, except
https://phabricator.wikimedia.org/T222045
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] OOUI: problem with button groups

2019-04-15 Thread Huji Lee
@Volker, that is a great point; I was not aware of the discourse
environment, and will use that going forward.

@Bartosz: thanks for the answer. In retrospect, it was an obvious error on
my part.

On Mon, Apr 15, 2019 at 2:58 PM Volker E.  wrote:

> Hi Huji,
> I hope you've found your questions clarified with above. While I appreciate
> the continued efforts here on OOUI questions, I would like to propose
> different channels for your future technical issues.
> Wikimedia Foundation currently test-pilots “Wikimedia Developer Support”[0]
> or alternatively a tag for any questions regarding the library on
> StackOverflow [1]. Using those channels provide easier, long-term
> search-ability for other folks running into the same issues and also keeps
> the noise on a high-volume mailing list like wikitech-l for wide range of
> subscribers low.
> As with any urgent technical question on OOUI you could also seek help on
> the IRC channel #wikimedia-editing.
>
> Thanks and regards,
> Volker
>
>
> [0]: https://discourse-mediawiki.wmflabs.org/
> [1]: https://stackoverflow.com/questions/tagged/oojs-ui
>
> On Mon, Apr 15, 2019 at 11:14 AM Bartosz Dziewoński 
> wrote:
>
> > Using jQuery methods like .remove() and .empty() clears all event
> > handlers from the removed elements. That's why the buttons no longer
> > work after you remove them (using .empty()) and show them again.
> >
> > To avoid this, you can use the .detach() method instead, or hide the
> > elements rather than remove them. For example, instead of:
> >
> >
> >
> dialog.panelBottom.$element.empty().append(dialog.buttonSelect[item.data.group].$element);
> >
> > You can write:
> >
> > dialog.panelBottom.$element.children().detach();
> >
> >
> dialog.panelBottom.$element.append(dialog.buttonSelect[item.data.group].$element);
> >
> > --
> > Bartosz Dziewoński
> >
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Thank you Tuesday

2019-04-15 Thread Huji Lee
I want to echo Timo (Krinkle) and thank Daimona for their fantastic work on
AbuseFilter. Daimona has a great attitude, is constantly thriving to learn,
and has become both more detail oriented as well as big-picture focused
over the last two years. These are fantastic qualities in a programmer, and
in a person in general.

On Mon, Apr 15, 2019 at 7:19 AM Derick Alangi 
wrote:

> Hi,
>
> Thanking Andre Klapper for his work on the https://www.mediawiki.org
> frontpage,
> it looks awesome. Also, thanking the entire Technical Wikimedia community
> (both staffs and volunteers) for their tireless efforts to making the
> wikiverse a reality, especially those involved with things around security.
> <3
>
> *--*
> *https://www.mediawiki.org/wiki/User:X-Savitar>>*
>
>
> On Mon, Apr 15, 2019 at 10:36 AM Daimona  wrote:
>
> > Thanks for the thought! I'm delighted to be part of this big family,
> where
> > I've got to know so many amazing people.
> > I'd like to seize the opportunity to thank some of you, but I really
> can't
> > pick.
> > Y'all are awesome!
> >
> > Il giorno lun 15 apr 2019 alle ore 02:19 Krinkle 
> > ha
> > scritto:
> >
> > > (A few days late, or a day early.)
> > >
> > > Thank to Ebe123 and Daimona Eaytoy for their work on the Score and
> > > AbuseFilter extensions. For years they've been working on these code
> > bases
> > > and consistently very responsive to bug reports, maintenance inquiries,
> > and
> > > offering help to other interested contributors.
> > >
> > > Thanks for being awesome!
> > >
> > > -- Timo
> > > ___
> > > Wikitech-l mailing list
> > > Wikitech-l@lists.wikimedia.org
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
> >
> >
> > --
> > https://meta.wikimedia.org/wiki/User:Daimona_Eaytoy
> > "Daimona" is not my real name -- he/him
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] OOUI: problem with button groups

2019-04-15 Thread Huji Lee
Hello,

While I am waiting for my other OOUI-related question to be answered, I
want to ask a brand new one!

Please see the code here: https://meta.wikimedia.org/wiki/User:Huji/OOUI2.js

Once you enable this script, you will be shown a dialog with two sets of
buttons. The first set has "Show Emotions" pre-selected, and you see two
buttons (Happy and Sad) in the second button group. You can click on those
buttons and you will see they get highlighted as you select them.

Next, you can click on "Show Animals" and that will swap the second row
with a new ButtonSelectWidget which has two choices (Cat and Dog). Again,
you can click on Cat or Dog and they will get highlighted and function
normally.

*Now the problem:* Click on "Show Emotions" again; it will bring back the
other ButtonSelectWidget, the one with Happy and Sad buttons; but these
buttons do not work anymore. If you click on the they won't get selected,
and indeed, the 'choose' even is not triggered for that ButtonSelectWidget
anymore either.

I also tried a different implementation in which instead of swapping the
contents of the panel, I recreate the ButtonSelectWidget each time, but
that also had the same problem.

Am I doing something wrong, or have I uncovered a bug in OOUI?

Thanks,

Huji
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Dynamically setting the content of a LayoutPanel in OOUI

2019-04-01 Thread Huji Lee
I watched your talk, [1] which happened 3 days after this exchange, and I
found it very informative! Posting here so more people can see it along
with the same thread.

[1] https://www.youtube.com/watch?v=T_CUN2o4faw

On Sun, Mar 24, 2019 at 10:11 PM Huji Lee  wrote:

> Thanks a lot! The gist certainly helped a lot.
>
> I think the key line in your code, and what Alex was referring to, was
> this one: this.$content.empty().append( $content );
>
> But I like the idea of formalizing the process into an object. I will
> likely take a slightly different approach, in which I will create a class
> that inherits PanelLayout but has the additional setContent() method you
> had in your gist.
>
>
>
> On Sun, Mar 24, 2019 at 3:01 PM Moriel Schottlender <
> mschottlen...@wikimedia.org> wrote:
>
>> You absolutely can attach a jQuery element into your $content parameter.
>> That will work, and probably give you what you want.
>>
>> However, one of the more powerful things about OOUI is its ability to
>> encapsulate this type of work. In this case, what I would recommend, is
>> creating your own custom widget that manages itself.
>>
>> I imagine that your $content changes, but it probably has similar
>> structure
>> through its changes. For example, it might have an error box at the top
>> that only appears when necessary, or it can have some regular inputs
>> alongside inputs that maybe change, and it probably has some area where
>> you
>> display a text or an image or anything else.
>>
>> You could create all of those in jQuery, but OOUI also offers you an
>> ability to encapuslate this better.
>>
>> I tried to explain this in an email and got a bit long, so I created a
>> gist: https://gist.github.com/mooeypoo/a9082a5a5828dcec53be28ed3c538e22
>>
>> The main idea I am trying to show is how you can create your own widget
>> that extends OO.ui.Widget, construct its base structure in the constructor
>> with either other OOUI widgets or with some custom jQuery elements, add
>> classes and event listeners, and then manage the state of this widget when
>> some other code calls its methods.
>>
>> I tried to also show how you can have your custom widget emit some custom
>> event so that other pieces of your code (say, the dialog in general?) can
>> listen to some event (I used "success" but you can define whatever you
>> want) and respond, like change to another panel, or close the dialog, or
>> enable some other action.
>>
>> I hope the gist helps, I tried to make it self explanatory, but please let
>> me know if you encounter any issues with it (I wrote it relatively
>> quickly,
>> I hope there aren't any bugs ;)
>>
>> Moriel
>>
>> On Sun, Mar 24, 2019 at 7:19 AM Alex Monk  wrote:
>>
>> > I haven't dealt with OOUI for a couple of years but maybe you could
>> pass a
>> > jQuery object to the $content parameter, store it yourself, then modify
>> > that later?
>> >
>> > On Sun, 24 Mar 2019 at 14:14, Huji Lee  wrote:
>> >
>> > > In the script I am working on,[1] I have a PanelLayout that is defined
>> > like
>> > > this:
>> > >
>> > > this.previewResult = new OO.ui.PanelLayout({
>> > >   expanded: true,
>> > >   padded: true,
>> > >   framed: true,
>> > >   $content: ''
>> > > });
>> > >
>> > > Later on, I would like to modify the content of this; specifically, I
>> > want
>> > > to use MW API to retrieve the parsed output of some short wikitext.
>> For
>> > > now, however, I just want to try out the concept by replacing the
>> content
>> > > with a simple  tag.
>> > >
>> > > Evidently, this line of code does not do the trick:
>> > >
>> > > dialog.previewResult.$content = 'Something';
>> > >
>> > >
>> > > That is, it does update the value of the $content property for the
>> OOUI
>> > > object, but that does not result in the object getting re-rendered.
>> None
>> > of
>> > > the setter functions for OO.ui.PanelLayout seem to do the trick
>> either.
>> > >
>> > > What is the correct way to do this? If PanelLayout is not the right
>> > object
>> > > type for this purpose, what is?
>> > > ___
>> > > Wikitech-l mailing list
>> > > Wikitech-l@lists.wikimedia.org
>> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>> > ___
>> > Wikitech-l mailing list
>> > Wikitech-l@lists.wikimedia.org
>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>>
>>
>> --
>> Moriel Schottlender (she/her)
>> Senior Software Engineer
>> Tech Lead | Community Tech and Anti Harassment Tools
>> Wikimedia Foundation https://wikimediafoundation.org/
>> ___
>> Wikitech-l mailing list
>> Wikitech-l@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] OOUI: putting an IndexLayout inside a StackLayout

2019-04-01 Thread Huji Lee
Hi,

I am trying to make a continuous StackLayout with three parts (top, middle
and bottom), where the top panel contains an IndexLayout. My code is at
https://meta.wikimedia.org/wiki/User:Huji/OOUI.js and as you can see, in
the output of it the bottom and middle panels are shown "on top of" the top
panel. This only occurs when the top panel is an IndexLayout; if I replace
its contents with any other element, no overlap occurs.

Can you please guide me as to who to achieve what I want?

Thanks!

Huji

PS: The context here is that eventually each tab in the IndexLayout will
present the user with some buttons; when they select a button from one of
the tabs, the middle and bottom panels will be used to preview the output
of that button and then save it to the page.
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Dynamically setting the content of a LayoutPanel in OOUI

2019-03-24 Thread Huji Lee
Thanks a lot! The gist certainly helped a lot.

I think the key line in your code, and what Alex was referring to, was this
one: this.$content.empty().append( $content );

But I like the idea of formalizing the process into an object. I will
likely take a slightly different approach, in which I will create a class
that inherits PanelLayout but has the additional setContent() method you
had in your gist.



On Sun, Mar 24, 2019 at 3:01 PM Moriel Schottlender <
mschottlen...@wikimedia.org> wrote:

> You absolutely can attach a jQuery element into your $content parameter.
> That will work, and probably give you what you want.
>
> However, one of the more powerful things about OOUI is its ability to
> encapsulate this type of work. In this case, what I would recommend, is
> creating your own custom widget that manages itself.
>
> I imagine that your $content changes, but it probably has similar structure
> through its changes. For example, it might have an error box at the top
> that only appears when necessary, or it can have some regular inputs
> alongside inputs that maybe change, and it probably has some area where you
> display a text or an image or anything else.
>
> You could create all of those in jQuery, but OOUI also offers you an
> ability to encapuslate this better.
>
> I tried to explain this in an email and got a bit long, so I created a
> gist: https://gist.github.com/mooeypoo/a9082a5a5828dcec53be28ed3c538e22
>
> The main idea I am trying to show is how you can create your own widget
> that extends OO.ui.Widget, construct its base structure in the constructor
> with either other OOUI widgets or with some custom jQuery elements, add
> classes and event listeners, and then manage the state of this widget when
> some other code calls its methods.
>
> I tried to also show how you can have your custom widget emit some custom
> event so that other pieces of your code (say, the dialog in general?) can
> listen to some event (I used "success" but you can define whatever you
> want) and respond, like change to another panel, or close the dialog, or
> enable some other action.
>
> I hope the gist helps, I tried to make it self explanatory, but please let
> me know if you encounter any issues with it (I wrote it relatively quickly,
> I hope there aren't any bugs ;)
>
> Moriel
>
> On Sun, Mar 24, 2019 at 7:19 AM Alex Monk  wrote:
>
> > I haven't dealt with OOUI for a couple of years but maybe you could pass
> a
> > jQuery object to the $content parameter, store it yourself, then modify
> > that later?
> >
> > On Sun, 24 Mar 2019 at 14:14, Huji Lee  wrote:
> >
> > > In the script I am working on,[1] I have a PanelLayout that is defined
> > like
> > > this:
> > >
> > > this.previewResult = new OO.ui.PanelLayout({
> > >   expanded: true,
> > >   padded: true,
> > >   framed: true,
> > >   $content: ''
> > > });
> > >
> > > Later on, I would like to modify the content of this; specifically, I
> > want
> > > to use MW API to retrieve the parsed output of some short wikitext. For
> > > now, however, I just want to try out the concept by replacing the
> content
> > > with a simple  tag.
> > >
> > > Evidently, this line of code does not do the trick:
> > >
> > > dialog.previewResult.$content = 'Something';
> > >
> > >
> > > That is, it does update the value of the $content property for the OOUI
> > > object, but that does not result in the object getting re-rendered.
> None
> > of
> > > the setter functions for OO.ui.PanelLayout seem to do the trick either.
> > >
> > > What is the correct way to do this? If PanelLayout is not the right
> > object
> > > type for this purpose, what is?
> > > ___
> > > Wikitech-l mailing list
> > > Wikitech-l@lists.wikimedia.org
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
> --
> Moriel Schottlender (she/her)
> Senior Software Engineer
> Tech Lead | Community Tech and Anti Harassment Tools
> Wikimedia Foundation https://wikimediafoundation.org/
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] Dynamically setting the content of a LayoutPanel in OOUI

2019-03-24 Thread Huji Lee
In the script I am working on,[1] I have a PanelLayout that is defined like
this:

this.previewResult = new OO.ui.PanelLayout({
  expanded: true,
  padded: true,
  framed: true,
  $content: ''
});

Later on, I would like to modify the content of this; specifically, I want
to use MW API to retrieve the parsed output of some short wikitext. For
now, however, I just want to try out the concept by replacing the content
with a simple  tag.

Evidently, this line of code does not do the trick:

dialog.previewResult.$content = 'Something';


That is, it does update the value of the $content property for the OOUI
object, but that does not result in the object getting re-rendered. None of
the setter functions for OO.ui.PanelLayout seem to do the trick either.

What is the correct way to do this? If PanelLayout is not the right object
type for this purpose, what is?
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] OOUI question

2019-03-21 Thread Huji Lee
I found out that I had hardcoded the scrollable property in the wrong
place. But, interestingly, I also figured out that StackLayou's scrollable
parameter defaults to true. Isn't that in contrast with the documentation?

Anyway, setting it to false resolved that issue. Next I need to figure out
how to nest a StackLayout inside another StackLayout

On Thu, Mar 21, 2019 at 10:20 PM Huji Lee  wrote:

> Actually, can I ask for one more thing?
>
> I updated the code such that when you click on that link (which now reads
> as "تذکر"), it would open a dialog with a StackLayout in it which consists
> of two FieldLayouts, somehow, the dialog is becoming scrollable, and has
> very little height, making the contents hard to read. Looking at the
> documentations for StackLayout I see that the scrollable parameter defaults
> to false; I even went ahead and hardcoded the value as false, but the
> problem persists. Can you kindly tell me which other elements need to be
> modified for this not to occur?
>
> Thanks again,
>
> Huji
>
> On Thu, Mar 21, 2019 at 7:41 AM Huji Lee  wrote:
>
>> You are absolutely right; I really appreciate the time you took to review
>> the code!
>> Thanks,
>> Huji
>>
>> On Wed, Mar 20, 2019 at 11:25 PM Moriel Schottlender <
>> mschottlen...@wikimedia.org> wrote:
>>
>>> Hi Huji,
>>>
>>> I took a look, and it seems you're missing the command to actually open
>>> the
>>> dialog. Your code builds the dialog correctly, and then attaches the
>>> windowManager and adds the dialog to the window, but there's no command
>>> telling the manager to open the dialog on click.
>>>
>>> I tried to debug your code, so I copied it over and looked and I found
>>> that
>>> if I changed this, it worked:
>>>
>>> $(mw.util.addPortletLink( 'p-cactions', '#', 'تذکر', 'ca-warn',
>>> 'فرستادن سریع یک پیام یا تذکر مبتنی بر الگو', '*')).click(function(e)
>>> {
>>>   mw.loader.using(['oojs-ui-core', 'oojs-ui-widgets',
>>> 'oojs-ui-windows', 'mediawiki.api'])
>>> .then(UMOptions.createWindow)
>>> .then( function () {
>>>         windowManager.openWindow( UM );
>>> } );
>>>
>>> (notice the second 'then')
>>> Basically, I tell the code that on click, after it is certain to have
>>> created the dialog, it should open it :)
>>>
>>> See documentation here:
>>> https://www.mediawiki.org/wiki/OOUI/Windows/Dialogs
>>>
>>> I hope this helps!
>>>
>>> Moriel
>>>
>>> On Wed, Mar 20, 2019 at 7:22 PM Huji Lee  wrote:
>>>
>>> > Hi everyone!
>>> >
>>> > I am pretty sure I am missing something obvious here, but I cannot
>>> spot it
>>> > and I would appreciate a fresh set of eyes looking at it.
>>> >
>>> > The script at https://fa.wikipedia.org/wiki/User:Huji/UserMessages.js
>>> is
>>> > the backbone of a OOUI-based tool. I have made quite a few of a these
>>> tools
>>> > in the past with no problem. For now, this tool is only supposed to do
>>> two
>>> > things: add a link to the "More" dropdown on the top of the page (only
>>> if
>>> > it is a user talk page), and open a OOUI dialog once the link is
>>> clicked.
>>> >
>>> > The first part works and I have verified that the *createWindow*
>>> method is
>>> > called when you click the link, but the dialog is not shown. Can
>>> someone
>>> > kindly look at my code and tell me what I am missing?
>>> >
>>> > Thanks,
>>> >
>>> > Huji
>>> > ___
>>> > Wikitech-l mailing list
>>> > Wikitech-l@lists.wikimedia.org
>>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>>
>>>
>>>
>>> --
>>> Moriel Schottlender (she/her)
>>> Senior Software Engineer
>>> Tech Lead | Community Tech and Anti Harassment Tools
>>> Wikimedia Foundation https://wikimediafoundation.org/
>>> ___
>>> Wikitech-l mailing list
>>> Wikitech-l@lists.wikimedia.org
>>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] OOUI question

2019-03-21 Thread Huji Lee
Actually, can I ask for one more thing?

I updated the code such that when you click on that link (which now reads
as "تذکر"), it would open a dialog with a StackLayout in it which consists
of two FieldLayouts, somehow, the dialog is becoming scrollable, and has
very little height, making the contents hard to read. Looking at the
documentations for StackLayout I see that the scrollable parameter defaults
to false; I even went ahead and hardcoded the value as false, but the
problem persists. Can you kindly tell me which other elements need to be
modified for this not to occur?

Thanks again,

Huji

On Thu, Mar 21, 2019 at 7:41 AM Huji Lee  wrote:

> You are absolutely right; I really appreciate the time you took to review
> the code!
> Thanks,
> Huji
>
> On Wed, Mar 20, 2019 at 11:25 PM Moriel Schottlender <
> mschottlen...@wikimedia.org> wrote:
>
>> Hi Huji,
>>
>> I took a look, and it seems you're missing the command to actually open
>> the
>> dialog. Your code builds the dialog correctly, and then attaches the
>> windowManager and adds the dialog to the window, but there's no command
>> telling the manager to open the dialog on click.
>>
>> I tried to debug your code, so I copied it over and looked and I found
>> that
>> if I changed this, it worked:
>>
>> $(mw.util.addPortletLink( 'p-cactions', '#', 'تذکر', 'ca-warn',
>> 'فرستادن سریع یک پیام یا تذکر مبتنی بر الگو', '*')).click(function(e)
>> {
>>   mw.loader.using(['oojs-ui-core', 'oojs-ui-widgets',
>> 'oojs-ui-windows', 'mediawiki.api'])
>> .then(UMOptions.createWindow)
>> .then( function () {
>> windowManager.openWindow( UM );
>> } );
>>
>> (notice the second 'then')
>> Basically, I tell the code that on click, after it is certain to have
>> created the dialog, it should open it :)
>>
>> See documentation here:
>> https://www.mediawiki.org/wiki/OOUI/Windows/Dialogs
>>
>> I hope this helps!
>>
>> Moriel
>>
>> On Wed, Mar 20, 2019 at 7:22 PM Huji Lee  wrote:
>>
>> > Hi everyone!
>> >
>> > I am pretty sure I am missing something obvious here, but I cannot spot
>> it
>> > and I would appreciate a fresh set of eyes looking at it.
>> >
>> > The script at https://fa.wikipedia.org/wiki/User:Huji/UserMessages.js
>> is
>> > the backbone of a OOUI-based tool. I have made quite a few of a these
>> tools
>> > in the past with no problem. For now, this tool is only supposed to do
>> two
>> > things: add a link to the "More" dropdown on the top of the page (only
>> if
>> > it is a user talk page), and open a OOUI dialog once the link is
>> clicked.
>> >
>> > The first part works and I have verified that the *createWindow* method
>> is
>> > called when you click the link, but the dialog is not shown. Can someone
>> > kindly look at my code and tell me what I am missing?
>> >
>> > Thanks,
>> >
>> > Huji
>> > ___
>> > Wikitech-l mailing list
>> > Wikitech-l@lists.wikimedia.org
>> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
>>
>>
>> --
>> Moriel Schottlender (she/her)
>> Senior Software Engineer
>> Tech Lead | Community Tech and Anti Harassment Tools
>> Wikimedia Foundation https://wikimediafoundation.org/
>> ___
>> Wikitech-l mailing list
>> Wikitech-l@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] OOUI question

2019-03-21 Thread Huji Lee
You are absolutely right; I really appreciate the time you took to review
the code!
Thanks,
Huji

On Wed, Mar 20, 2019 at 11:25 PM Moriel Schottlender <
mschottlen...@wikimedia.org> wrote:

> Hi Huji,
>
> I took a look, and it seems you're missing the command to actually open the
> dialog. Your code builds the dialog correctly, and then attaches the
> windowManager and adds the dialog to the window, but there's no command
> telling the manager to open the dialog on click.
>
> I tried to debug your code, so I copied it over and looked and I found that
> if I changed this, it worked:
>
> $(mw.util.addPortletLink( 'p-cactions', '#', 'تذکر', 'ca-warn',
> 'فرستادن سریع یک پیام یا تذکر مبتنی بر الگو', '*')).click(function(e)
> {
>   mw.loader.using(['oojs-ui-core', 'oojs-ui-widgets',
> 'oojs-ui-windows', 'mediawiki.api'])
> .then(UMOptions.createWindow)
> .then( function () {
> windowManager.openWindow( UM );
> } );
>
> (notice the second 'then')
> Basically, I tell the code that on click, after it is certain to have
> created the dialog, it should open it :)
>
> See documentation here:
> https://www.mediawiki.org/wiki/OOUI/Windows/Dialogs
>
> I hope this helps!
>
> Moriel
>
> On Wed, Mar 20, 2019 at 7:22 PM Huji Lee  wrote:
>
> > Hi everyone!
> >
> > I am pretty sure I am missing something obvious here, but I cannot spot
> it
> > and I would appreciate a fresh set of eyes looking at it.
> >
> > The script at https://fa.wikipedia.org/wiki/User:Huji/UserMessages.js is
> > the backbone of a OOUI-based tool. I have made quite a few of a these
> tools
> > in the past with no problem. For now, this tool is only supposed to do
> two
> > things: add a link to the "More" dropdown on the top of the page (only if
> > it is a user talk page), and open a OOUI dialog once the link is clicked.
> >
> > The first part works and I have verified that the *createWindow* method
> is
> > called when you click the link, but the dialog is not shown. Can someone
> > kindly look at my code and tell me what I am missing?
> >
> > Thanks,
> >
> > Huji
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
> --
> Moriel Schottlender (she/her)
> Senior Software Engineer
> Tech Lead | Community Tech and Anti Harassment Tools
> Wikimedia Foundation https://wikimediafoundation.org/
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] OOUI question

2019-03-20 Thread Huji Lee
Hi everyone!

I am pretty sure I am missing something obvious here, but I cannot spot it
and I would appreciate a fresh set of eyes looking at it.

The script at https://fa.wikipedia.org/wiki/User:Huji/UserMessages.js is
the backbone of a OOUI-based tool. I have made quite a few of a these tools
in the past with no problem. For now, this tool is only supposed to do two
things: add a link to the "More" dropdown on the top of the page (only if
it is a user talk page), and open a OOUI dialog once the link is clicked.

The first part works and I have verified that the *createWindow* method is
called when you click the link, but the dialog is not shown. Can someone
kindly look at my code and tell me what I am missing?

Thanks,

Huji
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] Simplifying the use of update.php for wiki families

2016-10-16 Thread Huji Lee
Dear all,

I am working on a simple idea that would simplify how update.php can be
used for wiki families. Please consider commenting on
https://phabricator.wikimedia.org/T147817

Thanks,

Huji
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] Urgent help needed from WMF admins

2016-09-22 Thread Huji Lee
Please see https://phabricator.wikimedia.org/T146440 and assist.
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Issue with Gadget dependencies and ResourceLoader

2015-08-28 Thread Huji Lee
I wanted to bring this back up into your attention, hoping that I can get a
response.

On Thu, Aug 20, 2015 at 10:46 PM, Huji Lee  wrote:

> Excellent answers. Thank you!
>
> Here is a final question: how long does it generally take for a change
> made in a script to be reflected in the output of RL? Is it in the order of
> minutes or hours?
>
> On Thu, Aug 20, 2015 at 10:26 AM, Bartosz Dziewoński 
> wrote:
>
>> On Thu, 20 Aug 2015 04:07:57 +0200, Huji Lee  wrote:
>>
>> However, if you don't
>>> bypass ResourceLoader, the "+" links won't work and an error is thrown
>>> reading "SimpleWindow is not defined" (try on my talk page without
>>> bypassing RL <https://fa.wikipedia.org/wiki/User_talk:Huji>). Note that
>>> SimpleWindow is defined in morebits.js
>>>
>>
>> When you load a script through ResourceLoader, it's not executed in
>> global context. This means that global variables you define are actually
>> *not global* (they are local to the function your code is wrapped in),
>> unless you explicitly assign them as `window` properties.
>>
>> The code of the gadget in question actually does it right:
>>
>>   // https://fa.wikipedia.org/wiki/مدیاویکی:Gadget-UserMessages.js
>>   var UserMessages = {};
>>   window.UserMessages = UserMessages; // global access
>>
>> (It would be sufficient to just do `window.UserMessages = {}`, but this
>> is also just as correct.)
>>
>> morebits doesn't:
>>
>>   // https://fa.wikipedia.org/wiki/مدیاویکی:Gadget-morebits.js
>>   var SimpleWindow = function( width, height ) { ...
>>
>> This should be changed to:
>>
>>   window.SimpleWindow = function( width, height ) {
>>
>>
>> 1) How come it works when you bypass ResourceLoader? Note that nothing
>>> else
>>> has changed recently (including the morebits.js code on that Wiki)
>>>
>>
>> When you use ?debug=true, the global variables are actually global. This
>> is an implementation detail of how debug mode works, and hopefully will be
>> changed to behave like normal mode at some point.
>>
>>
>> 2) Is it safe to assume that just by listing ext.gadgets.morebits as a
>>> dependency, morebits will be properly loaded by ResourceLoader?
>>>
>>
>> Yes, just be careful about explicitly allowing access to globals by
>> attaching them to `window`.
>>
>>
>> --
>> Bartosz Dziewoński
>>
>> ___
>> Wikitech-l mailing list
>> Wikitech-l@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Issue with Gadget dependencies and ResourceLoader

2015-08-20 Thread Huji Lee
Excellent answers. Thank you!

Here is a final question: how long does it generally take for a change made
in a script to be reflected in the output of RL? Is it in the order of
minutes or hours?

On Thu, Aug 20, 2015 at 10:26 AM, Bartosz Dziewoński 
wrote:

> On Thu, 20 Aug 2015 04:07:57 +0200, Huji Lee  wrote:
>
> However, if you don't
>> bypass ResourceLoader, the "+" links won't work and an error is thrown
>> reading "SimpleWindow is not defined" (try on my talk page without
>> bypassing RL <https://fa.wikipedia.org/wiki/User_talk:Huji>). Note that
>> SimpleWindow is defined in morebits.js
>>
>
> When you load a script through ResourceLoader, it's not executed in global
> context. This means that global variables you define are actually *not
> global* (they are local to the function your code is wrapped in), unless
> you explicitly assign them as `window` properties.
>
> The code of the gadget in question actually does it right:
>
>   // https://fa.wikipedia.org/wiki/مدیاویکی:Gadget-UserMessages.js
>   var UserMessages = {};
>   window.UserMessages = UserMessages; // global access
>
> (It would be sufficient to just do `window.UserMessages = {}`, but this is
> also just as correct.)
>
> morebits doesn't:
>
>   // https://fa.wikipedia.org/wiki/مدیاویکی:Gadget-morebits.js
>   var SimpleWindow = function( width, height ) { ...
>
> This should be changed to:
>
>   window.SimpleWindow = function( width, height ) {
>
>
> 1) How come it works when you bypass ResourceLoader? Note that nothing else
>> has changed recently (including the morebits.js code on that Wiki)
>>
>
> When you use ?debug=true, the global variables are actually global. This
> is an implementation detail of how debug mode works, and hopefully will be
> changed to behave like normal mode at some point.
>
>
> 2) Is it safe to assume that just by listing ext.gadgets.morebits as a
>> dependency, morebits will be properly loaded by ResourceLoader?
>>
>
> Yes, just be careful about explicitly allowing access to globals by
> attaching them to `window`.
>
>
> --
> Bartosz Dziewoński
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] Issue with Gadget dependencies and ResourceLoader

2015-08-19 Thread Huji Lee
Hi,

I have enabled a Gadget on Fa Wikipedia (if you go to
https://fa.wikipedia.org/wiki/Special:Preferences#mw-prefsection-gadgets it
is the second one from the top) which depends on ext.gadgets.morebits (as
defined on https://fa.wikipedia.org/wiki/MediaWiki:Gadgets-definition). It
adds a portlet menu labeled "تذکر" which shows only on user talk pages. The
menu contains a number of links, some of which start with "+".

These "+" links are supposed to open a dialog using morebits. If you use
*debug=true* to bypass ResourceLoader, they work fine (feel free to try on my
talk page  after
enabling the gadget for your account on Fa WP). However, if you don't
bypass ResourceLoader, the "+" links won't work and an error is thrown
reading "SimpleWindow is not defined" (try on my talk page without
bypassing RL ). Note that
SimpleWindow is defined in morebits.js

My questions are as follows:

1) How come it works when you bypass ResourceLoader? Note that nothing else
has changed recently (including the morebits.js code on that Wiki)

2) Is it safe to assume that just by listing ext.gadgets.morebits as a
dependency, morebits will be properly loaded by ResourceLoader?

3) Unless 1 or 2 answers it already: how would I fix this problem and make
the gadget work?

Thanks,

Huji
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] Request for comments

2010-11-11 Thread Huji Lee
Hi

I would be grateful if one could review the the functions added in the
patchI
attached to bug
24411  and post
comments on the bug on how to improve the code.

Best,

Hojjat (aka Huji)
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[Wikitech-l] Checkuser mailing list

2010-10-19 Thread Huji Lee
Hello,

I'm asking this here per advice from Cary Bass.

I would like to request an enhancement in the checkuser-l mailing list,
which would allow searching the topics and/or contents of archived mails for
specific terms. This is particularly useful on this mailing list, because
CUs frequently need to check the archives to review previous information
about IPs and socks.

I'm aware that our mailing lists are running on Mailman 2.1.9 (which is NOT
the latest version [1]). Having checked their website I'm sure such search
functionality IS NOT available in mailman, nor through a plug-in. They
advise using third-party search engines (like Google), but since checkuser-l
is not a public list, Google is not an option. They also suggest using some
patches [2] which are compatible with Pipermail, but whether they are
suitable in our case is beyond my understanding.

I'm sure I'm not the only one asking for this feature. I'd be grateful if
the request was taken into consideration.

Regards,

[1] http://www.gnu.org/software/mailman/index.html
[2] http://wiki.list.org/display/DOC/How+do+I+make+the+archives+searchable
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l