Last modified: 2014-08-17 12:56:46 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 T6801, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 4801 - Source code of user JS/CSS pages should be shown in preview as source code not wikitext.
Source code of user JS/CSS pages should be shown in preview as source code no...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal minor with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://yi.wiktionary.org/w/index.php?...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-30 21:39 UTC by lɛʁi לערי ריינהארט
Modified: 2014-08-17 12:56 UTC (History)
6 users (show)

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


Attachments

Description lɛʁi לערי ריינהארט 2006-01-30 21:39:50 UTC
Hallo!

If I click on "Preview" nothing shows up.

You may copy the content of this page and paste it at your own "monobook.js".

Please change "OS" and "Hardware" if you experience this behaviour at other
operating systems and / or hardware. Thanks in advance!

best regards reinhardt [[user:gangleri]]

The url relates to
Bug 1229: Balance diff display more evenly
Comment 1 spacebirdy 2006-01-30 21:41:32 UTC
Halló! I had the same problem.
W2K, Firefox 1.5

greetings Elisabeth Anderl
Comment 2 lɛʁi לערי ריינהארט 2006-01-30 23:01:48 UTC
*addendum* / *note*

"Show changes" fails. Please make the tests at commons:, meta, b:, n:, s:, q:,
wikt; w:.

Thanks in advance!

best regards reinhardt [[user:gangleri]]
Comment 3 lɛʁi לערי ריינהארט 2006-01-31 11:46:07 UTC
Hi Ilmari!

Could you please investigate what happens here / what happens with "Preview" and
"Show changes"?

Thanks in advance!

best regards reinhardt [[user:gangleri]]
Comment 4 Rob Church 2006-04-15 17:39:03 UTC
As far as I can remember; it's not possible for users to preview other users'
custom CSS or JavaScript sub pages; this would be a feature, not a bug.
Comment 5 Brion Vibber 2007-05-16 20:07:01 UTC
Removing bogus dependency
Comment 6 Helder 2009-09-20 02:38:01 UTC
The preview button is still doing nothing when we edit our javascript pages and click in it.

The expected behaviour is to have the code rendered above the edit box, as in any other pages.

Additionally, it should be rendered with syntax highlight, as if there was a <source lang="javascript">...</source> tag around the script code.
Comment 7 Ilmari Karonen 2009-09-20 17:06:34 UTC
The recent breakage of user JS preview on the MonoBook skin appears to be a regression caused by r53282: specifically, the function setupSkinUserJs() that's supposed to add the scripts to the page is never actually called.  As for the Vector skin, it looks like the feature was never there to begin with.  As for the other skins... I've no idea.  The whole skin system is a total mess anyway. :(

Anyway, it actually still works on my local wiki's custom skin, which I forked from MonoBook back in February 2008.  So most of the code is clearly still working, it's just the skin-specific parts that are broken.

Oh, and the "expected behaviour" suggested by Helder above is actually a feature request, or perhaps a request to _remove_ a feature.  The intended behavior when previewing user JS/CSS files is to embed the script or stylesheet on the preview page, in effect previewing its effects rather than its source code (which can be seen in the edit box anyway).  That said, it might indeed be a good idea to make it do both (or perhaps even to separate the functions, introducing a new submit button labeled something like "Test script" or "Test stylesheet").

I'd do it if I didn't have a headache already.
Comment 8 Helder 2009-09-20 18:32:54 UTC
(In reply to comment #7)
> Anyway, it actually still works on my local wiki's custom skin, which I forked
> from MonoBook back in February 2008.  So most of the code is clearly still
> working, it's just the skin-specific parts that are broken.
> 
> Oh, and the "expected behaviour" suggested by Helder above is actually a
> feature request, or perhaps a request to _remove_ a feature.  The intended
> behavior when previewing user JS/CSS files is to embed the script or stylesheet
> on the preview page, in effect previewing its effects rather than its source
> code (which can be seen in the edit box anyway).  That said, it might indeed be
> a good idea to make it do both (or perhaps even to separate the functions,
> introducing a new submit button labeled something like "Test script" or "Test
> stylesheet").
> 
> I'd do it if I didn't have a headache already.
> 

Hello!

Well, I thought it was expected both things, because many of the Common.js files currently have

<source lang="JavaScript">

at the beginning, and this is used because some time ago the code was shown above the edit box. For example, at en.wp, the code is there since 7 May 2008:
http://en.wikipedia.org/w/index.php?title=MediaWiki:Common.js&diff=prev&oldid=210884538

So, if the code is to be shown above the edit box, the feature request would be just to have the automatic highlighting, without the need of using the <source> tag... (should I open a new bug for this?)

If the code shouldn't be above the edit box, then I think the preview button should be renamed when viewing css/js pages, as suggested by Ilmari Karonen...

Helder
Comment 9 Chad H. 2009-09-22 19:02:42 UTC
Duping up, yes I know...but 20631 was marked fixed.

*** This bug has been marked as a duplicate of bug 20631 ***
Comment 10 Helder 2009-09-22 23:11:51 UTC
This is not a duplicate of the bug 20631, because that is about the "preview of the effect" of the code, and I though this one was about the "rendering of the page"... (but I can be wrong)
Comment 11 Ilmari Karonen 2009-09-23 16:42:52 UTC
It's a bit confusing, and I apologize for contributing to the confusion.  I agree with Helder above: let's have this bug be about the display of the CS/JSS _source code_ on preview (which I think would be a good idea, with or without a separate "test" button).
Comment 12 Helder 2009-10-27 20:13:53 UTC
Hey!

Does anybody knows why the preview of, for example, [[b:pt:MediaWiki:Common.js]] shows the source code above the edit box, but the same still doesn't happens with user js like [[b:pt:Special:MyPage/vector.js]]?

I think the behaviour should at least be consistent:
* Shows the code in both cases; or
* Doesn't shows the code in both cases.

In my opinion, the currently behaviour is confusing...

Helder
Comment 13 Krinkle 2011-02-14 11:59:01 UTC
(In reply to comment #11)
> It's a bit confusing, and I apologize for contributing to the confusion.  I
> agree with Helder above: let's have this bug be about the display of the CS/JSS
> _source code_ on preview (which I think would be a good idea, with or without a
> separate "test" button).

Indeed. Changing summary again and marking as fixed.

As of 1.17 previewing pages like MediaWiki:Common.js output in <pre> instead of render like Wikitext, so there's no need to start witih /* <pre> */ or /* <nowiki> */ anymore.

I can't find the exact revision this was implemented though.
It's live on the 1.17wmf1 wikis.(In reply to comment #12)

> Does anybody knows why the preview of, for example,
> [[b:pt:MediaWiki:Common.js]] shows the source code above the edit box, but the
> same still doesn't happens with user js like [[b:pt:Special:MyPage/vector.js]]?

The behavour is consistent:
* If you modify pages that are 'yours' they are executed and now shown
* If you modify other pages (ie. when you're a sysop and edit other people's vector.js or when one alters MediaWiki:Common.js) the code is not executed but shown.

If you would like to see this behaviour different, please open a seperate bug.

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


Navigation
Links