Re: [Wikitech-l] Order of execution JavaScript extensions

2012-06-06 Thread Bergi

Andrew Dunbar schrieb:

I'm having trouble getting a simple one-line User JS working on Wiktionary.



Apologies if this is not the right mailing list. None of the lists
seemed fit according to http://www.mediawiki.org/wiki/Mailing_lists


I think the 
http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts would be 
a better place to discuss. Even though it's not Wiktionary, you should 
find the (user-)JS gurus there :-)


Apart from that, I guess your code interferes with the 
ext.vector.collapsibleNav.js module. Waiting for it (with 
mw.loader.using) before executing your snippet should work.


regards,
 Bergi


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


Re: [Wikitech-l] Gerrit question: pushing to another branch

2012-06-05 Thread Bergi

Marcin Cieslak schrieb:

Bergia.d.be...@web.de  wrote:

Doesn't Git encourage us to create as many branches as we can, to share
our work and collaborate? Or should I publish my branch(es) somewhere
else, maybe without gerrit at all?


You are supposed to push one perfect commit for review; you might
also push some with dependencies between them but then things get
nasty.


Yes, I feared that. Too bad.

But I thought there was a possibility to push to our repository without 
using Gerrit / being affected by Gerrit at all?
I can understand that Gerrit is a nice review tool which is useful for 
the production and master branches, but I'd like to have a repo for 
developing  sharing cool new features without any review at all. The 
discussion would happen at bugzilla or mediawiki.org.

Do you think there is a way?

Thanks,
 Bergi

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


Re: [Wikitech-l] Give create gerrit repo right to all WMF engineers

2012-06-05 Thread Bergi

Platonides schrieb:

On 01/06/12 17:41, Chad wrote:

I did make a new Project Creators group that I'm more than willing to add
people to, once they've learned Gerrit permissions.

In addition, unless you make a group you're in the owner of the repo (which
can't be done via the GUI, only the CLI--this is a bug), you won't be able
to set permissions at all (this is by design).


Are current permission groups viewable anywhere?


Chad's tutorial 
https://www.mediawiki.org/wiki/Git/Creating_new_repositories includes 
a link to people who are allowed to create new repositories 
https://gerrit.wikimedia.org/r/#/admin/groups/119,members, if you were 
looking for that.


 Bergi

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


Re: [Wikitech-l] Gerrit question: pushing to another branch

2012-05-31 Thread Bergi

Marcin Cieslak schrieb:

Ryan Kaldarirkald...@wikimedia.org  wrote:

How do you create the new branch on gerrit?


In Gerrit Web UI:

Admin -  Projects -  (choose project) -  Branches -  Create branch


I justed wanted to create a new remote branch today to show other my 
work. With the usual

 git push -u origin my-branch:new-remote-branch
I just got the described problem that Gerrit rejected the new branch.

So I felt very lucky to see the issue just coming up in this thread and 
wanted to try your solution. Yet at 
https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/core,branches I 
can't find a button to create a new branch. Will I need additional 
rights for that?


Doesn't Git encourage us to create as many branches as we can, to share 
our work and collaborate? Or should I publish my branch(es) somewhere 
else, maybe without gerrit at all?


 Bergi

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


Re: [Wikitech-l] xsl wiki markup - html

2012-04-26 Thread Bergi

sance...@free.fr schrieb:

Hi,
I would like to know if there already exists xsl stylesheets that are
able to translate wiki markup to html or html to wiki markup.


No, Wikitext markup is far too complex to be parsed with xsl.

regards,
 Bergi


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


Re: [Wikitech-l] Future stuff: native SVG and other high-resolution imagery

2012-03-21 Thread Bergi

Brion Vibber schrieb:

Ooh! We may be able to handle this like the js/nojs styles.

Have a bit of JS on startup check for svg support and add a class to the
HTML root element. Then we just need .svg .foo {} entries with the svg
background overrides.

Not ideal but should work, with the downside that non-JS browsers don't get
svg.


Wouldn't that mean loading the png thumbnails, and then onDomReady 
replacing them with svgs? I think we really should deliver an output 
that lets the browser choose one of them, not one plus maybe a second to 
load.


 Bergi

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


Re: [Wikitech-l] irc logs

2012-03-20 Thread Bergi

Petr Bena schrieb:

Hi,

I created a search engine for irc logs, it works much faster than
current engine and it's written in php. I will send a source code
soon.


Cool. I didn't know that there had already been an engine?


http://bots.wmflabs.org/~wm-bot/searchlog/

I don't understand html, so output is ugly. If someone wants to help
to improve it, let me know.


Just one litte CSS thing: div.content could need an overflow: auto; 
instead of overflow:scroll.


 Bergi

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


Re: [Wikitech-l] QA/testing project page exists

