Last modified: 2007-03-27 21:15:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T10421, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8421 - Add wgAction to JS variables
Add wgAction to JS variables
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-29 01:11 UTC by Danny B.
Modified: 2007-03-27 21:15 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Danny B. 2006-12-29 01:11:09 UTC
Please add wgAction to JavaScript variables rendered at the beginning of the
page with values similar to action parameter in URL + default value could be
either empty or "view".

Some scripts should be triggered only if certain action with page is being done
and it's much easier to check the variable instead of having to get it from URL.

Thanks
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-12-29 03:25:28 UTC
I don't think we want to add tons of superfluous variables.  Is it hard to do
var action =
window.location.search.match(/^action=[^&]*|&action=[^&]*/i).replace(/[^=]*=/,
""); or whatever?  I mean, it's a mouthful for sure, but it's not like the
proposed variable would be very useful.  Inclined to WONTFIX.
Comment 2 Aaron Schulz 2007-01-08 20:36:15 UTC
As a JS programmer myself I'd be inclined to WONFIX as well. The current
variables on there sometimes require nasty hacks to otherwise get, adding this
one isn't worth it as it can cleanly be retrieved otherwise.
Comment 3 Danny B. 2007-01-09 01:01:35 UTC
(In reply to comment #2)
> As a JS programmer myself I'd be inclined to WONFIX as well. The current
> variables on there sometimes require nasty hacks to otherwise get, adding this
> one isn't worth it as it can cleanly be retrieved otherwise.

Are you trying to say, that starting the entire regexp machine is better than
touch the variable?

And what does nasty hacking of _other variables_ (got an example? I'd say, if
you do nasty hacks, something is bad) have in common with adding of new simple one?
Comment 4 Brion Vibber 2007-01-09 05:00:09 UTC
Action can't be cleanly retrieved from a URL; it may be present only in POST
data for form submissions or only indirectly through knowing how $wgActionPaths
are set up on the current wiki.
Comment 5 Andrew Dunbar 2007-02-12 02:14:12 UTC
See also bug 8946.
Comment 6 Rob Church 2007-03-27 21:15:29 UTC
Added in r20754.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links