Commit graph

70 commits

Author SHA1 Message Date
Catrope b05616892d (bug 37843) Trying to edit a blank page fails
Explicitly check for false, because the empty string does not signify a
failure.

Change-Id: I8857d39e1a20080c8419c6165be2b5ad0cdbacd2
2012-10-26 14:00:43 -07:00
Trevor Parscal fb09872781 Bug 37821 - Add support for oldid
* Added oldid param to the API
* Added oldId argument to ve.init.mw.ViewPageTarget
* Added redirect when saving an oldid page (which adds a new revision)
* Added venotify param to allow notifications even when redirected
* Added creation notification
* Added page title to saved/created notification

Change-Id: I9e957e6f5bc7920093481ffe3c33e299f87ce50a
2012-08-23 12:03:40 -07:00
Catrope 20a5aa48b7 Update API for Parsoid prefix changes
The format for wiki prefixes in Parsoid has changed from /mw:Pagename to
/mw/Pagename . Update the API module and the config+docs for this
change. The default value of the prefix ('localhost') should still work
for stock localhost setups.

Change-Id: Ic6f3793d175106cc1fae17980d20add63c3f783f
2012-08-13 17:56:30 -07:00
Catrope c4dc51fbaa Pass a (configurable) interwiki prefix to Parsoid
Change-Id: Id71e52836a367e0688f6c41e2c2e4d16b1b733ad
2012-08-06 16:42:18 -07:00
Catrope 122ddd0942 Oops, we were missing a slash here
Change-Id: I14da5070dbd3286e548eded8a71660777a566a83
2012-08-06 14:19:51 -07:00
Timo Tijhof c889292adf Kranitor #004: MediaWiki-specific clean up and minor fixes
* Default value of wgVisualEditorParsoidURL is broken.
  Slash is needed, else Api will request to
  http://hostnamePageName
  Roan says double slashes are okay, and look cleaner than string
  search checks etc.

* Use .clone() for mw.Uri instead of converting to string
  and letting mw.Uri parse it, again. Clone creates a basic
  instance and copies over properties internally (deep copy,
  no references).

* No need for hasOwnProperty (and its potential issues)

* Code clean up
 - Whitespace consistency
 - Variable hosting
 - Remove redundant `return false;` statements in event handlers
   e.preventDefault() is a jQuery.Event method that takes care
   of cross-browser issues.
 - Same for e.keyCode||e.which thing, this is already normalized
   by jQuery.Event
 - Add missing parameter to setTimeout
 - Consistent order in success/error handlers in $.ajax options

Change-Id: I5bc24e0cbdf01b3704d4ccb0b45b3052e3b58694
2012-08-03 23:55:52 -07:00
Alex Monk e2460342a4 Deglobalisation
Change-Id: I7665cc13be0457ee9932f7e96b8be7eef496e49a
2012-07-21 18:37:20 +01:00
Trevor Parscal 6b34f09df2 Removed some whitespace
And added a license to some files that didn't have it yet

Change-Id: I3a7e60374d1198d369a0475b8f65f7415012a337
2012-07-19 14:25:16 -07:00
Trevor Parscal c40174b60c Changed to use MIT license per agreement with the VisualEditor team
This license change is aimed at maximizing the reusability of this code
in other projects. VisualEditor is more than just an awesome editor for
MediaWiki, it's the new editor for the entire internet.

Added license and author files, plus mentions of the license to all
VisualEditor PHP, JavaScript and CSS files. Parser files have not been
modified but are effectively re-licensed since there's no overriding
license information. 3rd party libraries are not changed, but are all
already MIT licensed.

Change-Id: I895b256325db7c8689756edab34523de4418b0f2
2012-07-19 13:25:45 -07:00
Catrope e16346385d Actually block blocked users in the Parsoid API
Change-Id: I29b938bb5c1ea00886cb2b0ab04121e4d4cd1890
2012-06-21 13:55:33 -07:00
Catrope 563db3c4ad Make the API module handle missing pages and page creations
Change-Id: I91a43888435011b62e62cf4dde744b23a4ea65d6
2012-06-18 17:42:12 -07:00
Trevor Parscal bf643ded6a Fix escaping in API module
Let Http::post() handle the escaping of equals signs and newlines in the post data

Change-Id: I5ec91a7532918c807795442aaa0bc1c1a79c5705
2012-06-11 00:32:52 -07:00
Trevor Parscal 60fc5a3c58 Using MediaWiki facility for HTTP post
Change-Id: If800c4ecbcbecc8560bfd3e704e03acac2ac71d9
2012-06-08 16:00:53 -07:00
Trevor Parscal 925695da21 Switched to using MediaWiki facility for getting data over HTTP
Change-Id: I37aa48713632f7272b98c40bc6771ee23b068414
2012-06-08 15:19:13 -07:00
Catrope 41684c704a Quick hack to make Parsoid URL configurable
Change-Id: Id314ee13f4e7cc3d0efa3f55d89165acf79109f0
2012-06-06 16:08:41 -07:00
Rob Moen 3f3b525d56 Add MakeGlobalVariablesScript hook to add new global, vePageWatched.
This allows us to check the watchlist checkbox on save dialog.
Added watchlist toggling to ve save api.
Added some i18n messages to core integration.

Change-Id: Ibed8edb2c59ad49e1738c937c3bea518238d0845
2012-06-01 16:30:17 -07:00
Rob Moen b59d49a80d Restrict edit access to VisualEditor namespace to sysops
To allow non sysops to save via VE, refactored ve save api
to use doEdit which bypasses namespace protection.
Add edit link in view nav for non sysop so that they may edit
Add View source link in dropdown for non sysops
Add Edit source link in dropdown for sysops
Cleaned up some of the integration core code
UI tweaks

Change-Id: Ib4249bc5fb7ffa6410e4f2d278aafbb871800981
2012-05-30 17:12:25 -07:00
Rob Moen 0227de8c8e Remove edit token Ajax api request, get edit token from wgUser on save
Change-Id: Idb51da271d3eca61230d9948fc82190383fc7143
2012-05-25 16:20:48 -07:00
Rob Moen 237c0fd21f Created VE parsoid API save action.
Save action
1) posts html to parsoid service in exchange for wikitext
2) saves wikitext
3) returns parsed content.
On save, VE is hidden and page content is replaced.
Demoing save in toolbar, followup commit will redesign save options

Change-Id: Ibfbe52de08e3483e1a33f0740c03f96ec2b7f90a
2012-05-25 15:27:58 -07:00
Rob Moen 61413c49eb Create base integration core module
Works on VisualEditor Namespace
Created VE api wrapper for parsoid service to roundtrip pages

Change-Id: I3f2967730c1a3ece31b7262a46bef31ea8b38613
2012-05-25 12:50:48 -07:00