2012-03-19 Thread Bergi

Chris McMahon schrieb:

After doing a lot of research and visiting WMF for a week, I created a
QA/testing project page here: http://www.mediawiki.org/wiki/QA/testing


Ah, QA means quality assurance.

Other meanings were:
* qualtity articles
* question  answer
* ...
[http://en.wikipedia.org/wiki/QA]

 Bergi


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


Re: [Wikitech-l] New Plugin for Extension:ConfirmEdit - RFC

2012-03-19 Thread Bergi

nischay nahata schrieb:

Hi,
I have made a Captcha plugin for ConfirmEdit called MCQ (Multiple Choice
Questions)
Below is the usage of it

sample Captcha:
Pick the correct Option Number
We pray to 1.Time 1.God 3.Lion 4.Tomato ?
  Answer 2

* Most Important - Good support for i18n


https://github.com/nischayn22/MCQCaptcha/blob/master/MCQ.i18n.php

Uh, and you can build a lookup table with the API?

/api.php?action=querymeta=allmessagesamfrom=question
/api.php?action=querymeta=allmessagesamfrom=answer

Of course it's not easy to build an unretrievable qa database in an 
opensource project, but it shouldn't be that easy :-)


 Bergi


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


Re: [Wikitech-l] Ajax event firing for username validation in Extension: SignupAPI

2012-03-12 Thread Bergi

Akshay Agarwal schrieb:

Hi,

In SignupAPI extension, should I fire the Ajax user validation (username
available  not illegal checking)  'onchange' / 'onkeyup' ?


The illegal character logic could be implemented in JS. Or at least a 
part of it, and an ajax request only onchange. For example don't forget 
to send no request for an empty input form.



1) 'onchange' would cause less Ajax calls but will give result only when
the user has pressed tab or clicks to the next field

2) 'onkeyup'  would cause a lot of Ajax calls but would give result as
when the user types so that he can correct the input if needed rather than
going to the next field  then finding that he just gave some invalid input
in the previous field


You may use the combination of onkeyup with a timeout of about 200ms. 
That will reduce lots of ajax calls, it's no live search but a validation.



What would be better from a UX + Performance point of view? Is there any
other JavaScript event I should be looking at?


Watch for the events paste, change, input, mouseup and keyup, 
that should get all.


 Bergi

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


Re: [Wikitech-l] Ajax event firing for username validation in Extension: SignupAPI

2012-03-12 Thread Bergi

Akshay Agarwal schrieb:

Hi,

In SignupAPI extension, should I fire the Ajax user validation (username
available  not illegal checking)  'onchange' / 'onkeyup' ?


The illegal character logic could be implemented in JS. Or at least a 
part of it, and an ajax request only onchange. For example don't forget 
to send no request for an empty input form.



1) 'onchange' would cause less Ajax calls but will give result only when
the user has pressed tab or clicks to the next field

2) 'onkeyup'  would cause a lot of Ajax calls but would give result as
when the user types so that he can correct the input if needed rather than
going to the next field  then finding that he just gave some invalid input
in the previous field


You may use the combination of onkeyup with a timeout of about 200ms. 
That will reduce lots of ajax calls, it's no live search but a validation.



What would be better from a UX + Performance point of view? Is there any
other JavaScript event I should be looking at?


Watch for the events paste, change, input, mouseup and keyup, 
that should get all.


 Bergi

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


Re: [Wikitech-l] Post-deploy Bug triage for 1.19

2012-03-02 Thread Bergi

Mark A. Hershberger schrieb:


 When:  Friday, February, 21:00UTC
Time zone conversion: http://hexm.de/g5


JFYI: We've got March already :-)

 Bergi

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


Re: [Wikitech-l] About page ID

2012-02-18 Thread Bergi

Alex Brollo schrieb:

Is there a sound reason to hidden so well the main id of pages? Is there
any drawback to show it anywhere into wikies, and to use it much largely
for links and API calls?


Not for API calls, but for links. For the API you can use 
mw.config.get(wgArticleId) without problems, but there are some 
downsides to use the page ID in regular links:

