Commit graph

833 commits

Author SHA1 Message Date
Leo Koppelkamm
2dfc1bd9ed Followup to r86603 per Bug 28681 : Create public array mw.toolbar.buttons. User scripts can modify it, until it's written to the DOM on doc.ready 2011-04-26 10:08:46 +00:00
Roan Kattouw
cfb6c7ceea (bug 21180) Move the old toolbar below the summary input to match the new toolbar 2011-04-25 11:35:40 +00:00
Mark A. Hershberger
07753d2796 Remove hints since $this->isNew was not possible anywhere else. 2011-04-25 03:20:17 +00:00
Mark A. Hershberger
32f659d05f * Fixes Bug #27860 - Minor edit after clicking 'new section' tab
Patch from Jan Paul Posma of which he writes:

    This patch hides the minor edit checkbox when editing a new page or new
    section, and makes sure it cannot be enabled by injecting the form value in
    HTML.

* Add Jan Paul Posma to CREDITs re Reedy's earlier comments.
* Add note about isNew to other possible places that it can be used.
2011-04-23 18:58:03 +00:00
Happy-melon
545d854a39 Documentation and type hinting. 2011-04-23 13:55:27 +00:00
Leo Koppelkamm
92d5213ece Move edit.js stuff to mediawiki.action.edit.js, and remove wikibits dependency. Wrap publicly accessible functions inside mw.toolbar & provide legacy shortcuts to those. Make the traditional toolbar use $.fn.textSelection, to reduce code duplication. This fixes Bug 27116, Bug 15705, Bug 11011 2011-04-21 08:19:24 +00:00
Alexandre Emsenhuber
4207ab0c63 * (bug 28511) Use [] syntax instead of {} for string offset access 2011-04-17 07:59:58 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Aaron Schulz
837d39dec7 * Removed getSelectOptions, which did nothing other than send FOR UPDATE on some slave queries to barely used features
* Removed only Core use of forUpdate(); same issue
2011-04-13 00:50:44 +00:00
Happy-melon
c1e9e08e15 Follow-up r85020 per CR - use strict comparison 2011-03-30 18:06:05 +00:00
Happy-melon
f577792eb7 (bug 18937) avoid broken wikimarkup (four apostrophes together) in MediaWiki:Confirmrecreate when there is no deletion reason, by using a separate message. 2011-03-30 17:04:03 +00:00
Sam Reed
593f98ff2e More member variable documentation 2011-02-24 17:04:49 +00:00
Roan Kattouw
6cc435d68a Revert r74387: it may not fix the IE8 jumping bug in all cases, but it definitely fixes it in most cases. Reverting a partial fix for not being perfect, then never coming up with a full fix is not acceptable. 2011-02-19 19:21:52 +00:00
Mark A. Hershberger
ef74c0a178 Followup bug #27447 and r82308 and r82328 with patch supplied by
Carsten Nielsen to take care of the warning and supply some
documentation.  Also fixed up language in the comments.
2011-02-17 18:41:44 +00:00
Niklas Laxström
b1896720e1 Rv part of r82308 that causes warnings 2011-02-17 10:12:05 +00:00
Mark A. Hershberger
15bb2b2d18 (Bug #27447) Added option to toolbar-item to switch off text-selection
Carsten Nielsen explains:

    A client of mine was a bit annoyed by the editor:
    Every time he inserted - lets say - an image, the default contents of the
    image-fields "thumbs|width|caption...." were automatically marked/selected. So
    with a tip on the keyboard all "helping" text was gone. 

    I added an option to the toolbar-items to optional deactivate this behaviour.
2011-02-16 23:05:38 +00:00
Brion Vibber
67e424a292 * (bug 26298) Throw warning instead of silently saving blank page when php-suhosin removes wpTextbox1 for being 'too long' or some such
To resolve this, edit your php.ini and raise the limits in suhosin.request.max_value_length and suhosin.post.max_value_length settings to more reasonable values.

As a helper for users hit by this, I've made a tweak on trunk in rXXXXX to check for the case of a missing wpTextbox1 field (which I can confirm when installing Suhosin and setting the suhosin.request.max_value_length absurdly low). This extends the previous behavior to check for incomplete form submissions by just checking if the edittime (a late field) is present; and also I added a message to show when it forces those previews.

So now when someone hits this sort of filter, it'll force a preview. Unfortunately that'll show a big empty box, but at least you'll know it's because something went wrong, and it won't save it silently...

Adds UI message 'edit_form_incomplete' with default English value. It's fairly generic as we can't know whether the field was filtered for length, content, or what.
2011-02-14 03:10:08 +00:00
Aaron Schulz
f8a792c12c Broke long line 2011-02-13 23:20:53 +00:00
Mark A. Hershberger
b4cee86beb w/s fixups 2011-02-12 04:06:22 +00:00
Roan Kattouw
cefa6bab99 Wrap old toolbar addButton() calls in a document ready, so they're not run early and explode in debug mode 2011-02-11 09:38:38 +00:00
Alexandre Emsenhuber
1fb56df473 Added "context title" to replace $wgTitle, current behavior unchanges, but added a comment that this might change in the future to completely remove $wgTitle usage in EditPage
Also removed null check on showEditForm() since $wgTitle is set on ApiEditPage.php, so it won't catch anything
2011-02-10 17:08:37 +00:00
Platonides
57e0786ec3 More wfProfileOut()ing 2011-02-10 16:04:19 +00:00
Platonides
661444925a Close wfProfileIn()s 2011-02-10 15:53:54 +00:00
Platonides
b0f5a521ad Remove unused $wgContLang globals after refactoring at r81456 and r81456 2011-02-08 22:40:07 +00:00
Alexandre Emsenhuber
5ce1ed2b1b * Changed all calls to wfMsgWikiHtml() in core
* Now replacing parameter before parsing where possible
* Used 'parseinline' for 'nosuchuser' message in Special:Userlogin for consistency with other error messages
2011-02-06 12:38:33 +00:00
Alexandre Emsenhuber
136f4c06fa Deprecated wfMsgWeirdKey(), use wfMessage() instead. Moved getDefaultMessageText() from Article to Title so that it can be used there instead of duplicating code. No usage in extensions. 2011-02-05 15:11:52 +00:00
Alexandre Emsenhuber
a58b7f5139 * Use wfMessage() instead of wfMsgGetKey() and wfEmptyMsg()
* Factorise common code
2011-02-03 15:29:13 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Niklas Laxström
91d472a490 Kill some duplicated queries by also caching negative results in wasDeletedSinceLastEdit 2011-01-20 07:38:30 +00:00
Brian Wolff
0c0dad3cd3 (follow-up r66913) Per CR, make the editsummary length checker use jQuery/RL fanciness.
The js was tested in firefox 3.0.6, IE6, some oldish version of Opera, Konqourer, and Chrome.
(Of course in IE6, the rest of mediawiki fell on its face, but the js added here worked).
2011-01-19 03:59:11 +00:00
Brian Wolff
3b84269eb2 Make it so that editintro's included using the editintro url parameter, don't
show <noinclude> sections.

Its quite counter-intuitive that noinclude sections are included. There was a recent
discussion on the Wikinews Water cooler (village pump equivalent) about why interwikis
for such templates were being included on pages using the editintro even though the
interwiki was in a <noinclude> section.
2011-01-17 03:34:08 +00:00
Alexandre Emsenhuber
a9dc5fbc91 Modified EditPage to use Article::doEdit() instead of Article::insertNewArticle() and Article::updateArticle().
The redirect to the page is now done in EditPage::attemptSave() instead of being hidden in EditPage::internalAttemptSave(); this change should not affect anyboby, the only other call to internalAttemptSave() is in ApiEditPage.php where it's not used.
2011-01-15 15:21:36 +00:00
Daniel Friesen
a7ccb0fbb3 Fix boolean for $editnotice_base message existance check that was messed up in r80248.
Also switch to using === for '' and '-' comparison like Nikerabbit wanted.
2011-01-14 22:46:08 +00:00
Chad Horohoe
184db7405f Fix for r80248: undefined variable. 2011-01-14 13:25:14 +00:00
Daniel Friesen
5158134a6d Fix remainder of the accidental ->empty() calls I used when converting wfEmptyMsg into Message::exists() calls. 2011-01-14 11:36:37 +00:00
Siebrand Mazeland
bcb43b5a53 fix syntax terror. 2011-01-14 11:14:48 +00:00
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Niklas Laxström
3f4443ebf2 Fix syntax terror from r79884 2011-01-09 12:23:41 +00:00
Niklas Laxström
109423a6d9 * (bug 26187) Confirmrecreate no longer parses the edit summary 2011-01-09 11:30:36 +00:00
Brian Wolff
767da0cb61 Comment in code says - truncate to 250 bytes, then add ellipse. but
we don't add the ellipse, so change it to add the ellipse. The 
comment and code should be the same, and since we have the room
might as well add the ellipse.

This normally wouldn't affect much, since users with JS on
will be prevented from adding that long a summary on the
client side
2011-01-07 00:17:52 +00:00
Sam Reed
0de35fc275 Followup r75763, fixup wrong change of deprecated method
No need to do separate htmlspecialchars et al, Xml::expandAttributes
2010-12-12 18:35:19 +00:00
Platonides
3dc0ab1120 Follow up r77981,r77982. Rename the new globalcsspreview/globaljspreview to sitecsspreview/sitejspreview per CodeReview. 2010-12-11 22:44:42 +00:00
Raimond Spekking
a3e80ee9a8 follow-up r77981: Fix class: mw-js -> mw-css for the CSS section
Add comments with the full message keys to make sure grep will find them
2010-12-07 17:25:49 +00:00
Platonides
3c44865cca Show the source on preview for CSS and Javascript pages.
Add pages in MediaWiki namespace into that group (bug 10871).
Only normal <pre> formatting is being used since ShowRawCssJs 
hook directly sends things out to the output.
2010-12-07 14:53:36 +00:00
Philip Tzou
04b1ace8b0 Add a new method 'spamPageWithContent' to class EditPage. User can be allowed to view his/her diff and submitted text when hit the spam-filter. The changes to extension SpamBlacklist will be followed up soon. 2010-11-26 07:48:41 +00:00
Victor Vasiliev
bbad085453 * Show "skin does not exist error" only when the skin is inputted in the wrong case. This seems to be the original intention. Otherwise it renders the warning on the completely legitimate subpages with user scripts.
* Deprecate isValidUserCssJSSubpage() as having a very confusing title. User scripts *are* valid user JS subpages.
2010-11-25 23:12:05 +00:00
Sam Reed
6b0d4abc64 Revert r77297, Won't be reverting MimeMagic
Mainly whitespace reverts here
2010-11-25 22:22:53 +00:00
Antoine Musso
6fe29c9c30 revert r76464
* mixed style changes and variable removing
* logic changes
* useful comments removed
2010-11-25 20:01:34 +00:00