[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #11 from Krinkle krinklem...@gmail.com 2011-07-08 19:40:25 UTC ---
nice catc(In reply to comment #9)
 Patch has several bugs:
Nice catches.

A few more:
* Loading of module needs to be moved out of OutputPage-headElement probably
* Should account for the situation in which there is no edit link on the page
(ie. not bind the event, because if MediaWiki decided not to output that tab,
it probably has a good reason)
* There ar differences in skins in where this link will be. This is a common
problem we are encountering more and more often lately (just look at the code
that makes mw.util.$content and addPortletLink work, it's disguisting).
Probably need to make some radical changes to skins in the future, but oh well.
This can be fixed in the long term by not allowing skins to use different IDs
for core elements or by requiring skins to log into a method how/where elements
are) – back to the present this can be solved by either:
-- exporting the edit-tab link through a config variable (alert! this is not a
config variable)
-- exporting it as a piece of information in the per-module configuration
(sounds good, except that such a thing doesn't exist yet)
-- scrapping HTML for #ca-edit a and not caring about other skins.
-- a switch-case for all skins.

The last two options will be ugly and not extendable by custom skins.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

Krinkle krinklem...@gmail.com changed:

   What|Removed |Added

   Attachment #8547|0   |1
is obsolete||

--- Comment #12 from Krinkle krinklem...@gmail.com 2011-07-08 19:43:47 UTC ---
Created attachment 8759
  -- https://bugzilla.wikimedia.org/attachment.cgi?id=8759
Follow-up patch implementing the points above

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-06 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

Krinkle krinklem...@gmail.com changed:

   What|Removed |Added

   Keywords||reviewed

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-06 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #8 from Krinkle krinklem...@gmail.com 2011-07-06 22:10:13 UTC ---
@Nik: I've reviewed your patch. It looks good.

If you're familiar with event namespaces (in particular in jQuery) it would be
nice if you could bind it to dblclick with the mw-editondblclick namespace
so that scritps can use .unbind() for that namespace only without removing all
events.

It's a bit beyond the scope of easy though, so if you don't feel like doing
that I will apply your good patch as-is and then apply an additional fix for
the namespace.

Thanks in advance,

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-06 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

Krinkle krinklem...@gmail.com changed:

   What|Removed |Added

Version|1.18|unspecified
 AssignedTo|d...@ucsc.edu   |krinklem...@gmail.com

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-06 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

Krinkle krinklem...@gmail.com changed:

   What|Removed |Added

   Keywords|easy|
 Status|NEW |ASSIGNED

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-06 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #9 from Brion Vibber br...@wikimedia.org 2011-07-06 22:31:13 UTC 
---
Patch has several bugs:
* fails to take revision ID (oldid parameter) into account, and possibly others
* hardcodes use of script  action=edit instead of using $wgActionPaths
* clutters mediawiki.util.js with rarely-used code for all users

I would recommend:
* grab the edit URL from the edit tab to avoid having to recalculate it
manually (which causes the first two bugs above)
* move from mediawiki.util.js to its own module, and only add that module when
the option is being used

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-07-06 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #10 from Brion Vibber br...@wikimedia.org 2011-07-06 22:31:58 UTC 
---
(patch also doesn't do URL escaping on the title, which can cause failures when
eg title contains a literal )

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-06-09 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #6 from The Evil IP address theevilipaddr...@hotmail.de 
2011-06-09 13:42:12 UTC ---
Nice to see the follow-ups on this bug. I've recently noted another problem
with this event listener that would be nice to fix already in this revision. We
shouldn't use an anonymous function here, as these can't be removed via
Element.removeEventListener(). Removing them would be useful for scripts like
Twinkle: Currently, double-clicking a page while using Twinkle opens the edit
mode, which is quite annoying.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-06-09 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #7 from Krinkle krinklem...@gmail.com 2011-06-09 15:07:24 UTC ---
(In reply to comment #6)
 Nice to see the follow-ups on this bug. I've recently noted another problem
 with this event listener that would be nice to fix already in this revision. 
 We
 shouldn't use an anonymous function here, as these can't be removed via
 Element.removeEventListener(). Removing them would be useful for scripts like
 Twinkle: Currently, double-clicking a page while using Twinkle opens the edit
 mode, which is quite annoying.

Remember that this is an opt-in preference. Either Twinkle users shouldn't
enable that preference or Twink should $content.unbind('dblclick') or something
like that (perhaps namespace the event)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-05-18 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

Nik nikn...@gmail.com changed:

   What|Removed |Added

   Attachment #8531|0   |1
is obsolete||

--- Comment #5 from Nik nikn...@gmail.com 2011-05-18 06:29:17 UTC ---
Created attachment 8547
  -- https://bugzilla.wikimedia.org/attachment.cgi?id=8547
patch revision

Krinkle, thanks for your suggestions. I've revised the patch, the edit URL is
now reliable since I'm building it manually instead of appending to the
existing URL.

However, this means that when double-clicking to edit, the edit URL will always
be in this format:
 - http://somewi.ki/wiki/index.php?title=Main_Pageaction=edit

Regardless of the URL format of the rest of the wiki.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-05-16 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #4 from Krinkle krinklem...@gmail.com 2011-05-16 21:21:54 UTC ---
(In reply to comment #3)
 Created attachment 8531 [details]
 proposed patch for this bug
 
 Krinkle, I used the skin-independent mw.util.$content variable like you
 suggested. I removed the php-generated 'ondblclick' attribute to body and
 made a jQuery event listener. This solution works for me.

Hi Nik,

Thanks for your patch.

Two notes though:

1) document.location was originally a read-only property, although Gecko
browsers (like Firefox) allow you to assign to it as well. For cross-browser
safety, use window.location instead. [1]


2) Appending 'action=url' to the url is not safe and prone to error. The
following three urls are all examples of how MediaWiki can be configured that
are popular and supported:

- Using rewrite rules with wgArticlePath:
-- http://somewi.ki/wiki/Article

- Using rewrite rules and wgActionPaths:
-- http://somewi.ki/view/Article

- The default:
-- http://somewi.ki/w/index.php/Article

-- Full url (almost never used, but works)
- http://somewi.ki/w/index.php?title=Article

Appending 'action' only works for the last one. I suggest using the wgScript
mw.config variable ( mw.config.get( 'wgScript' ) ), and manually building a url
with the title (wgPageName) and action (edit) parameters.

--
Krinkle


[1] https://developer.mozilla.org/en/document.location#Notes

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-05-13 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

p858snake p858sn...@gmail.com changed:

   What|Removed |Added

   Keywords||patch

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-05-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

--- Comment #3 from nikn...@gmail.com 2011-05-12 06:09:56 UTC ---
Created attachment 8531
  -- https://bugzilla.wikimedia.org/attachment.cgi?id=8531
proposed patch for this bug

Krinkle, I used the skin-independent mw.util.$content variable like you
suggested. I removed the php-generated 'ondblclick' attribute to body and
made a jQuery event listener. This solution works for me.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-03-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

Krinkle krinklem...@gmail.com changed:

   What|Removed |Added

   Keywords||easy
 CC||krinklem...@gmail.com

--- Comment #2 from Krinkle krinklem...@gmail.com 2011-03-09 00:12:22 UTC ---
The id and locatin of that tag is variable per-skin.

The mw.util class has a $content variable though which contains a jQuery object
of the content element in the current skin.

should be as simple as attaching a .dblclick() to mw.util.$content

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27894] Move edit on double-click event listener down to div#bodyContent

2011-03-06 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27894

Platonides platoni...@gmail.com changed:

   What|Removed |Added

 CC||platoni...@gmail.com

--- Comment #1 from Platonides platoni...@gmail.com 2011-03-06 14:54:27 UTC 
---
It was added directly to the body tag.

$bodyAttrs['ondblclick'] = document.location = ' . Xml::escapeJsString(
$this-getTitle()-getEditURL() ) . ';

However, div id=bodyContent is added dirrectly by the skin, it doesn't seem
a good idea to add it there. So yes, an event listener seems the way to go.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l