* a link should show the page title, not just a intransparent number
* pretty urls, see also http://www.mediawiki.org/?curid=2852 (???)
* the id may stay consistent when moving a page, but that should be done 
with redirects. But when a page was deleted, having only the uri 
(http://de.wikipedia.org/?curid=6770594) won't help you anything 
(invalid title). But visiting http://de.wikipedia.org/wiki/Taurmina, 
you will see at least the deletion log.


There was also a discussion at 
http://de.wikipedia.org/wiki/Wikipedia:Projektdiskussion/WP_-_Teil_des_www, 
since then we have a gadget in deWP to show a secont permanent link with 
curid.
For technical documentation you may have a look at 
http://www.mediawiki.org/wiki/Manual:Short_URL.


Regards,
 Bergi

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


Re: [Wikitech-l] [Mediawiki-l] authentication on Wikipedia via user_name OR user_email

2012-02-17 Thread Bergi

Bináris schrieb:

An alternative solution to the original problem could be an extension that
displays possible characters from several alphabets and helps to generate
the username with mouse and put it back to the login name/password field.


I don't think that would be a good idea.
* It sounds as it would need JavaScript (or would be difficult to implement)
* clicking is much slower than typing
* possible characters from several alphabets? You know, we support the 
full set of Unicode. Displaying all unicode blocks would need the user 
to remember from which block his characters are
* One version of the problem is that you try to login from a system that 
doesn't support your characters with any font. displaying characters 
is the heavy task. If we don't want to show pictures, the user needs to 
remember the individual character codes.

 (or is there a usable all-unicode web font?)

Therefore, it is a great idea to login with your email address, which 
usually consists of latin characters. I have that problem myself, beeing 
User:✓ (a great challenge for toolserver tools ;-). Usually I have:

* My browsers autologin function which fills in the username at known wikis
* My browsers notice function which allows me to insert various texts 
with the contextmenu

* Once logged in, I have a extraeditbutton above the edit form
* or can cp the sign from the #p-personal portlet (user page, user 
disk, prefs...)
But when I try to login no at my home system, I'm challenged how to 
insert the 0x2713 char code with the keyboard. At windows Alt + num pad 
usually works, but... So I often end up googling for unicode 
checkmark, and cp the character from wikipedias List of Unicode 
characters :-(


Regards,
 Bergi

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

Re: [Wikitech-l] Secure.w.o in js on wiki sites

2012-02-17 Thread Bergi

Mark A. Hershberger schrieb:


Using Google, I found several instances refering to secure.w.o.  I can't
fix these, but maybe some of you guys can.

** https://de.wikipedia.org/wiki/MediaWiki:Common.js


The reference is used only for people that use s.w.o. But we already 
have a script in preparation to be used for everyone, normalising any 
hyperlinks to wmf projects regardless of wgServer.


 Bergi

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


Re: [Wikitech-l] [Mediawiki-l] authentication on Wikipedia via user_name OR user_email

2012-02-16 Thread Bergi

Nicolas Brouard INED schrieb:

Then, just try to enter your e-mail on a standard wiki in place of your 
username and you will be authenticated to the first ID (and user_name) having 
your e-mail.


Great Idea!


If someone could test this patch above and report the security issues as well 
as performances, it could be great for us.


No idea about PHP and performance, but a possible security hole: Are 
there any system messages that output the username when failing to 
login? If these messages would use the username from the database query 
(because of normalizing or something?) and not from $_POST, you could 
find out users' email adresses.


 Bergi

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


Re: [Wikitech-l] online labs conference on irc

2012-02-15 Thread Bergi

Yusuke Matsubara schrieb:

[IRC]


Could anyone prepare a summary and/or log of the session and publish somewhere?


Logs are usually available at 
http://bots.wmflabs.org/~petrb/logs/%23wikimedia-labs/. Great thanks to 
the guy who provides this service!


 Bergi


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


Re: [Wikitech-l] Escaping messages

2012-01-25 Thread Bergi

Tei schrieb:

People on the internet suggest something like  $(div/).text(
scriptalert('lets do evil!')/script ).html();


Please don't use that. We have mw.html.escape(), which does the task fine.

As Neil already pointed out, there are 2 concerns:
 1 - security of original message string
Not a js problem, I'd say. When there are unsafe messages, the whole 
site has a problem


 2 - security of parameters you add to messages
Just mw.html.escape them. And if someone should really need to add dom 
parameters, we may accept DOM-nodes/jQuery-objects. And we won't have to 
escape them, because when there are already malicious elements in the 
page the problem is not in mw.message.


So not taking html strings as parameters is the easiest, best and imho 
only solution.


 Bergi

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


Re: [Wikitech-l] SOPA banner implementation

2012-01-17 Thread Bergi
Is it possible to remove the banner at the 
statement/explanation/discussion pages? E.g. 
http://de.wikipedia.org/wiki/Wikipedia:Protest_gegen_SOPA looks odd with 
two banners, considering both the same thing.

  Bergi

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


Re: [Wikitech-l] Successor to wikibits.js::ts_makeSortable?

2011-12-20 Thread Bergi
Daniel Barrett schrieb:
 Now that skins/common/wikibits.js is gone, so is the function 
 ts_makeSortable. What is the equivalent call to ts_makeSortable(table) in 
 MediaWiki 1.18?

The tablesorter is available as a jQuery plugin function, see 
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/jquery/jquery.tablesorter.js?revision=105727view=markup#l738

 Here is our code we need to convert:

function makesortable( context ) {
  $('table.sortable', context)
.each(function(index, table){
  if (!$(table).find('th a span.sortarrow').length) {
ts_makeSortable(table);
  }
});
}

 This is from an extension that sorts a table by a specified column when the 
 page is rendered.

I'd propose $('table.sortable:not(.jquery-tablesorter)').tablesorter();

  Bergi


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


Re: [Wikitech-l] Help us test the VisualEditor prototype

2011-12-13 Thread Bergi
Neil Kandalgaonkar schrieb:
 Here's the demo, where you can edit some canned texts (but not actual
 Wikipedia articles, yet):

 http://www.mediawiki.org/wiki/Special:VisualEditorSandbox

 Hey MediaWiki developers, surely you're not going to let Trevor and Inez
 have *all* the fun?

Very impressive. But I've seen no handling of template/preprocessor 
syntax? I thought I had seen beginnings in that field around those 
Future/Parser pages in the wiki, but does it work?

For over a year I have ideas how to build a Javascript live 
preprocessor, but since I've studied the preprocessor code and written a 
static js preprocessor I had no time to start it off. So now I'd really 
love to help with that.

  Bergi

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


Re: [Wikitech-l] Call Graphs in MediaWiki Documentation

2011-12-09 Thread Bergi
Yuvi Panda schrieb:
 On Thu, Dec 8, 2011 at 11:26 PM, Diederik van Lieredvanli...@gmail.com  
 wrote:
 -1,
 Personally, I like them because they give me a quick overview of the
 inter-dependencies and how methods related to each other and so I guess that
 for other 'newbies' this helps in getting through the learning curve faster.
 Diederik

 It's two pages of horizontal scrolling, and understanding internal
 details helps newbies?

I agrree they give a good overview. Of course this might be an extreme 
example and the internal details of wfDebug should be filtered from that 
graphs, but when you need to know about dependencies they're a big help.
  Bergi



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


Re: [Wikitech-l] [Mediawiki-api] Getting list of possible result properties

2011-12-09 Thread Bergi
Petr Onderka schrieb:
 Hi,

 I have created a proof of concept of this, which contains the
 information only for categorymembers. The code is at [1] and it looks
 something like this (XML formatted):

 props
prop name=ids
  properties
property name=pageid type=integer /
  /properties
/prop
prop name=title
  properties
property name=ns type=namespace /
property name=title type=string /
  /properties
/prop
prop name=type
  properties
property name=type
  type
tpage/t
tsubcat/t
tfile/t
  /type
/property
  /properties
/prop
 /props

 What do you think?

 One problem I'm aware of is that the output uses “prop” and “property”
 to mean something else. Do you have any suggestions for better naming?

 After this, I will add the necessary information to the rest of the
 API modules and then post a patch to bugzilla.

 [1] 
 https://github.com/svick/mediawiki/commit/868910637445ea0dcf3ad84bc1ee9fc337f7b9c3

Nice work. Two questions:
* Is that only for retrieving properties of list elements?
* Isn't that the right place to start provinding xml/json/whatever 
schemata for api results?
  Bergi

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

Re: [Wikitech-l] High-density displays high-density images

2011-12-04 Thread Bergi
Brion Vibber schrieb:
 Some folks may be interested in my blog post about high-density displays
 and how using higher-density or vector images directly can greatly improve
 rendering and legibility of diagrams and charts:

 http://leuksman.com/log/2011/12/04/high-density-displays-mobile-and-beyond/

 If anybody's interested in fiddling around with JavaScript to swap in
 high-density PNG images and scalable SVG images...

I already have tried to build a userscript for replacing server-rendered 
pngs with the original svgs over a year ago.
Problem one were missing viewBox attributes, without which my browser 
(Opera, though its fairly good svg support) didn't show them correctly. 
I could write a workaround for my userscript, but a 
bookmarklet/gadget/whatever will fail because it can't access svg 
documents out of the same-domain-scope.
While this might have changed since then, I ran into another problem: 
Lots of svg files are optimized to be rendered on WMF server and to be 
shown as pngs. The original svg document looks quite different when 
viewed in the browser directly, often even worse. Due to varying support 
of some svg features between different browsers (and the png-generator) 
the display of svgs will differ a lot, and I can't imagine what 
unconsitent images would mean to user friendlyness.

Of course I do not want to say using native svg shouldn't be the aim, 
but the conversion won't be easy.

  Bergi

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


Re: [Wikitech-l] New methods to use when checking if a title is part of a namespace

2011-11-24 Thread Bergi
Daniel Friesen schrieb:
 testing if a title is in any of a number of
 namespaces by using in_array you can use inNamespaces (note the 's'):
 $title-inNamespace( NS_USER, NS_TEMPLATE );
  ^
Did you miss something?
  Bergi


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