2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
2006-01-07 12:25:36 +00:00
|
|
|
if ( ! defined( 'MEDIAWIKI' ) )
|
2006-06-07 06:40:24 +00:00
|
|
|
die( 1 );
|
2004-08-12 06:54:58 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* @todo document
|
|
|
|
|
*/
|
2003-04-14 23:10:40 +00:00
|
|
|
class OutputPage {
|
2008-07-25 01:27:51 +00:00
|
|
|
var $mMetatags = array(), $mKeywords = array(), $mLinktags = array();
|
2008-08-10 07:14:08 +00:00
|
|
|
var $mExtStyles = array();
|
2008-07-25 01:27:51 +00:00
|
|
|
var $mPagetitle = '', $mBodytext = '', $mDebugtext = '';
|
|
|
|
|
var $mHTMLtitle = '', $mIsarticle = true, $mPrintable = false;
|
|
|
|
|
var $mSubtitle = '', $mRedirect = '', $mStatusCode;
|
|
|
|
|
var $mLastModified = '', $mETag = false;
|
|
|
|
|
var $mCategoryLinks = array(), $mLanguageLinks = array();
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
|
|
|
|
var $mScriptLoaderClassList = array();
|
2009-07-15 00:55:58 +00:00
|
|
|
// the most recent id of any script that is grouped in the script request
|
2009-08-07 00:16:54 +00:00
|
|
|
var $mLatestScriptRevID = 0;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-07-25 01:27:51 +00:00
|
|
|
var $mScripts = '', $mLinkColours, $mPageLinkTitle = '', $mHeadItems = array();
|
|
|
|
|
var $mTemplateIds = array();
|
2006-05-11 22:40:38 +00:00
|
|
|
|
2007-05-08 20:48:02 +00:00
|
|
|
var $mAllowUserJs;
|
2008-07-25 01:27:51 +00:00
|
|
|
var $mSuppressQuickbar = false;
|
|
|
|
|
var $mOnloadHandler = '';
|
|
|
|
|
var $mDoNothing = false;
|
|
|
|
|
var $mContainsOldMagic = 0, $mContainsNewMagic = 0;
|
|
|
|
|
var $mIsArticleRelated = true;
|
|
|
|
|
protected $mParserOptions = null; // lazy initialised, use parserOptions()
|
2006-05-11 22:40:38 +00:00
|
|
|
var $mShowFeedLinks = false;
|
2007-12-08 12:46:18 +00:00
|
|
|
var $mFeedLinksAppendQuery = false;
|
2006-05-11 22:40:38 +00:00
|
|
|
var $mEnableClientCache = true;
|
|
|
|
|
var $mArticleBodyOnly = false;
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-05-11 22:40:38 +00:00
|
|
|
var $mNewSectionLink = false;
|
2009-02-19 22:14:59 +00:00
|
|
|
var $mHideNewSectionLink = false;
|
2006-06-13 18:35:11 +00:00
|
|
|
var $mNoGallery = false;
|
2007-07-22 14:45:12 +00:00
|
|
|
var $mPageTitleActionText = '';
|
2007-12-10 06:02:29 +00:00
|
|
|
var $mParseWarnings = array();
|
2008-07-25 01:27:51 +00:00
|
|
|
var $mSquidMaxage = 0;
|
|
|
|
|
var $mRevisionId = null;
|
2009-04-09 02:22:36 +00:00
|
|
|
protected $mTitle = null;
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
/**
|
|
|
|
|
* An array of stylesheet filenames (relative from skins path), with options
|
|
|
|
|
* for CSS media, IE conditions, and RTL/LTR direction.
|
|
|
|
|
* For internal use; add settings in the skin via $this->addStyle()
|
|
|
|
|
*/
|
|
|
|
|
var $styles = array();
|
|
|
|
|
|
2008-07-23 19:05:43 +00:00
|
|
|
private $mIndexPolicy = 'index';
|
|
|
|
|
private $mFollowPolicy = 'follow';
|
|
|
|
|
|
2004-09-17 15:24:43 +00:00
|
|
|
/**
|
|
|
|
|
* Constructor
|
|
|
|
|
* Initialise private variables
|
|
|
|
|
*/
|
2007-01-20 13:34:31 +00:00
|
|
|
function __construct() {
|
2007-05-08 20:48:02 +00:00
|
|
|
global $wgAllowUserJs;
|
|
|
|
|
$this->mAllowUserJs = $wgAllowUserJs;
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function redirect( $url, $responsecode = '302' ) {
|
2006-06-23 03:56:03 +00:00
|
|
|
# Strip newlines as a paranoia check for header injection in PHP<5.1.2
|
|
|
|
|
$this->mRedirect = str_replace( "\n", '', $url );
|
|
|
|
|
$this->mRedirectCode = $responsecode;
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-11-06 01:16:25 +00:00
|
|
|
public function getRedirect() {
|
|
|
|
|
return $this->mRedirect;
|
|
|
|
|
}
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
/**
|
|
|
|
|
* Set the HTTP status code to send with the output.
|
|
|
|
|
*
|
|
|
|
|
* @param int $statusCode
|
|
|
|
|
* @return nothing
|
|
|
|
|
*/
|
2005-10-12 03:12:40 +00:00
|
|
|
function setStatusCode( $statusCode ) { $this->mStatusCode = $statusCode; }
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
/**
|
|
|
|
|
* Add a new <meta> tag
|
|
|
|
|
* To add an http-equiv meta tag, precede the name with "http:"
|
|
|
|
|
*
|
|
|
|
|
* @param $name tag name
|
|
|
|
|
* @param $val tag value
|
|
|
|
|
*/
|
|
|
|
|
function addMeta( $name, $val ) {
|
|
|
|
|
array_push( $this->mMetatags, array( $name, $val ) );
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-30 05:07:46 +00:00
|
|
|
function addKeyword( $text ) {
|
|
|
|
|
if( is_array( $text )) {
|
|
|
|
|
$this->mKeywords = array_merge( $this->mKeywords, $text );
|
2009-07-15 00:55:58 +00:00
|
|
|
} else {
|
2009-05-30 05:07:46 +00:00
|
|
|
array_push( $this->mKeywords, $text );
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-08-07 00:16:54 +00:00
|
|
|
function addScript( $script ) {
|
|
|
|
|
$this->mScripts .= "\t\t" . $script . "\n";
|
|
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2009-07-26 16:57:45 +00:00
|
|
|
/**
|
2009-08-07 00:16:54 +00:00
|
|
|
* Register and add a stylesheet from an extension directory.
|
2009-07-26 16:57:45 +00:00
|
|
|
* @param $url String path to sheet. Provide either a full url (beginning
|
|
|
|
|
* with 'http', etc) or a relative path from the document root
|
|
|
|
|
* (beginning with '/'). Otherwise it behaves identically to
|
|
|
|
|
* addStyle() and draws from the /skins folder.
|
|
|
|
|
*/
|
|
|
|
|
public function addExtensionStyle( $url ) {
|
2009-08-11 00:09:24 +00:00
|
|
|
array_push( $this->mExtStyles, $url );
|
2008-08-10 07:14:08 +00:00
|
|
|
}
|
2006-12-08 06:09:15 +00:00
|
|
|
|
2008-05-09 20:18:35 +00:00
|
|
|
/**
|
|
|
|
|
* Add a JavaScript file out of skins/common, or a given relative path.
|
|
|
|
|
* @param string $file filename in skins/common or complete on-server path (/foo/bar.js)
|
|
|
|
|
*/
|
|
|
|
|
function addScriptFile( $file ) {
|
2009-08-11 12:25:07 +00:00
|
|
|
global $wgStylePath, $wgScript, $wgUser;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
global $wgJSAutoloadClasses, $wgJSAutoloadLocalClasses, $wgEnableScriptLoader, $wgScriptPath;
|
|
|
|
|
|
2008-05-09 20:18:35 +00:00
|
|
|
if( substr( $file, 0, 1 ) == '/' ) {
|
|
|
|
|
$path = $file;
|
|
|
|
|
} else {
|
2009-07-15 00:55:58 +00:00
|
|
|
$path = "{$wgStylePath}/common/{$file}";
|
2008-05-09 20:18:35 +00:00
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
if( $wgEnableScriptLoader ){
|
2009-07-15 00:55:58 +00:00
|
|
|
if( strpos( $path, $wgScript ) !== false ){
|
|
|
|
|
$reqPath = str_replace( $wgScript . '?', '', $path );
|
2009-07-15 10:35:25 +00:00
|
|
|
$reqArgs = explode( '&', $reqPath );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$reqSet = array();
|
|
|
|
|
|
2009-07-15 00:55:58 +00:00
|
|
|
foreach( $reqArgs as $arg ){
|
2009-07-15 10:35:25 +00:00
|
|
|
list( $key, $var ) = explode( '=', $arg );
|
2009-07-15 00:55:58 +00:00
|
|
|
$reqSet[$key] = $var;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
|
|
|
|
|
2009-07-15 00:55:58 +00:00
|
|
|
if( isset( $reqSet['title'] ) && $reqSet != '' ) {
|
|
|
|
|
// extract any extra param (for now just skin)
|
|
|
|
|
$ext_param = ( isset( $reqSet['useskin'] ) && $reqSet['useskin'] != '' ) ? '|useskin=' . ucfirst( $reqSet['useskin'] ) : '';
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$this->mScriptLoaderClassList[] = 'WT:' . $reqSet['title'] . $ext_param ;
|
2009-07-15 00:55:58 +00:00
|
|
|
// add the title revision to the key
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$t = Title::newFromText( $reqSet['title'] );
|
2009-07-15 00:55:58 +00:00
|
|
|
// if there is no title (don't worry we just use the $wgStyleVersion var (which should be updated on relevant commits)
|
2009-07-31 10:21:02 +00:00
|
|
|
if( $t && $t->exists() ){
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
if( $t->getLatestRevID() > $this->mLatestScriptRevID )
|
|
|
|
|
$this->mLatestScriptRevID = $t->getLatestRevID();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
|
|
|
|
// check for class from path:
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$js_class = $this->getJsClassFromPath( $path );
|
|
|
|
|
if( $js_class ){
|
2009-07-15 00:55:58 +00:00
|
|
|
// add to the class list:
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$this->mScriptLoaderClassList[] = $js_class;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
|
|
|
|
// if the script loader did not find a way to add the script than add using addScript
|
2009-08-11 00:09:24 +00:00
|
|
|
$this->addScript( Html::linkedScript( wfAppendQuery( $path, $this->getURIDparam() ) ) );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
|
|
|
|
/**
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
* This is the core script that is included on every page
|
|
|
|
|
* (they are requested separately to improve caching across
|
|
|
|
|
* different page load types (edit, upload, view, etc)
|
|
|
|
|
*/
|
|
|
|
|
function addCoreScripts2Top(){
|
2009-08-11 12:25:07 +00:00
|
|
|
global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgEnableJS2system;
|
2009-07-15 00:55:58 +00:00
|
|
|
//@@todo we should deprecate wikibits in favor of mv_embed and native jQuery functions
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
|
|
|
|
if( $wgEnableJS2system ){
|
2009-07-15 00:55:58 +00:00
|
|
|
$core_classes = array( 'window.jQuery', 'mv_embed', 'wikibits' );
|
|
|
|
|
} else {
|
|
|
|
|
$core_classes = array( 'wikibits' );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
if( $wgEnableScriptLoader ){
|
|
|
|
|
$this->mScripts = $this->getScriptLoaderJs( $core_classes ) . $this->mScripts;
|
2009-07-15 00:55:58 +00:00
|
|
|
} else {
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$so = '';
|
2009-07-15 00:55:58 +00:00
|
|
|
foreach( $core_classes as $s ){
|
|
|
|
|
if( isset( $wgJSAutoloadLocalClasses[$s] ) ){
|
2009-08-11 00:09:24 +00:00
|
|
|
$so .= Html::linkedScript( "{$wgScriptPath}/{$wgJSAutoloadLocalClasses[$s]}?" . $this->getURIDparam() );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$this->mScripts = $so . $this->mScripts;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param $js_class String: name of JavaScript class
|
|
|
|
|
* @return Boolean: false if class wasn't found, true on success
|
|
|
|
|
*/
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
function addScriptClass( $js_class ){
|
2009-08-07 00:16:54 +00:00
|
|
|
global $wgDebugJavaScript, $wgJSAutoloadLocalClasses, $wgJSAutoloadClasses,
|
2009-08-11 00:09:24 +00:00
|
|
|
$wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath;
|
2009-07-15 00:55:58 +00:00
|
|
|
|
|
|
|
|
if( isset( $wgJSAutoloadClasses[$js_class] ) || isset( $wgJSAutoloadLocalClasses[$js_class] ) ){
|
|
|
|
|
if( $wgEnableScriptLoader ){
|
|
|
|
|
if( !in_array( $js_class, $this->mScriptLoaderClassList ) ){
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$this->mScriptLoaderClassList[] = $js_class;
|
|
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
} else {
|
|
|
|
|
// do a normal load of without the script-loader:
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$path = $wgScriptPath . '/';
|
2009-08-07 00:16:54 +00:00
|
|
|
if( isset( $wgJSAutoloadClasses[$js_class] ) ){
|
|
|
|
|
$path.= $wgJSAutoloadClasses[$js_class];
|
|
|
|
|
}else if( isset( $wgJSAutoloadLocalClasses[$js_class] ) ){
|
|
|
|
|
$path.= $wgJSAutoloadLocalClasses[$js_class];
|
|
|
|
|
}
|
2009-08-11 00:09:24 +00:00
|
|
|
$urlAppend = ( $wgDebugJavaScript ) ? time() : $wgStyleVersion;
|
|
|
|
|
$this->addScript( Html::linkedScript( "$path?$urlAppend" ) );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
wfDebug( __METHOD__ . ' could not find js_class: ' . $js_class );
|
|
|
|
|
return false; // could not find the class
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
/**
|
|
|
|
|
* gets the scriptLoader javascript include
|
2009-07-15 00:55:58 +00:00
|
|
|
* @param $forcClassAry Boolean: false by default
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
*/
|
2009-07-15 00:55:58 +00:00
|
|
|
function getScriptLoaderJs( $forceClassAry = false ){
|
2009-08-11 12:25:07 +00:00
|
|
|
global $wgRequest, $wgDebugJavaScript;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2009-07-15 00:55:58 +00:00
|
|
|
if( !$forceClassAry ){
|
|
|
|
|
$class_list = implode( ',', $this->mScriptLoaderClassList );
|
|
|
|
|
} else {
|
|
|
|
|
$class_list = implode( ',', $forceClassAry );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$debug_param = ( $wgDebugJavaScript ||
|
2009-07-15 00:55:58 +00:00
|
|
|
$wgRequest->getVal( 'debug' ) == 'true' ||
|
|
|
|
|
$wgRequest->getVal( 'debug' ) == '1' )
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
? '&debug=true' : '';
|
|
|
|
|
|
|
|
|
|
//@@todo intelligent unique id generation based on svn version of file (rather than just grabbing the $wgStyleVersion var)
|
|
|
|
|
//@@todo we should check the packaged message text in this javascript file for updates and update the $mScriptLoaderURID id (in getJsClassFromPath)
|
|
|
|
|
|
|
|
|
|
//generate the unique request param (combine with the most recent revision id of any wiki page with the $wgStyleVersion var)
|
|
|
|
|
|
2009-08-11 00:09:24 +00:00
|
|
|
return Html::linkedScript( wfScript( 'mwScriptLoader' ) . "?class={$class_list}{$debug_param}&" . $this->getURIDparam() );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
function getURIDparam(){
|
2009-07-15 00:55:58 +00:00
|
|
|
global $wgDebugJavaScript, $wgStyleVersion;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
if( $wgDebugJavaScript ){
|
2009-07-15 00:55:58 +00:00
|
|
|
return 'urid=' . time();
|
|
|
|
|
} else {
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
return "urid={$wgStyleVersion}_{$this->mLatestScriptRevID}";
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
function getJsClassFromPath( $path ){
|
|
|
|
|
global $wgJSAutoloadClasses, $wgJSAutoloadLocalClasses, $wgScriptPath;
|
|
|
|
|
|
|
|
|
|
$scriptLoaderPaths = array_merge( $wgJSAutoloadClasses, $wgJSAutoloadLocalClasses );
|
|
|
|
|
foreach( $scriptLoaderPaths as $js_class => $js_path ){
|
|
|
|
|
$js_path = "{$wgScriptPath}/{$js_path}";
|
2009-07-15 00:55:58 +00:00
|
|
|
if( $path == $js_path )
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
return $js_class;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2008-05-09 20:18:35 +00:00
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
2006-12-08 06:09:15 +00:00
|
|
|
/**
|
|
|
|
|
* Add a self-contained script tag with the given contents
|
|
|
|
|
* @param string $script JavaScript text, no <script> tags
|
|
|
|
|
*/
|
|
|
|
|
function addInlineScript( $script ) {
|
2009-08-11 00:09:24 +00:00
|
|
|
$this->mScripts .= "\t\t" . Html::inlineScript( "\n\t\t$script\n\t\t" ) . "\n";
|
2006-12-08 06:09:15 +00:00
|
|
|
}
|
|
|
|
|
|
2008-04-14 07:45:50 +00:00
|
|
|
function getScript() {
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
global $wgEnableScriptLoader;
|
|
|
|
|
if( $wgEnableScriptLoader ){
|
2009-07-15 00:55:58 +00:00
|
|
|
//include $this->mScripts (for anything that we could not package into the scriptloader
|
|
|
|
|
return $this->mScripts . "\n" . $this->getScriptLoaderJs() . $this->getHeadItems();
|
|
|
|
|
} else {
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
return $this->mScripts . $this->getHeadItems();
|
|
|
|
|
}
|
2007-04-03 21:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getHeadItems() {
|
|
|
|
|
$s = '';
|
|
|
|
|
foreach ( $this->mHeadItems as $item ) {
|
|
|
|
|
$s .= $item;
|
|
|
|
|
}
|
|
|
|
|
return $s;
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-29 10:15:05 +00:00
|
|
|
function addHeadItem( $name, $value ) {
|
|
|
|
|
$this->mHeadItems[$name] = $value;
|
|
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
function hasHeadItem( $name ) {
|
|
|
|
|
return isset( $this->mHeadItems[$name] );
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-01 00:03:31 +00:00
|
|
|
function setETag($tag) { $this->mETag = $tag; }
|
2005-07-03 04:00:33 +00:00
|
|
|
function setArticleBodyOnly($only) { $this->mArticleBodyOnly = $only; }
|
2005-07-03 04:56:53 +00:00
|
|
|
function getArticleBodyOnly($only) { return $this->mArticleBodyOnly; }
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2004-04-10 11:19:33 +00:00
|
|
|
function addLink( $linkarr ) {
|
|
|
|
|
# $linkarr should be an associative array of attributes. We'll escape on output.
|
|
|
|
|
array_push( $this->mLinktags, $linkarr );
|
|
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-08-10 07:14:08 +00:00
|
|
|
# Get all links added by extensions
|
|
|
|
|
function getExtStyle() {
|
|
|
|
|
return $this->mExtStyles;
|
|
|
|
|
}
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-04-10 11:19:33 +00:00
|
|
|
function addMetadataLink( $linkarr ) {
|
|
|
|
|
# note: buggy CC software only reads first "meta" link
|
2004-04-04 22:33:11 +00:00
|
|
|
static $haveMeta = false;
|
2004-08-22 17:24:50 +00:00
|
|
|
$linkarr['rel'] = ($haveMeta) ? 'alternate meta' : 'meta';
|
2004-04-10 11:19:33 +00:00
|
|
|
$this->addLink( $linkarr );
|
2004-04-04 22:33:11 +00:00
|
|
|
$haveMeta = true;
|
|
|
|
|
}
|
2004-04-04 21:58:05 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* checkLastModified tells the client to use the client-cached page if
|
|
|
|
|
* possible. If sucessful, the OutputPage is disabled so that
|
2006-11-07 05:37:31 +00:00
|
|
|
* any future call to OutputPage->output() have no effect.
|
|
|
|
|
*
|
2008-08-29 08:40:13 +00:00
|
|
|
* Side effect: sets mLastModified for Last-Modified header
|
|
|
|
|
*
|
2006-11-07 05:37:31 +00:00
|
|
|
* @return bool True iff cache-ok headers was sent.
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2009-03-13 20:15:16 +00:00
|
|
|
function checkLastModified( $timestamp ) {
|
2006-08-14 18:18:35 +00:00
|
|
|
global $wgCachePages, $wgCacheEpoch, $wgUser, $wgRequest;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2005-03-20 03:59:06 +00:00
|
|
|
if ( !$timestamp || $timestamp == '19700101000000' ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": CACHE DISABLED, NO TIMESTAMP\n" );
|
2008-08-29 08:40:13 +00:00
|
|
|
return false;
|
2005-03-20 03:59:06 +00:00
|
|
|
}
|
2003-07-10 04:55:41 +00:00
|
|
|
if( !$wgCachePages ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": CACHE DISABLED\n", false );
|
2008-08-29 08:40:13 +00:00
|
|
|
return false;
|
2003-07-10 04:55:41 +00:00
|
|
|
}
|
2004-08-22 17:24:50 +00:00
|
|
|
if( $wgUser->getOption( 'nocache' ) ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": USER DISABLED CACHE\n", false );
|
2008-08-29 08:40:13 +00:00
|
|
|
return false;
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2004-03-20 15:03:26 +00:00
|
|
|
|
2008-08-29 08:40:13 +00:00
|
|
|
$timestamp = wfTimestamp( TS_MW, $timestamp );
|
|
|
|
|
$modifiedTimes = array(
|
|
|
|
|
'page' => $timestamp,
|
|
|
|
|
'user' => $wgUser->getTouched(),
|
|
|
|
|
'epoch' => $wgCacheEpoch
|
|
|
|
|
);
|
|
|
|
|
wfRunHooks( 'OutputPageCheckLastModified', array( &$modifiedTimes ) );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-08-29 08:40:13 +00:00
|
|
|
$maxModified = max( $modifiedTimes );
|
|
|
|
|
$this->mLastModified = wfTimestamp( TS_RFC2822, $maxModified );
|
|
|
|
|
|
|
|
|
|
if( empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": client did not send If-Modified-Since header\n", false );
|
2008-08-29 08:40:13 +00:00
|
|
|
return false;
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2008-08-29 08:40:13 +00:00
|
|
|
|
|
|
|
|
# Make debug info
|
|
|
|
|
$info = '';
|
2008-12-23 19:39:00 +00:00
|
|
|
foreach ( $modifiedTimes as $name => $value ) {
|
|
|
|
|
if ( $info !== '' ) {
|
2008-08-29 08:40:13 +00:00
|
|
|
$info .= ', ';
|
|
|
|
|
}
|
|
|
|
|
$info .= "$name=" . wfTimestamp( TS_ISO_8601, $value );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# IE sends sizes after the date like this:
|
|
|
|
|
# Wed, 20 Aug 2003 06:51:19 GMT; length=5202
|
|
|
|
|
# this breaks strtotime().
|
|
|
|
|
$clientHeader = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
|
|
|
|
|
|
2008-12-23 19:39:00 +00:00
|
|
|
wfSuppressWarnings(); // E_STRICT system time bitching
|
|
|
|
|
$clientHeaderTime = strtotime( $clientHeader );
|
|
|
|
|
wfRestoreWarnings();
|
|
|
|
|
if ( !$clientHeaderTime ) {
|
2008-08-29 08:40:13 +00:00
|
|
|
wfDebug( __METHOD__ . ": unable to parse the client's If-Modified-Since header: $clientHeader\n" );
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$clientHeaderTime = wfTimestamp( TS_MW, $clientHeaderTime );
|
|
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
wfDebug( __METHOD__ . ": client sent If-Modified-Since: " .
|
2008-08-29 08:40:13 +00:00
|
|
|
wfTimestamp( TS_ISO_8601, $clientHeaderTime ) . "\n", false );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
wfDebug( __METHOD__ . ": effective Last-Modified: " .
|
2008-08-29 08:40:13 +00:00
|
|
|
wfTimestamp( TS_ISO_8601, $maxModified ) . "\n", false );
|
|
|
|
|
if( $clientHeaderTime < $maxModified ) {
|
|
|
|
|
wfDebug( __METHOD__ . ": STALE, $info\n", false );
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-23 19:39:00 +00:00
|
|
|
# Not modified
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
# Give a 304 response code and disable body output
|
2008-12-23 19:39:00 +00:00
|
|
|
wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", false );
|
2009-03-18 21:26:57 +00:00
|
|
|
ini_set('zlib.output_compression', 0);
|
2008-08-29 08:40:13 +00:00
|
|
|
$wgRequest->response()->header( "HTTP/1.1 304 Not Modified" );
|
|
|
|
|
$this->sendCacheControl();
|
|
|
|
|
$this->disable();
|
|
|
|
|
|
|
|
|
|
// Don't output a compressed blob when using ob_gzhandler;
|
|
|
|
|
// it's technically against HTTP spec and seems to confuse
|
|
|
|
|
// Firefox when the response gets split over two packets.
|
|
|
|
|
wfClearOutputBuffers();
|
|
|
|
|
|
|
|
|
|
return true;
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2007-07-22 14:45:12 +00:00
|
|
|
function setPageTitleActionText( $text ) {
|
|
|
|
|
$this->mPageTitleActionText = $text;
|
|
|
|
|
}
|
|
|
|
|
|
2004-04-25 00:32:24 +00:00
|
|
|
function getPageTitleActionText () {
|
2007-07-22 14:45:12 +00:00
|
|
|
if ( isset( $this->mPageTitleActionText ) ) {
|
|
|
|
|
return $this->mPageTitleActionText;
|
2004-04-25 00:32:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-09-17 15:24:43 +00:00
|
|
|
|
2008-07-23 19:05:43 +00:00
|
|
|
/**
|
|
|
|
|
* Set the robot policy for the page: <http://www.robotstxt.org/meta.html>
|
|
|
|
|
*
|
|
|
|
|
* @param $policy string The literal string to output as the contents of
|
|
|
|
|
* the meta tag. Will be parsed according to the spec and output in
|
|
|
|
|
* standardized form.
|
|
|
|
|
* @return null
|
|
|
|
|
*/
|
|
|
|
|
public function setRobotPolicy( $policy ) {
|
|
|
|
|
$policy = explode( ',', $policy );
|
|
|
|
|
$policy = array_map( 'trim', $policy );
|
|
|
|
|
|
|
|
|
|
# The default policy is follow, so if nothing is said explicitly, we
|
|
|
|
|
# do that.
|
|
|
|
|
if( in_array( 'nofollow', $policy ) ) {
|
|
|
|
|
$this->mFollowPolicy = 'nofollow';
|
|
|
|
|
} else {
|
|
|
|
|
$this->mFollowPolicy = 'follow';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( in_array( 'noindex', $policy ) ) {
|
|
|
|
|
$this->mIndexPolicy = 'noindex';
|
|
|
|
|
} else {
|
|
|
|
|
$this->mIndexPolicy = 'index';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the index policy for the page, but leave the follow policy un-
|
|
|
|
|
* touched.
|
|
|
|
|
*
|
|
|
|
|
* @param $policy string Either 'index' or 'noindex'.
|
|
|
|
|
* @return null
|
|
|
|
|
*/
|
|
|
|
|
public function setIndexPolicy( $policy ) {
|
|
|
|
|
$policy = trim( $policy );
|
|
|
|
|
if( in_array( $policy, array( 'index', 'noindex' ) ) ) {
|
|
|
|
|
$this->mIndexPolicy = $policy;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the follow policy for the page, but leave the index policy un-
|
|
|
|
|
* touched.
|
|
|
|
|
*
|
|
|
|
|
* @param $policy string Either 'follow' or 'nofollow'.
|
|
|
|
|
* @return null
|
|
|
|
|
*/
|
|
|
|
|
public function setFollowPolicy( $policy ) {
|
|
|
|
|
$policy = trim( $policy );
|
|
|
|
|
if( in_array( $policy, array( 'follow', 'nofollow' ) ) ) {
|
|
|
|
|
$this->mFollowPolicy = $policy;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-09 05:15:43 +00:00
|
|
|
/**
|
|
|
|
|
* "HTML title" means the contents of <title>. It is stored as plain, unescaped text and will be run through htmlspecialchars in the skin file.
|
|
|
|
|
*/
|
|
|
|
|
public function setHTMLTitle( $name ) {
|
|
|
|
|
$this->mHTMLtitle = $name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* "Page title" means the contents of <h1>. It is stored as a valid HTML fragment.
|
|
|
|
|
* This function allows good tags like <sup> in the <h1> tag, but not bad tags like <script>.
|
|
|
|
|
* This function automatically sets <title> to the same content as <h1> but with all tags removed.
|
|
|
|
|
* Bad tags that were escaped in <h1> will still be escaped in <title>, and good tags like <i> will be dropped entirely.
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setPageTitle( $name ) {
|
2009-02-04 19:43:30 +00:00
|
|
|
global $wgContLang;
|
|
|
|
|
$name = $wgContLang->convert( $name, true );
|
2009-04-09 05:15:43 +00:00
|
|
|
# change "<script>foo&bar</script>" to "<script>foo&bar</script>"
|
|
|
|
|
# but leave "<i>foobar</i>" alone
|
|
|
|
|
$nameWithTags = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $name ) );
|
|
|
|
|
$this->mPagetitle = $nameWithTags;
|
2009-02-04 19:43:30 +00:00
|
|
|
|
|
|
|
|
$taction = $this->getPageTitleActionText();
|
|
|
|
|
if( !empty( $taction ) ) {
|
|
|
|
|
$name .= ' - '.$taction;
|
2004-04-25 00:32:24 +00:00
|
|
|
}
|
2008-12-31 16:49:38 +00:00
|
|
|
|
2009-04-09 05:15:43 +00:00
|
|
|
# change "<i>foo&bar</i>" to "foo&bar"
|
|
|
|
|
$this->setHTMLTitle( wfMsg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) ) );
|
2004-04-25 00:32:24 +00:00
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2009-04-09 02:22:36 +00:00
|
|
|
public function setTitle( $t ) {
|
|
|
|
|
$this->mTitle = $t;
|
|
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2009-04-09 02:22:36 +00:00
|
|
|
public function getTitle() {
|
|
|
|
|
if ( $this->mTitle instanceof Title ) {
|
|
|
|
|
return $this->mTitle;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
wfDebug( __METHOD__ . ' called and $mTitle is null. Return $wgTitle for sanity' );
|
|
|
|
|
global $wgTitle;
|
|
|
|
|
return $wgTitle;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-02-04 19:43:30 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function getHTMLTitle() { return $this->mHTMLtitle; }
|
|
|
|
|
public function getPageTitle() { return $this->mPagetitle; }
|
|
|
|
|
public function setSubtitle( $str ) { $this->mSubtitle = /*$this->parse(*/$str/*)*/; } // @bug 2514
|
2008-05-03 03:52:33 +00:00
|
|
|
public function appendSubtitle( $str ) { $this->mSubtitle .= /*$this->parse(*/$str/*)*/; } // @bug 2514
|
2006-11-07 05:37:31 +00:00
|
|
|
public function getSubtitle() { return $this->mSubtitle; }
|
|
|
|
|
public function isArticle() { return $this->mIsarticle; }
|
|
|
|
|
public function setPrintable() { $this->mPrintable = true; }
|
|
|
|
|
public function isPrintable() { return $this->mPrintable; }
|
|
|
|
|
public function setSyndicated( $show = true ) { $this->mShowFeedLinks = $show; }
|
|
|
|
|
public function isSyndicated() { return $this->mShowFeedLinks; }
|
2007-12-08 12:46:18 +00:00
|
|
|
public function setFeedAppendQuery( $val ) { $this->mFeedLinksAppendQuery = $val; }
|
|
|
|
|
public function getFeedAppendQuery() { return $this->mFeedLinksAppendQuery; }
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setOnloadHandler( $js ) { $this->mOnloadHandler = $js; }
|
|
|
|
|
public function getOnloadHandler() { return $this->mOnloadHandler; }
|
|
|
|
|
public function disable() { $this->mDoNothing = true; }
|
2009-03-13 20:15:16 +00:00
|
|
|
public function isDisabled() { return $this->mDoNothing; }
|
2006-11-07 05:37:31 +00:00
|
|
|
|
|
|
|
|
public function setArticleRelated( $v ) {
|
2004-01-17 09:49:43 +00:00
|
|
|
$this->mIsArticleRelated = $v;
|
|
|
|
|
if ( !$v ) {
|
|
|
|
|
$this->mIsarticle = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setArticleFlag( $v ) {
|
2004-07-08 14:53:54 +00:00
|
|
|
$this->mIsarticle = $v;
|
2004-01-17 09:49:43 +00:00
|
|
|
if ( $v ) {
|
|
|
|
|
$this->mIsArticleRelated = $v;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function isArticleRelated() { return $this->mIsArticleRelated; }
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function getLanguageLinks() { return $this->mLanguageLinks; }
|
|
|
|
|
public function addLanguageLinks($newLinkArray) {
|
2004-06-01 18:29:31 +00:00
|
|
|
$this->mLanguageLinks += $newLinkArray;
|
|
|
|
|
}
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setLanguageLinks($newLinkArray) {
|
2004-06-01 18:29:31 +00:00
|
|
|
$this->mLanguageLinks = $newLinkArray;
|
|
|
|
|
}
|
2004-09-17 15:24:43 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function getCategoryLinks() {
|
2004-06-19 06:46:54 +00:00
|
|
|
return $this->mCategoryLinks;
|
2004-07-08 14:53:54 +00:00
|
|
|
}
|
2005-12-30 09:33:11 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add an array of categories, with names in the keys
|
|
|
|
|
*/
|
2008-02-20 08:53:12 +00:00
|
|
|
public function addCategoryLinks( $categories ) {
|
2008-02-25 16:38:25 +00:00
|
|
|
global $wgUser, $wgContLang;
|
2005-12-30 09:33:11 +00:00
|
|
|
|
2008-02-25 16:38:25 +00:00
|
|
|
if ( !is_array( $categories ) || count( $categories ) == 0 ) {
|
2008-02-20 08:53:12 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2008-02-25 16:38:25 +00:00
|
|
|
|
2008-02-20 08:53:12 +00:00
|
|
|
# Add the links to a LinkBatch
|
2005-12-30 09:33:11 +00:00
|
|
|
$arr = array( NS_CATEGORY => $categories );
|
|
|
|
|
$lb = new LinkBatch;
|
|
|
|
|
$lb->setArray( $arr );
|
|
|
|
|
|
2008-02-20 08:53:12 +00:00
|
|
|
# Fetch existence plus the hiddencat property
|
|
|
|
|
$dbr = wfGetDB( DB_SLAVE );
|
|
|
|
|
$pageTable = $dbr->tableName( 'page' );
|
|
|
|
|
$where = $lb->constructSet( 'page', $dbr );
|
2008-02-25 16:38:25 +00:00
|
|
|
$propsTable = $dbr->tableName( 'page_props' );
|
2008-04-09 13:02:34 +00:00
|
|
|
$sql = "SELECT page_id, page_namespace, page_title, page_len, page_is_redirect, pp_value
|
|
|
|
|
FROM $pageTable LEFT JOIN $propsTable ON pp_propname='hiddencat' AND pp_page=page_id WHERE $where";
|
2008-02-20 08:53:12 +00:00
|
|
|
$res = $dbr->query( $sql, __METHOD__ );
|
|
|
|
|
|
|
|
|
|
# Add the results to the link cache
|
|
|
|
|
$lb->addResultToCache( LinkCache::singleton(), $res );
|
|
|
|
|
|
2008-02-25 16:38:25 +00:00
|
|
|
# Set all the values to 'normal'. This can be done with array_fill_keys in PHP 5.2.0+
|
|
|
|
|
$categories = array_combine( array_keys( $categories ),
|
|
|
|
|
array_fill( 0, count( $categories ), 'normal' ) );
|
|
|
|
|
|
|
|
|
|
# Mark hidden categories
|
2008-02-20 08:53:12 +00:00
|
|
|
foreach ( $res as $row ) {
|
2008-02-25 16:38:25 +00:00
|
|
|
if ( isset( $row->pp_value ) ) {
|
|
|
|
|
$categories[$row->page_title] = 'hidden';
|
2008-02-20 08:53:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
2008-02-25 16:38:25 +00:00
|
|
|
|
2008-02-20 08:53:12 +00:00
|
|
|
# Add the remaining categories to the skin
|
2008-07-02 20:02:51 +00:00
|
|
|
if ( wfRunHooks( 'OutputPageMakeCategoryLinks', array( &$this, $categories, &$this->mCategoryLinks ) ) ) {
|
|
|
|
|
$sk = $wgUser->getSkin();
|
|
|
|
|
foreach ( $categories as $category => $type ) {
|
2009-02-02 07:54:43 +00:00
|
|
|
$origcategory = $category;
|
2008-07-02 20:02:51 +00:00
|
|
|
$title = Title::makeTitleSafe( NS_CATEGORY, $category );
|
2009-02-02 07:54:43 +00:00
|
|
|
$wgContLang->findVariantLink( $category, $title, true );
|
|
|
|
|
if ( $category != $origcategory )
|
|
|
|
|
if ( array_key_exists( $category, $categories ) )
|
|
|
|
|
continue;
|
2008-07-02 20:02:51 +00:00
|
|
|
$text = $wgContLang->convertHtml( $title->getText() );
|
2009-05-08 23:24:31 +00:00
|
|
|
$this->mCategoryLinks[$type][] = $sk->link( $title, $text );
|
2008-07-02 20:02:51 +00:00
|
|
|
}
|
2005-12-30 09:33:11 +00:00
|
|
|
}
|
2004-06-19 06:46:54 +00:00
|
|
|
}
|
2005-12-30 09:33:11 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setCategoryLinks($categories) {
|
2005-12-30 09:33:11 +00:00
|
|
|
$this->mCategoryLinks = array();
|
|
|
|
|
$this->addCategoryLinks($categories);
|
2004-06-19 06:46:54 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function suppressQuickbar() { $this->mSuppressQuickbar = true; }
|
|
|
|
|
public function isQuickbarSuppressed() { return $this->mSuppressQuickbar; }
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2007-05-08 20:48:02 +00:00
|
|
|
public function disallowUserJs() { $this->mAllowUserJs = false; }
|
|
|
|
|
public function isUserJsAllowed() { return $this->mAllowUserJs; }
|
|
|
|
|
|
2008-08-11 14:20:37 +00:00
|
|
|
public function prependHTML( $text ) { $this->mBodytext = $text . $this->mBodytext; }
|
2006-11-07 05:37:31 +00:00
|
|
|
public function addHTML( $text ) { $this->mBodytext .= $text; }
|
|
|
|
|
public function clearHTML() { $this->mBodytext = ''; }
|
|
|
|
|
public function getHTML() { return $this->mBodytext; }
|
|
|
|
|
public function debug( $text ) { $this->mDebugtext .= $text; }
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2005-12-21 02:38:54 +00:00
|
|
|
/* @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setParserOptions( $options ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2006-07-26 07:15:39 +00:00
|
|
|
return $this->parserOptions( $options );
|
2005-12-21 02:38:54 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function parserOptions( $options = null ) {
|
2006-07-26 07:15:39 +00:00
|
|
|
if ( !$this->mParserOptions ) {
|
|
|
|
|
$this->mParserOptions = new ParserOptions;
|
|
|
|
|
}
|
2004-02-29 08:43:29 +00:00
|
|
|
return wfSetVar( $this->mParserOptions, $options );
|
|
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2005-11-27 06:04:41 +00:00
|
|
|
/**
|
|
|
|
|
* Set the revision ID which will be seen by the wiki text parser
|
|
|
|
|
* for things such as embedded {{REVISIONID}} variable use.
|
|
|
|
|
* @param mixed $revid an integer, or NULL
|
|
|
|
|
* @return mixed previous value
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setRevisionId( $revid ) {
|
2005-11-27 06:04:41 +00:00
|
|
|
$val = is_null( $revid ) ? null : intval( $revid );
|
|
|
|
|
return wfSetVar( $this->mRevisionId, $val );
|
|
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-08-11 13:23:45 +00:00
|
|
|
public function getRevisionId() {
|
|
|
|
|
return $this->mRevisionId;
|
|
|
|
|
}
|
2004-02-29 08:43:29 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* Convert wikitext to HTML and add it to the buffer
|
2005-05-21 17:26:42 +00:00
|
|
|
* Default assumes that the current page title will
|
|
|
|
|
* be used.
|
2006-11-07 05:37:31 +00:00
|
|
|
*
|
|
|
|
|
* @param string $text
|
|
|
|
|
* @param bool $linestart
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function addWikiText( $text, $linestart = true ) {
|
2009-04-09 08:53:15 +00:00
|
|
|
$title = $this->getTitle(); // Work arround E_STRICT
|
|
|
|
|
$this->addWikiTextTitle( $text, $title, $linestart );
|
2005-05-21 17:26:42 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function addWikiTextWithTitle($text, &$title, $linestart = true) {
|
2005-05-21 17:41:30 +00:00
|
|
|
$this->addWikiTextTitle($text, $title, $linestart);
|
2005-05-21 17:26:42 +00:00
|
|
|
}
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2007-01-10 23:32:38 +00:00
|
|
|
function addWikiTextTitleTidy($text, &$title, $linestart = true) {
|
2007-01-14 17:37:29 +00:00
|
|
|
$this->addWikiTextTitle( $text, $title, $linestart, true );
|
2007-01-10 23:32:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function addWikiTextTitle($text, &$title, $linestart, $tidy = false) {
|
2005-12-04 18:27:59 +00:00
|
|
|
global $wgParser;
|
2007-01-10 23:32:38 +00:00
|
|
|
|
2008-04-16 13:46:16 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2007-01-10 23:32:38 +00:00
|
|
|
|
2008-04-16 13:46:16 +00:00
|
|
|
wfIncrStats( 'pcache_not_possible' );
|
2007-01-10 23:32:38 +00:00
|
|
|
|
|
|
|
|
$popts = $this->parserOptions();
|
2008-04-16 13:46:16 +00:00
|
|
|
$oldTidy = $popts->setTidy( $tidy );
|
2007-01-10 23:32:38 +00:00
|
|
|
|
|
|
|
|
$parserOutput = $wgParser->parse( $text, $title, $popts,
|
2005-11-27 06:04:41 +00:00
|
|
|
$linestart, true, $this->mRevisionId );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-09-11 18:22:37 +00:00
|
|
|
$popts->setTidy( $oldTidy );
|
2007-01-10 23:32:38 +00:00
|
|
|
|
2006-01-01 20:08:08 +00:00
|
|
|
$this->addParserOutput( $parserOutput );
|
2007-01-10 23:32:38 +00:00
|
|
|
|
2008-04-16 13:46:16 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2006-01-01 20:08:08 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
/**
|
|
|
|
|
* @todo document
|
|
|
|
|
* @param ParserOutput object &$parserOutput
|
|
|
|
|
*/
|
|
|
|
|
public function addParserOutputNoText( &$parserOutput ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgExemptFromUserRobotsControl, $wgContentNamespaces;
|
2008-07-24 17:40:16 +00:00
|
|
|
|
2004-08-21 14:56:07 +00:00
|
|
|
$this->mLanguageLinks += $parserOutput->getLanguageLinks();
|
2005-12-30 09:33:11 +00:00
|
|
|
$this->addCategoryLinks( $parserOutput->getCategories() );
|
2006-05-01 20:35:08 +00:00
|
|
|
$this->mNewSectionLink = $parserOutput->getNewSection();
|
2009-02-19 22:14:59 +00:00
|
|
|
$this->mHideNewSectionLink = $parserOutput->getHideNewSection();
|
2008-07-24 18:02:20 +00:00
|
|
|
|
|
|
|
|
if( is_null( $wgExemptFromUserRobotsControl ) ) {
|
|
|
|
|
$bannedNamespaces = $wgContentNamespaces;
|
|
|
|
|
} else {
|
|
|
|
|
$bannedNamespaces = $wgExemptFromUserRobotsControl;
|
|
|
|
|
}
|
2009-04-09 02:22:36 +00:00
|
|
|
if( !in_array( $this->getTitle()->getNamespace(), $bannedNamespaces ) ) {
|
2008-07-24 18:02:20 +00:00
|
|
|
# FIXME (bug 14900): This overrides $wgArticleRobotPolicies, and it
|
|
|
|
|
# shouldn't
|
2008-07-24 17:40:16 +00:00
|
|
|
$this->setIndexPolicy( $parserOutput->getIndexPolicy() );
|
|
|
|
|
}
|
2008-07-24 18:02:20 +00:00
|
|
|
|
2007-12-10 06:02:29 +00:00
|
|
|
$this->mParseWarnings = $parserOutput->getWarnings();
|
2005-05-28 11:09:22 +00:00
|
|
|
if ( $parserOutput->getCacheTime() == -1 ) {
|
|
|
|
|
$this->enableClientCache( false );
|
|
|
|
|
}
|
2006-08-24 17:05:52 +00:00
|
|
|
$this->mNoGallery = $parserOutput->getNoGallery();
|
2007-04-06 19:21:35 +00:00
|
|
|
$this->mHeadItems = array_merge( $this->mHeadItems, (array)$parserOutput->mHeadItems );
|
2007-05-31 16:01:26 +00:00
|
|
|
// Versioning...
|
2008-11-01 23:20:25 +00:00
|
|
|
foreach ( (array)$parserOutput->mTemplateIds as $ns => $dbks ) {
|
|
|
|
|
if ( isset( $this->mTemplateIds[$ns] ) ) {
|
|
|
|
|
$this->mTemplateIds[$ns] = $dbks + $this->mTemplateIds[$ns];
|
|
|
|
|
} else {
|
|
|
|
|
$this->mTemplateIds[$ns] = $dbks;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-01-10 19:41:11 +00:00
|
|
|
// Page title
|
2008-12-31 16:49:38 +00:00
|
|
|
if( ( $dt = $parserOutput->getDisplayTitle() ) !== false )
|
|
|
|
|
$this->setPageTitle( $dt );
|
2009-01-10 19:41:11 +00:00
|
|
|
else if ( ( $title = $parserOutput->getTitleText() ) != '' )
|
|
|
|
|
$this->setPageTitle( $title );
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
|
2008-02-20 08:53:12 +00:00
|
|
|
// Hooks registered in the object
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
global $wgParserOutputHooks;
|
|
|
|
|
foreach ( $parserOutput->getOutputHooks() as $hookInfo ) {
|
|
|
|
|
list( $hookName, $data ) = $hookInfo;
|
|
|
|
|
if ( isset( $wgParserOutputHooks[$hookName] ) ) {
|
|
|
|
|
call_user_func( $wgParserOutputHooks[$hookName], $this, $parserOutput, $data );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-08-24 17:05:52 +00:00
|
|
|
wfRunHooks( 'OutputPageParserOutput', array( &$this, $parserOutput ) );
|
2006-01-01 20:08:08 +00:00
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
/**
|
|
|
|
|
* @todo document
|
|
|
|
|
* @param ParserOutput &$parserOutput
|
|
|
|
|
*/
|
2006-01-01 20:08:08 +00:00
|
|
|
function addParserOutput( &$parserOutput ) {
|
|
|
|
|
$this->addParserOutputNoText( $parserOutput );
|
2006-08-24 17:05:52 +00:00
|
|
|
$text = $parserOutput->getText();
|
|
|
|
|
wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) );
|
|
|
|
|
$this->addHTML( $text );
|
2005-07-01 00:03:31 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* Add wikitext to the buffer, assuming that this is the primary text for a page view
|
2006-11-07 05:37:31 +00:00
|
|
|
* Saves the text into the parser cache if possible.
|
|
|
|
|
*
|
|
|
|
|
* @param string $text
|
|
|
|
|
* @param Article $article
|
|
|
|
|
* @param bool $cache
|
2007-01-10 23:32:38 +00:00
|
|
|
* @deprecated Use Article::outputWikitext
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function addPrimaryWikiText( $text, $article, $cache = true ) {
|
2009-04-09 08:53:15 +00:00
|
|
|
global $wgParser;
|
2004-08-21 14:56:07 +00:00
|
|
|
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
|
|
|
|
|
2006-07-26 07:15:39 +00:00
|
|
|
$popts = $this->parserOptions();
|
|
|
|
|
$popts->setTidy(true);
|
2005-12-30 09:33:11 +00:00
|
|
|
$parserOutput = $wgParser->parse( $text, $article->mTitle,
|
2006-07-26 07:15:39 +00:00
|
|
|
$popts, true, true, $this->mRevisionId );
|
|
|
|
|
$popts->setTidy(false);
|
2006-01-14 23:56:01 +00:00
|
|
|
if ( $cache && $article && $parserOutput->getCacheTime() != -1 ) {
|
2008-04-09 18:23:34 +00:00
|
|
|
$parserCache = ParserCache::singleton();
|
2009-03-18 23:27:48 +00:00
|
|
|
$parserCache->save( $parserOutput, $article, $popts);
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2006-08-24 17:05:52 +00:00
|
|
|
$this->addParserOutput( $parserOutput );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2004-09-17 15:24:43 +00:00
|
|
|
|
2006-01-23 18:37:46 +00:00
|
|
|
/**
|
2007-01-14 17:37:29 +00:00
|
|
|
* @deprecated use addWikiTextTidy()
|
2006-01-23 18:37:46 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function addSecondaryWikiText( $text, $linestart = true ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2009-04-09 02:22:36 +00:00
|
|
|
$this->addWikiTextTitleTidy($text, $this->getTitle(), $linestart);
|
2007-01-14 17:37:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add wikitext with tidy enabled
|
|
|
|
|
*/
|
|
|
|
|
public function addWikiTextTidy( $text, $linestart = true ) {
|
2009-04-09 18:54:15 +00:00
|
|
|
$title = $this->getTitle();
|
2009-04-09 18:51:45 +00:00
|
|
|
$this->addWikiTextTitleTidy($text, $title, $linestart);
|
2006-01-23 18:37:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-25 06:04:16 +00:00
|
|
|
/**
|
|
|
|
|
* Add the output of a QuickTemplate to the output buffer
|
2006-11-07 05:37:31 +00:00
|
|
|
*
|
2004-11-25 06:04:16 +00:00
|
|
|
* @param QuickTemplate $template
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function addTemplate( &$template ) {
|
2004-11-25 06:04:16 +00:00
|
|
|
ob_start();
|
|
|
|
|
$template->execute();
|
2005-12-30 09:33:11 +00:00
|
|
|
$this->addHTML( ob_get_contents() );
|
2004-11-25 06:04:16 +00:00
|
|
|
ob_end_clean();
|
|
|
|
|
}
|
2004-11-29 11:26:24 +00:00
|
|
|
|
|
|
|
|
/**
|
2006-04-29 13:15:19 +00:00
|
|
|
* Parse wikitext and return the HTML.
|
2006-11-07 05:37:31 +00:00
|
|
|
*
|
|
|
|
|
* @param string $text
|
|
|
|
|
* @param bool $linestart Is this the start of a line?
|
|
|
|
|
* @param bool $interface ??
|
2004-11-29 11:26:24 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function parse( $text, $linestart = true, $interface = false ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgParser;
|
|
|
|
|
if( is_null( $this->getTitle() ) ) {
|
|
|
|
|
throw new MWException( 'Empty $mTitle in ' . __METHOD__ );
|
2008-11-24 01:58:15 +00:00
|
|
|
}
|
2006-07-26 07:15:39 +00:00
|
|
|
$popts = $this->parserOptions();
|
|
|
|
|
if ( $interface) { $popts->setInterfaceMessage(true); }
|
2009-04-09 02:22:36 +00:00
|
|
|
$parserOutput = $wgParser->parse( $text, $this->getTitle(), $popts,
|
2005-12-01 08:24:49 +00:00
|
|
|
$linestart, true, $this->mRevisionId );
|
2006-07-26 07:15:39 +00:00
|
|
|
if ( $interface) { $popts->setInterfaceMessage(false); }
|
2004-11-29 11:26:24 +00:00
|
|
|
return $parserOutput->getText();
|
|
|
|
|
}
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2009-01-31 01:59:13 +00:00
|
|
|
/** Parse wikitext, strip paragraphs, and return the HTML. */
|
|
|
|
|
public function parseInline( $text, $linestart = true, $interface = false ) {
|
|
|
|
|
$parsed = $this->parse( $text, $linestart, $interface );
|
|
|
|
|
|
|
|
|
|
$m = array();
|
|
|
|
|
if ( preg_match( '/^<p>(.*)\n?<\/p>\n?/sU', $parsed, $m ) ) {
|
|
|
|
|
$parsed = $m[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $parsed;
|
|
|
|
|
}
|
|
|
|
|
|
2004-09-17 15:24:43 +00:00
|
|
|
/**
|
2006-11-07 05:37:31 +00:00
|
|
|
* @param Article $article
|
|
|
|
|
* @param User $user
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
*
|
Implemented the PoolCounter feature and did some general refactoring in the areas that it touched.
* Renamed Article::outputFromWikitext() to Article::getOutputFromWikitext()
* Factored out cascade protection updates
* Removed recently-added Article::tryParserCache(): misnamed, can be done in one line of code in the caller. Deprecated OutputPage::tryParserCache().
* Made some functions public instead of protected when they could be useful from hooks.
* In ParserCache, removed PHP 4-style ampersands
In Article::view():
* Factored out robot policy logic, "redirected from" header, patrol footer, diff page, revdelete header, CSS/JS formatting, footer, namespace header, missing article error
* Removed some variables, renamed some others, fixed incorrect use of empty()
* Used the refactored footer section to do a couple of early returns and unindent a massive if(!$outputDone) block
* Removed fantasy interpretation of $this->getContent()===false in comment
* Don't try the parser cache when ArticleViewHeader specified $outputDone=true
* Move timing hack to getOutputFromWikitext()
* Stop using $wgOut->parserOptions() with save/restore nonsense every time you want to change something in it. This is meant to be OOP.
* Don't overwrite the article text with an error message and then pretend to write it to the cache, that's confusing
2009-07-08 08:12:35 +00:00
|
|
|
* @deprecated
|
2005-04-15 18:37:39 +00:00
|
|
|
*
|
2006-11-07 05:37:31 +00:00
|
|
|
* @return bool True if successful, else false.
|
2004-09-17 15:24:43 +00:00
|
|
|
*/
|
2009-03-18 23:27:48 +00:00
|
|
|
public function tryParserCache( &$article ) {
|
Implemented the PoolCounter feature and did some general refactoring in the areas that it touched.
* Renamed Article::outputFromWikitext() to Article::getOutputFromWikitext()
* Factored out cascade protection updates
* Removed recently-added Article::tryParserCache(): misnamed, can be done in one line of code in the caller. Deprecated OutputPage::tryParserCache().
* Made some functions public instead of protected when they could be useful from hooks.
* In ParserCache, removed PHP 4-style ampersands
In Article::view():
* Factored out robot policy logic, "redirected from" header, patrol footer, diff page, revdelete header, CSS/JS formatting, footer, namespace header, missing article error
* Removed some variables, renamed some others, fixed incorrect use of empty()
* Used the refactored footer section to do a couple of early returns and unindent a massive if(!$outputDone) block
* Removed fantasy interpretation of $this->getContent()===false in comment
* Don't try the parser cache when ArticleViewHeader specified $outputDone=true
* Move timing hack to getOutputFromWikitext()
* Stop using $wgOut->parserOptions() with save/restore nonsense every time you want to change something in it. This is meant to be OOP.
* Don't overwrite the article text with an error message and then pretend to write it to the cache, that's confusing
2009-07-08 08:12:35 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
|
|
|
|
$parserOutput = ParserCache::singleton()->get( $article, $article->getParserOptions() );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2009-06-23 21:52:39 +00:00
|
|
|
if ($parserOutput !== false) {
|
2006-08-24 17:05:52 +00:00
|
|
|
$this->addParserOutput( $parserOutput );
|
2004-06-04 10:40:44 +00:00
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2006-11-07 05:37:31 +00:00
|
|
|
* @param int $maxage Maximum cache time on the Squid, in seconds.
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function setSquidMaxage( $maxage ) {
|
2004-03-13 13:42:17 +00:00
|
|
|
$this->mSquidMaxage = $maxage;
|
2004-02-08 21:12:07 +00:00
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* Use enableClientCache(false) to force it to send nocache headers
|
2006-11-07 05:37:31 +00:00
|
|
|
* @param $state ??
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function enableClientCache( $state ) {
|
2004-03-23 10:19:31 +00:00
|
|
|
return wfSetVar( $this->mEnableClientCache, $state );
|
|
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2008-02-20 04:13:24 +00:00
|
|
|
function getCacheVaryCookies() {
|
2008-04-10 08:42:36 +00:00
|
|
|
global $wgCookiePrefix, $wgCacheVaryCookies;
|
|
|
|
|
static $cookies;
|
|
|
|
|
if ( $cookies === null ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
$cookies = array_merge(
|
2008-04-10 08:42:36 +00:00
|
|
|
array(
|
|
|
|
|
"{$wgCookiePrefix}Token",
|
|
|
|
|
"{$wgCookiePrefix}LoggedOut",
|
|
|
|
|
session_name()
|
|
|
|
|
),
|
|
|
|
|
$wgCacheVaryCookies
|
|
|
|
|
);
|
|
|
|
|
wfRunHooks('GetCacheVaryCookies', array( $this, &$cookies ) );
|
|
|
|
|
}
|
|
|
|
|
return $cookies;
|
2008-02-20 04:13:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function uncacheableBecauseRequestVars() {
|
2005-07-24 06:55:45 +00:00
|
|
|
global $wgRequest;
|
|
|
|
|
return $wgRequest->getText('useskin', false) === false
|
|
|
|
|
&& $wgRequest->getText('uselang', false) === false;
|
|
|
|
|
}
|
|
|
|
|
|
2008-02-20 04:13:24 +00:00
|
|
|
/**
|
|
|
|
|
* Check if the request has a cache-varying cookie header
|
|
|
|
|
* If it does, it's very important that we don't allow public caching
|
|
|
|
|
*/
|
|
|
|
|
function haveCacheVaryCookies() {
|
2008-11-18 21:37:11 +00:00
|
|
|
global $wgRequest;
|
2008-02-20 04:13:24 +00:00
|
|
|
$cookieHeader = $wgRequest->getHeader( 'cookie' );
|
|
|
|
|
if ( $cookieHeader === false ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$cvCookies = $this->getCacheVaryCookies();
|
|
|
|
|
foreach ( $cvCookies as $cookieName ) {
|
|
|
|
|
# Check for a simple string match, like the way squid does it
|
|
|
|
|
if ( strpos( $cookieHeader, $cookieName ) ) {
|
|
|
|
|
wfDebug( __METHOD__.": found $cookieName\n" );
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
wfDebug( __METHOD__.": no cache-varying cookies found\n" );
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2008-02-08 07:12:38 +00:00
|
|
|
/** Get a complete X-Vary-Options header */
|
|
|
|
|
public function getXVO() {
|
2008-02-20 04:13:24 +00:00
|
|
|
$cvCookies = $this->getCacheVaryCookies();
|
|
|
|
|
$xvo = 'X-Vary-Options: Accept-Encoding;list-contains=gzip,Cookie;';
|
2008-02-22 07:42:07 +00:00
|
|
|
$first = true;
|
2008-02-20 04:13:24 +00:00
|
|
|
foreach ( $cvCookies as $cookieName ) {
|
2008-02-22 07:42:07 +00:00
|
|
|
if ( $first ) {
|
|
|
|
|
$first = false;
|
|
|
|
|
} else {
|
|
|
|
|
$xvo .= ';';
|
|
|
|
|
}
|
2008-02-20 04:13:24 +00:00
|
|
|
$xvo .= 'string-contains=' . $cookieName;
|
|
|
|
|
}
|
|
|
|
|
return $xvo;
|
2008-02-08 07:12:38 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function sendCacheControl() {
|
2009-07-24 20:01:23 +00:00
|
|
|
global $wgUseSquid, $wgUseESI, $wgUseETag, $wgSquidMaxage, $wgRequest, $wgUseXVO;
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2008-02-08 07:12:38 +00:00
|
|
|
$response = $wgRequest->response();
|
2008-12-23 19:39:00 +00:00
|
|
|
if ($wgUseETag && $this->mETag)
|
2008-02-08 07:12:38 +00:00
|
|
|
$response->header("ETag: $this->mETag");
|
2008-12-23 19:39:00 +00:00
|
|
|
|
|
|
|
|
# don't serve compressed data to clients who can't handle it
|
2005-03-08 02:58:43 +00:00
|
|
|
# maintain different caches for logged-in users and non-logged in ones
|
2008-02-08 07:12:38 +00:00
|
|
|
$response->header( 'Vary: Accept-Encoding, Cookie' );
|
|
|
|
|
|
2009-07-24 20:01:23 +00:00
|
|
|
if ( $wgUseXVO ) {
|
|
|
|
|
# Add an X-Vary-Options header for Squid with Wikimedia patches
|
|
|
|
|
$response->header( $this->getXVO() );
|
|
|
|
|
}
|
2008-02-08 07:12:38 +00:00
|
|
|
|
2008-02-20 04:13:24 +00:00
|
|
|
if( !$this->uncacheableBecauseRequestVars() && $this->mEnableClientCache ) {
|
2008-12-23 19:39:00 +00:00
|
|
|
if( $wgUseSquid && session_id() == '' &&
|
|
|
|
|
! $this->isPrintable() && $this->mSquidMaxage != 0 && !$this->haveCacheVaryCookies() )
|
2004-02-04 00:45:48 +00:00
|
|
|
{
|
2008-12-23 19:39:00 +00:00
|
|
|
if ( $wgUseESI ) {
|
2004-02-02 01:40:03 +00:00
|
|
|
# We'll purge the proxy cache explicitly, but require end user agents
|
2004-01-31 12:45:09 +00:00
|
|
|
# to revalidate against the proxy on each visit.
|
|
|
|
|
# Surrogate-Control controls our Squid, Cache-Control downstream caches
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": proxy caching with ESI; {$this->mLastModified} **\n", false );
|
2004-01-31 12:45:09 +00:00
|
|
|
# start with a shorter timeout for initial testing
|
|
|
|
|
# header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
|
2008-02-08 07:12:38 +00:00
|
|
|
$response->header( 'Surrogate-Control: max-age='.$wgSquidMaxage.'+'.$this->mSquidMaxage.', content="ESI/1.0"');
|
|
|
|
|
$response->header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
|
2004-01-31 12:45:09 +00:00
|
|
|
} else {
|
|
|
|
|
# We'll purge the proxy cache for anons explicitly, but require end user agents
|
|
|
|
|
# to revalidate against the proxy on each visit.
|
2004-07-08 14:53:54 +00:00
|
|
|
# IMPORTANT! The Squid needs to replace the Cache-Control header with
|
2004-01-31 12:45:09 +00:00
|
|
|
# Cache-Control: s-maxage=0, must-revalidate, max-age=0
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": local proxy caching; {$this->mLastModified} **\n", false );
|
2004-01-31 12:45:09 +00:00
|
|
|
# start with a shorter timeout for initial testing
|
|
|
|
|
# header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
|
2008-02-08 07:12:38 +00:00
|
|
|
$response->header( 'Cache-Control: s-maxage='.$this->mSquidMaxage.', must-revalidate, max-age=0' );
|
2004-01-31 12:45:09 +00:00
|
|
|
}
|
2004-01-31 10:29:31 +00:00
|
|
|
} else {
|
|
|
|
|
# We do want clients to cache if they can, but they *must* check for updates
|
|
|
|
|
# on revisiting the page.
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": private caching; {$this->mLastModified} **\n", false );
|
2008-02-08 07:12:38 +00:00
|
|
|
$response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
|
|
|
|
|
$response->header( "Cache-Control: private, must-revalidate, max-age=0" );
|
2004-01-31 10:29:31 +00:00
|
|
|
}
|
2008-12-23 19:39:00 +00:00
|
|
|
if($this->mLastModified) {
|
2008-08-29 08:40:13 +00:00
|
|
|
$response->header( "Last-Modified: {$this->mLastModified}" );
|
|
|
|
|
}
|
2003-07-03 10:18:07 +00:00
|
|
|
} else {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDebug( __METHOD__ . ": no caching **\n", false );
|
2004-03-23 10:19:31 +00:00
|
|
|
|
|
|
|
|
# In general, the absence of a last modified header should be enough to prevent
|
|
|
|
|
# the client from using its cache. We send a few other things just to make sure.
|
2008-02-08 07:12:38 +00:00
|
|
|
$response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
|
|
|
|
|
$response->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
|
|
|
|
|
$response->header( 'Pragma: no-cache' );
|
2003-07-03 10:18:07 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* Finally, all the text has been munged and accumulated into
|
|
|
|
|
* the object, let's actually output it:
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function output() {
|
2006-08-14 18:18:35 +00:00
|
|
|
global $wgUser, $wgOutputEncoding, $wgRequest;
|
2006-03-28 05:15:10 +00:00
|
|
|
global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType;
|
2009-08-11 00:09:24 +00:00
|
|
|
global $wgUseAjax, $wgAjaxWatch;
|
2008-10-10 01:15:11 +00:00
|
|
|
global $wgEnableMWSuggest, $wgUniversalEditButton;
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgArticle;
|
2004-10-08 04:27:07 +00:00
|
|
|
|
2008-12-31 17:56:04 +00:00
|
|
|
if( $this->mDoNothing ){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2008-04-16 13:46:16 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2004-08-22 17:24:50 +00:00
|
|
|
if ( '' != $this->mRedirect ) {
|
2008-02-13 05:59:14 +00:00
|
|
|
# Standards require redirect URLs to be absolute
|
|
|
|
|
$this->mRedirect = wfExpandUrl( $this->mRedirect );
|
2004-03-05 03:18:31 +00:00
|
|
|
if( $this->mRedirectCode == '301') {
|
|
|
|
|
if( !$wgDebugRedirects ) {
|
2006-08-14 18:18:35 +00:00
|
|
|
$wgRequest->response()->header("HTTP/1.1 {$this->mRedirectCode} Moved Permanently");
|
2004-03-05 03:18:31 +00:00
|
|
|
}
|
2004-12-19 11:11:52 +00:00
|
|
|
$this->mLastModified = wfTimestamp( TS_RFC2822 );
|
2004-03-01 22:16:39 +00:00
|
|
|
}
|
|
|
|
|
$this->sendCacheControl();
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2007-02-21 01:02:47 +00:00
|
|
|
$wgRequest->response()->header("Content-Type: text/html; charset=utf-8");
|
2004-03-05 03:18:31 +00:00
|
|
|
if( $wgDebugRedirects ) {
|
|
|
|
|
$url = htmlspecialchars( $this->mRedirect );
|
|
|
|
|
print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n";
|
|
|
|
|
print "<p>Location: <a href=\"$url\">$url</a></p>\n";
|
|
|
|
|
print "</body>\n</html>\n";
|
|
|
|
|
} else {
|
2006-08-14 18:18:35 +00:00
|
|
|
$wgRequest->response()->header( 'Location: '.$this->mRedirect );
|
2004-03-05 03:18:31 +00:00
|
|
|
}
|
2008-04-16 13:46:16 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2003-04-14 23:10:40 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2005-10-12 03:12:40 +00:00
|
|
|
elseif ( $this->mStatusCode )
|
|
|
|
|
{
|
|
|
|
|
$statusMessage = array(
|
|
|
|
|
100 => 'Continue',
|
|
|
|
|
101 => 'Switching Protocols',
|
|
|
|
|
102 => 'Processing',
|
|
|
|
|
200 => 'OK',
|
|
|
|
|
201 => 'Created',
|
|
|
|
|
202 => 'Accepted',
|
|
|
|
|
203 => 'Non-Authoritative Information',
|
|
|
|
|
204 => 'No Content',
|
|
|
|
|
205 => 'Reset Content',
|
|
|
|
|
206 => 'Partial Content',
|
|
|
|
|
207 => 'Multi-Status',
|
|
|
|
|
300 => 'Multiple Choices',
|
|
|
|
|
301 => 'Moved Permanently',
|
|
|
|
|
302 => 'Found',
|
|
|
|
|
303 => 'See Other',
|
|
|
|
|
304 => 'Not Modified',
|
|
|
|
|
305 => 'Use Proxy',
|
|
|
|
|
307 => 'Temporary Redirect',
|
|
|
|
|
400 => 'Bad Request',
|
|
|
|
|
401 => 'Unauthorized',
|
|
|
|
|
402 => 'Payment Required',
|
|
|
|
|
403 => 'Forbidden',
|
|
|
|
|
404 => 'Not Found',
|
|
|
|
|
405 => 'Method Not Allowed',
|
|
|
|
|
406 => 'Not Acceptable',
|
|
|
|
|
407 => 'Proxy Authentication Required',
|
|
|
|
|
408 => 'Request Timeout',
|
|
|
|
|
409 => 'Conflict',
|
|
|
|
|
410 => 'Gone',
|
|
|
|
|
411 => 'Length Required',
|
|
|
|
|
412 => 'Precondition Failed',
|
|
|
|
|
413 => 'Request Entity Too Large',
|
|
|
|
|
414 => 'Request-URI Too Large',
|
|
|
|
|
415 => 'Unsupported Media Type',
|
|
|
|
|
416 => 'Request Range Not Satisfiable',
|
|
|
|
|
417 => 'Expectation Failed',
|
|
|
|
|
422 => 'Unprocessable Entity',
|
|
|
|
|
423 => 'Locked',
|
|
|
|
|
424 => 'Failed Dependency',
|
|
|
|
|
500 => 'Internal Server Error',
|
|
|
|
|
501 => 'Not Implemented',
|
|
|
|
|
502 => 'Bad Gateway',
|
|
|
|
|
503 => 'Service Unavailable',
|
|
|
|
|
504 => 'Gateway Timeout',
|
|
|
|
|
505 => 'HTTP Version Not Supported',
|
|
|
|
|
507 => 'Insufficient Storage'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if ( $statusMessage[$this->mStatusCode] )
|
2006-08-14 18:18:35 +00:00
|
|
|
$wgRequest->response()->header( 'HTTP/1.1 ' . $this->mStatusCode . ' ' . $statusMessage[$this->mStatusCode] );
|
2005-10-12 03:12:40 +00:00
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2008-01-14 10:23:48 +00:00
|
|
|
$sk = $wgUser->getSkin();
|
|
|
|
|
|
2009-07-15 00:55:58 +00:00
|
|
|
// add our core scripts to output
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$this->addCoreScripts2Top();
|
|
|
|
|
|
2008-01-14 10:23:48 +00:00
|
|
|
if ( $wgUseAjax ) {
|
2008-05-09 20:18:35 +00:00
|
|
|
$this->addScriptFile( 'ajax.js' );
|
2008-01-14 10:23:48 +00:00
|
|
|
|
|
|
|
|
wfRunHooks( 'AjaxAddScript', array( &$this ) );
|
|
|
|
|
|
|
|
|
|
if( $wgAjaxWatch && $wgUser->isLoggedIn() ) {
|
2008-05-09 20:18:35 +00:00
|
|
|
$this->addScriptFile( 'ajaxwatch.js' );
|
2008-01-14 10:23:48 +00:00
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-04-15 23:06:28 +00:00
|
|
|
if ( $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false ) ){
|
2008-05-09 20:18:35 +00:00
|
|
|
$this->addScriptFile( 'mwsuggest.js' );
|
2008-04-15 23:06:28 +00:00
|
|
|
}
|
2008-01-14 10:23:48 +00:00
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-05-12 23:37:51 +00:00
|
|
|
if( $wgUser->getBoolOption( 'editsectiononrightclick' ) ) {
|
|
|
|
|
$this->addScriptFile( 'rightclickedit.js' );
|
|
|
|
|
}
|
2008-01-14 10:23:48 +00:00
|
|
|
|
2008-10-10 01:15:11 +00:00
|
|
|
if( $wgUniversalEditButton ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
if( isset( $wgArticle ) && $this->getTitle() && $this->getTitle()->quickUserCan( 'edit' )
|
|
|
|
|
&& ( $this->getTitle()->exists() || $this->getTitle()->quickUserCan( 'create' ) ) ) {
|
2008-10-22 18:07:15 +00:00
|
|
|
// Original UniversalEditButton
|
2008-10-10 01:15:11 +00:00
|
|
|
$this->addLink( array(
|
|
|
|
|
'rel' => 'alternate',
|
|
|
|
|
'type' => 'application/x-wiki',
|
|
|
|
|
'title' => wfMsg( 'edit' ),
|
2009-04-09 02:22:36 +00:00
|
|
|
'href' => $this->getTitle()->getLocalURL( 'action=edit' )
|
2008-10-10 01:15:11 +00:00
|
|
|
) );
|
2008-10-22 18:07:15 +00:00
|
|
|
// Alternate edit link
|
|
|
|
|
$this->addLink( array(
|
|
|
|
|
'rel' => 'edit',
|
|
|
|
|
'title' => wfMsg( 'edit' ),
|
2009-04-09 02:22:36 +00:00
|
|
|
'href' => $this->getTitle()->getLocalURL( 'action=edit' )
|
2008-10-22 18:07:15 +00:00
|
|
|
) );
|
2008-10-10 01:15:11 +00:00
|
|
|
}
|
|
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2004-11-12 09:34:11 +00:00
|
|
|
# Buffer output; final headers may depend on later processing
|
2008-09-15 01:27:22 +00:00
|
|
|
ob_start();
|
2004-11-12 09:34:11 +00:00
|
|
|
|
2006-08-14 18:18:35 +00:00
|
|
|
$wgRequest->response()->header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
|
|
|
|
|
$wgRequest->response()->header( 'Content-language: '.$wgContLanguageCode );
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2005-07-03 04:00:33 +00:00
|
|
|
if ($this->mArticleBodyOnly) {
|
|
|
|
|
$this->out($this->mBodytext);
|
|
|
|
|
} else {
|
2008-04-06 20:25:45 +00:00
|
|
|
// Hook that allows last minute changes to the output page, e.g.
|
|
|
|
|
// adding of CSS or Javascript by extensions.
|
2008-04-07 17:53:31 +00:00
|
|
|
wfRunHooks( 'BeforePageDisplay', array( &$this, &$sk ) );
|
2008-04-06 20:25:45 +00:00
|
|
|
|
2005-07-03 04:00:33 +00:00
|
|
|
wfProfileIn( 'Output-skin' );
|
|
|
|
|
$sk->outputPage( $this );
|
|
|
|
|
wfProfileOut( 'Output-skin' );
|
|
|
|
|
}
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2004-11-12 09:34:11 +00:00
|
|
|
$this->sendCacheControl();
|
|
|
|
|
ob_end_flush();
|
2008-04-16 13:46:16 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
/**
|
2009-04-07 18:21:07 +00:00
|
|
|
* Actually output something with print(). Performs an iconv to the
|
|
|
|
|
* output encoding, if needed.
|
|
|
|
|
* @param string $ins The string to output
|
2006-11-07 05:37:31 +00:00
|
|
|
*/
|
|
|
|
|
public function out( $ins ) {
|
2004-09-24 13:14:52 +00:00
|
|
|
global $wgInputEncoding, $wgOutputEncoding, $wgContLang;
|
2003-04-14 23:10:40 +00:00
|
|
|
if ( 0 == strcmp( $wgInputEncoding, $wgOutputEncoding ) ) {
|
|
|
|
|
$outs = $ins;
|
|
|
|
|
} else {
|
2004-09-24 13:14:52 +00:00
|
|
|
$outs = $wgContLang->iconv( $wgInputEncoding, $wgOutputEncoding, $ins );
|
2003-04-14 23:10:40 +00:00
|
|
|
if ( false === $outs ) { $outs = $ins; }
|
|
|
|
|
}
|
|
|
|
|
print $outs;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
/**
|
|
|
|
|
* @todo document
|
|
|
|
|
*/
|
2006-11-29 05:45:03 +00:00
|
|
|
public static function setEncodings() {
|
2003-11-18 02:39:38 +00:00
|
|
|
global $wgInputEncoding, $wgOutputEncoding;
|
2009-04-09 08:53:15 +00:00
|
|
|
global $wgContLang;
|
2003-04-14 23:10:40 +00:00
|
|
|
|
|
|
|
|
$wgInputEncoding = strtolower( $wgInputEncoding );
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2003-11-15 23:06:59 +00:00
|
|
|
if ( empty( $_SERVER['HTTP_ACCEPT_CHARSET'] ) ) {
|
2003-04-14 23:10:40 +00:00
|
|
|
$wgOutputEncoding = strtolower( $wgOutputEncoding );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$wgOutputEncoding = $wgInputEncoding;
|
|
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2006-11-07 05:37:31 +00:00
|
|
|
* Deprecated, use wfReportTime() instead.
|
2005-04-04 19:31:58 +00:00
|
|
|
* @return string
|
2005-09-24 13:37:26 +00:00
|
|
|
* @deprecated
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function reportTime() {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2005-09-24 13:37:26 +00:00
|
|
|
$time = wfReportTime();
|
|
|
|
|
return $time;
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2006-01-06 23:09:37 +00:00
|
|
|
/**
|
2006-11-07 05:37:31 +00:00
|
|
|
* Produce a "user is blocked" page.
|
|
|
|
|
*
|
|
|
|
|
* @param bool $return Whether to have a "return to $wgTitle" message or not.
|
|
|
|
|
* @return nothing
|
2006-01-06 23:09:37 +00:00
|
|
|
*/
|
2006-06-24 20:58:10 +00:00
|
|
|
function blockedPage( $return = true ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgUser, $wgContLang, $wgLang;
|
2006-01-06 23:09:37 +00:00
|
|
|
|
|
|
|
|
$this->setPageTitle( wfMsg( 'blockedtitle' ) );
|
2008-07-23 19:05:43 +00:00
|
|
|
$this->setRobotPolicy( 'noindex,nofollow' );
|
2006-01-06 23:09:37 +00:00
|
|
|
$this->setArticleRelated( false );
|
|
|
|
|
|
2007-08-01 20:11:29 +00:00
|
|
|
$name = User::whoIs( $wgUser->blockedBy() );
|
2006-01-06 23:09:37 +00:00
|
|
|
$reason = $wgUser->blockedFor();
|
2007-11-15 14:42:20 +00:00
|
|
|
if( $reason == '' ) {
|
|
|
|
|
$reason = wfMsg( 'blockednoreason' );
|
|
|
|
|
}
|
2007-07-31 13:59:29 +00:00
|
|
|
$blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $wgUser->mBlock->mTimestamp ), true );
|
2006-06-01 08:19:02 +00:00
|
|
|
$ip = wfGetIP();
|
2006-01-06 23:09:37 +00:00
|
|
|
|
|
|
|
|
$link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]";
|
|
|
|
|
|
2006-12-13 05:44:46 +00:00
|
|
|
$blockid = $wgUser->mBlock->mId;
|
|
|
|
|
|
2007-05-03 15:40:38 +00:00
|
|
|
$blockExpiry = $wgUser->mBlock->mExpiry;
|
|
|
|
|
if ( $blockExpiry == 'infinity' ) {
|
2007-05-04 05:46:44 +00:00
|
|
|
// Entry in database (table ipblocks) is 'infinity' but 'ipboptions' uses 'infinite' or 'indefinite'
|
2007-05-03 15:40:38 +00:00
|
|
|
// Search for localization in 'ipboptions'
|
|
|
|
|
$scBlockExpiryOptions = wfMsg( 'ipboptions' );
|
|
|
|
|
foreach ( explode( ',', $scBlockExpiryOptions ) as $option ) {
|
|
|
|
|
if ( strpos( $option, ":" ) === false )
|
|
|
|
|
continue;
|
|
|
|
|
list( $show, $value ) = explode( ":", $option );
|
2007-05-04 05:46:44 +00:00
|
|
|
if ( $value == 'infinite' || $value == 'indefinite' ) {
|
2007-05-03 15:40:38 +00:00
|
|
|
$blockExpiry = $show;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$blockExpiry = $wgLang->timeanddate( wfTimestamp( TS_MW, $blockExpiry ), true );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( $wgUser->mBlock->mAuto ) {
|
|
|
|
|
$msg = 'autoblockedtext';
|
|
|
|
|
} else {
|
|
|
|
|
$msg = 'blockedtext';
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-02 00:03:22 +00:00
|
|
|
/* $ip returns who *is* being blocked, $intended contains who was meant to be blocked.
|
|
|
|
|
* This could be a username, an ip range, or a single ip. */
|
|
|
|
|
$intended = $wgUser->mBlock->mAddress;
|
2007-06-01 07:57:17 +00:00
|
|
|
|
2008-02-18 07:25:35 +00:00
|
|
|
$this->addWikiMsg( $msg, $link, $reason, $ip, $name, $blockid, $blockExpiry, $intended, $blockTimestamp );
|
2007-07-31 13:59:29 +00:00
|
|
|
|
2006-04-29 23:30:46 +00:00
|
|
|
# Don't auto-return to special pages
|
2006-06-24 20:58:10 +00:00
|
|
|
if( $return ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
$return = $this->getTitle()->getNamespace() > -1 ? $this->getTitle() : null;
|
2008-04-16 13:46:16 +00:00
|
|
|
$this->returnToMain( null, $return );
|
2006-06-24 20:58:10 +00:00
|
|
|
}
|
2006-01-06 23:09:37 +00:00
|
|
|
}
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2007-05-18 20:46:42 +00:00
|
|
|
* Output a standard error page
|
2006-11-07 05:37:31 +00:00
|
|
|
*
|
2007-05-18 20:46:42 +00:00
|
|
|
* @param string $title Message key for page title
|
|
|
|
|
* @param string $msg Message key for page text
|
|
|
|
|
* @param array $params Message parameters
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2007-05-18 20:46:42 +00:00
|
|
|
public function showErrorPage( $title, $msg, $params = array() ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
if ( $this->getTitle() ) {
|
|
|
|
|
$this->mDebugtext .= 'Original title: ' . $this->getTitle()->getPrefixedText() . "\n";
|
2008-01-13 12:29:43 +00:00
|
|
|
}
|
2003-04-14 23:10:40 +00:00
|
|
|
$this->setPageTitle( wfMsg( $title ) );
|
2004-08-22 17:24:50 +00:00
|
|
|
$this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
|
2008-07-23 19:05:43 +00:00
|
|
|
$this->setRobotPolicy( 'noindex,nofollow' );
|
2004-01-17 09:49:43 +00:00
|
|
|
$this->setArticleRelated( false );
|
2004-03-23 10:19:31 +00:00
|
|
|
$this->enableClientCache( false );
|
2004-08-22 17:24:50 +00:00
|
|
|
$this->mRedirect = '';
|
|
|
|
|
$this->mBodytext = '';
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-08-22 06:41:50 +00:00
|
|
|
array_unshift( $params, 'parse' );
|
2007-05-18 20:46:42 +00:00
|
|
|
array_unshift( $params, $msg );
|
2008-11-06 22:20:29 +00:00
|
|
|
$this->addHTML( call_user_func_array( 'wfMsgExt', $params ) );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-16 13:46:16 +00:00
|
|
|
$this->returnToMain();
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2007-08-06 11:30:40 +00:00
|
|
|
/**
|
|
|
|
|
* Output a standard permission error page
|
|
|
|
|
*
|
|
|
|
|
* @param array $errors Error message keys
|
|
|
|
|
*/
|
2008-05-23 10:34:11 +00:00
|
|
|
public function showPermissionsErrorPage( $errors, $action = null )
|
2007-08-01 10:19:26 +00:00
|
|
|
{
|
|
|
|
|
$this->mDebugtext .= 'Original title: ' .
|
2009-04-09 02:22:36 +00:00
|
|
|
$this->getTitle()->getPrefixedText() . "\n";
|
2007-08-01 10:19:26 +00:00
|
|
|
$this->setPageTitle( wfMsg( 'permissionserrors' ) );
|
|
|
|
|
$this->setHTMLTitle( wfMsg( 'permissionserrors' ) );
|
2008-07-23 19:05:43 +00:00
|
|
|
$this->setRobotPolicy( 'noindex,nofollow' );
|
2007-08-01 10:19:26 +00:00
|
|
|
$this->setArticleRelated( false );
|
|
|
|
|
$this->enableClientCache( false );
|
|
|
|
|
$this->mRedirect = '';
|
|
|
|
|
$this->mBodytext = '';
|
2008-05-23 10:34:11 +00:00
|
|
|
$this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ) );
|
2007-08-01 10:19:26 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function errorpage( $title, $msg ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2006-06-07 06:40:24 +00:00
|
|
|
throw new ErrorPageError( $title, $msg );
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2005-06-26 06:49:56 +00:00
|
|
|
/**
|
|
|
|
|
* Display an error page indicating that a given version of MediaWiki is
|
|
|
|
|
* required to use it
|
|
|
|
|
*
|
|
|
|
|
* @param mixed $version The version of MediaWiki needed to use the page
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function versionRequired( $version ) {
|
2005-06-26 06:49:56 +00:00
|
|
|
$this->setPageTitle( wfMsg( 'versionrequired', $version ) );
|
|
|
|
|
$this->setHTMLTitle( wfMsg( 'versionrequired', $version ) );
|
2008-07-23 19:05:43 +00:00
|
|
|
$this->setRobotPolicy( 'noindex,nofollow' );
|
2005-06-26 06:49:56 +00:00
|
|
|
$this->setArticleRelated( false );
|
|
|
|
|
$this->mBodytext = '';
|
|
|
|
|
|
2008-02-18 07:25:35 +00:00
|
|
|
$this->addWikiMsg( 'versionrequiredtext', $version );
|
2005-06-26 06:49:56 +00:00
|
|
|
$this->returnToMain();
|
|
|
|
|
}
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2005-06-19 06:25:53 +00:00
|
|
|
/**
|
|
|
|
|
* Display an error page noting that a given permission bit is required.
|
2006-11-07 05:37:31 +00:00
|
|
|
*
|
2005-06-19 06:25:53 +00:00
|
|
|
* @param string $permission key required
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function permissionRequired( $permission ) {
|
2009-04-09 08:53:15 +00:00
|
|
|
global $wgLang;
|
2005-06-19 06:25:53 +00:00
|
|
|
|
|
|
|
|
$this->setPageTitle( wfMsg( 'badaccess' ) );
|
|
|
|
|
$this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
|
2008-07-23 19:05:43 +00:00
|
|
|
$this->setRobotPolicy( 'noindex,nofollow' );
|
2005-06-19 06:25:53 +00:00
|
|
|
$this->setArticleRelated( false );
|
|
|
|
|
$this->mBodytext = '';
|
|
|
|
|
|
2008-08-05 05:32:30 +00:00
|
|
|
$groups = array_map( array( 'User', 'makeGroupLinkWiki' ),
|
|
|
|
|
User::getGroupsWithPermission( $permission ) );
|
|
|
|
|
if( $groups ) {
|
|
|
|
|
$this->addWikiMsg( 'badaccess-groups',
|
2009-03-08 19:40:09 +00:00
|
|
|
$wgLang->commaList( $groups ),
|
2008-08-05 05:32:30 +00:00
|
|
|
count( $groups) );
|
|
|
|
|
} else {
|
|
|
|
|
$this->addWikiMsg( 'badaccess-group0' );
|
2007-08-27 21:05:19 +00:00
|
|
|
}
|
2008-04-16 13:46:16 +00:00
|
|
|
$this->returnToMain();
|
2007-08-26 09:49:28 +00:00
|
|
|
}
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2005-06-19 06:25:53 +00:00
|
|
|
/**
|
2006-11-07 05:37:31 +00:00
|
|
|
* Use permissionRequired.
|
2005-06-19 06:25:53 +00:00
|
|
|
* @deprecated
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function sysopRequired() {
|
2006-08-08 13:58:25 +00:00
|
|
|
throw new MWException( "Call to deprecated OutputPage::sysopRequired() method\n" );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2005-06-19 06:25:53 +00:00
|
|
|
/**
|
2006-11-07 05:37:31 +00:00
|
|
|
* Use permissionRequired.
|
2005-06-19 06:25:53 +00:00
|
|
|
* @deprecated
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function developerRequired() {
|
2006-08-08 13:58:25 +00:00
|
|
|
throw new MWException( "Call to deprecated OutputPage::developerRequired() method\n" );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2006-05-02 15:37:06 +00:00
|
|
|
/**
|
|
|
|
|
* Produce the stock "please login to use the wiki" page
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function loginToUse() {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgUser, $wgContLang;
|
2006-09-06 17:19:43 +00:00
|
|
|
|
|
|
|
|
if( $wgUser->isLoggedIn() ) {
|
|
|
|
|
$this->permissionRequired( 'read' );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-08 07:12:03 +00:00
|
|
|
$skin = $wgUser->getSkin();
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2004-08-22 17:24:50 +00:00
|
|
|
$this->setPageTitle( wfMsg( 'loginreqtitle' ) );
|
2006-05-02 15:37:06 +00:00
|
|
|
$this->setHtmlTitle( wfMsg( 'errorpagetitle' ) );
|
|
|
|
|
$this->setRobotPolicy( 'noindex,nofollow' );
|
2004-03-05 13:19:19 +00:00
|
|
|
$this->setArticleFlag( false );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-10-30 06:25:31 +00:00
|
|
|
$loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
|
2009-06-07 15:02:12 +00:00
|
|
|
$loginLink = $skin->link(
|
|
|
|
|
$loginTitle,
|
|
|
|
|
wfMsgHtml( 'loginreqlink' ),
|
|
|
|
|
array(),
|
2009-06-15 12:32:59 +00:00
|
|
|
array( 'returnto' => $this->getTitle()->getPrefixedText() ),
|
2009-06-07 15:02:12 +00:00
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2008-11-06 22:20:29 +00:00
|
|
|
$this->addHTML( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
|
2009-04-09 02:22:36 +00:00
|
|
|
$this->addHTML( "\n<!--" . $this->getTitle()->getPrefixedUrl() . "-->" );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-08-31 17:15:30 +00:00
|
|
|
# Don't return to the main page if the user can't read it
|
|
|
|
|
# otherwise we'll end up in a pointless loop
|
2006-12-03 00:22:14 +00:00
|
|
|
$mainPage = Title::newMainPage();
|
2006-08-31 17:15:30 +00:00
|
|
|
if( $mainPage->userCanRead() )
|
2008-04-16 13:46:16 +00:00
|
|
|
$this->returnToMain( null, $mainPage );
|
2004-03-05 13:19:19 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function databaseError( $fname, $sql, $error, $errno ) {
|
2006-06-07 06:40:24 +00:00
|
|
|
throw new MWException( "OutputPage::databaseError is obsolete\n" );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2007-08-03 09:27:28 +00:00
|
|
|
/**
|
2007-08-16 07:05:38 +00:00
|
|
|
* @param array $errors An array of arrays returned by Title::getUserPermissionsErrors
|
2008-01-02 02:01:09 +00:00
|
|
|
* @return string The wikitext error-messages, formatted into a list.
|
2007-08-03 09:27:28 +00:00
|
|
|
*/
|
2008-05-23 10:34:11 +00:00
|
|
|
public function formatPermissionsErrorMessage( $errors, $action = null ) {
|
|
|
|
|
if ($action == null) {
|
|
|
|
|
$text = wfMsgNoTrans( 'permissionserrorstext', count($errors)). "\n\n";
|
|
|
|
|
} else {
|
2008-08-26 18:51:27 +00:00
|
|
|
global $wgLang;
|
2009-05-25 13:49:01 +00:00
|
|
|
$action_desc = wfMsgNoTrans( "action-$action" );
|
2008-05-23 10:34:11 +00:00
|
|
|
$text = wfMsgNoTrans( 'permissionserrorstext-withaction', count($errors), $action_desc ) . "\n\n";
|
|
|
|
|
}
|
2008-01-02 01:16:44 +00:00
|
|
|
|
2008-01-02 02:01:09 +00:00
|
|
|
if (count( $errors ) > 1) {
|
2007-08-16 07:05:38 +00:00
|
|
|
$text .= '<ul class="permissions-errors">' . "\n";
|
|
|
|
|
|
|
|
|
|
foreach( $errors as $error )
|
|
|
|
|
{
|
|
|
|
|
$text .= '<li>';
|
2008-02-18 07:25:35 +00:00
|
|
|
$text .= call_user_func_array( 'wfMsgNoTrans', $error );
|
2007-08-16 07:05:38 +00:00
|
|
|
$text .= "</li>\n";
|
|
|
|
|
}
|
|
|
|
|
$text .= '</ul>';
|
|
|
|
|
} else {
|
2009-05-25 13:49:01 +00:00
|
|
|
$text .= "<div class=\"permissions-errors\">\n" . call_user_func_array( 'wfMsgNoTrans', reset( $errors ) ) . "\n</div>";
|
2007-08-03 09:27:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $text;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
/**
|
2007-12-09 00:16:59 +00:00
|
|
|
* Display a page stating that the Wiki is in read-only mode,
|
|
|
|
|
* and optionally show the source of the page that the user
|
|
|
|
|
* was trying to edit. Should only be called (for this
|
|
|
|
|
* purpose) after wfReadOnly() has returned true.
|
|
|
|
|
*
|
|
|
|
|
* For historical reasons, this function is _also_ used to
|
|
|
|
|
* show the error message when a user tries to edit a page
|
|
|
|
|
* they are not allowed to edit. (Unless it's because they're
|
|
|
|
|
* blocked, then we show blockedPage() instead.) In this
|
|
|
|
|
* case, the second parameter should be set to true and a list
|
|
|
|
|
* of reasons supplied as the third parameter.
|
|
|
|
|
*
|
|
|
|
|
* @todo Needs to be split into multiple functions.
|
|
|
|
|
*
|
|
|
|
|
* @param string $source Source code to show (or null).
|
|
|
|
|
* @param bool $protected Is this a permissions error?
|
|
|
|
|
* @param array $reasons List of reasons for this error, as returned by Title::getUserPermissionsErrors().
|
2006-11-07 05:37:31 +00:00
|
|
|
*/
|
2008-05-23 10:34:11 +00:00
|
|
|
public function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgUser;
|
2007-12-09 16:16:33 +00:00
|
|
|
$skin = $wgUser->getSkin();
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2008-07-23 19:05:43 +00:00
|
|
|
$this->setRobotPolicy( 'noindex,nofollow' );
|
2004-01-17 09:49:43 +00:00
|
|
|
$this->setArticleRelated( false );
|
2008-01-24 01:59:35 +00:00
|
|
|
|
2007-12-09 00:16:59 +00:00
|
|
|
// If no reason is given, just supply a default "I can't let you do
|
|
|
|
|
// that, Dave" message. Should only occur if called by legacy code.
|
|
|
|
|
if ( $protected && empty($reasons) ) {
|
|
|
|
|
$reasons[] = array( 'badaccess-group0' );
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-31 20:34:41 +00:00
|
|
|
if ( !empty($reasons) ) {
|
2007-12-09 00:16:59 +00:00
|
|
|
// Permissions error
|
2008-01-02 02:49:31 +00:00
|
|
|
if( $source ) {
|
|
|
|
|
$this->setPageTitle( wfMsg( 'viewsource' ) );
|
2009-06-07 15:02:12 +00:00
|
|
|
$this->setSubtitle(
|
|
|
|
|
wfMsg(
|
|
|
|
|
'viewsourcefor',
|
|
|
|
|
$skin->link(
|
|
|
|
|
$this->getTitle(),
|
|
|
|
|
null,
|
|
|
|
|
array(),
|
|
|
|
|
array(),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
2008-01-02 02:49:31 +00:00
|
|
|
} else {
|
|
|
|
|
$this->setPageTitle( wfMsg( 'badaccess' ) );
|
|
|
|
|
}
|
2008-05-23 10:34:11 +00:00
|
|
|
$this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
|
2003-11-09 11:45:12 +00:00
|
|
|
} else {
|
2007-12-09 00:16:59 +00:00
|
|
|
// Wiki is read only
|
2004-08-22 17:24:50 +00:00
|
|
|
$this->setPageTitle( wfMsg( 'readonly' ) );
|
2008-02-24 03:50:05 +00:00
|
|
|
$reason = wfReadOnlyReason();
|
2008-09-12 22:24:15 +00:00
|
|
|
$this->wrapWikiMsg( '<div class="mw-readonly-error">$1</div>', array( 'readonlytext', $reason ) );
|
2003-11-09 11:45:12 +00:00
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2007-12-09 00:16:59 +00:00
|
|
|
// Show source, if supplied
|
2004-04-30 07:18:38 +00:00
|
|
|
if( is_string( $source ) ) {
|
2008-02-18 07:25:35 +00:00
|
|
|
$this->addWikiMsg( 'viewsourcetext' );
|
2008-04-16 13:46:16 +00:00
|
|
|
$text = Xml::openElement( 'textarea',
|
2007-12-09 00:16:59 +00:00
|
|
|
array( 'id' => 'wpTextbox1',
|
|
|
|
|
'name' => 'wpTextbox1',
|
|
|
|
|
'cols' => $wgUser->getOption( 'cols' ),
|
|
|
|
|
'rows' => $wgUser->getOption( 'rows' ),
|
|
|
|
|
'readonly' => 'readonly' ) );
|
|
|
|
|
$text .= htmlspecialchars( $source );
|
2008-04-16 13:46:16 +00:00
|
|
|
$text .= Xml::closeElement( 'textarea' );
|
2003-11-09 11:45:12 +00:00
|
|
|
$this->addHTML( $text );
|
2007-12-09 00:16:59 +00:00
|
|
|
|
|
|
|
|
// Show templates used by this article
|
|
|
|
|
$skin = $wgUser->getSkin();
|
2009-04-09 02:22:36 +00:00
|
|
|
$article = new Article( $this->getTitle() );
|
2008-08-08 12:23:17 +00:00
|
|
|
$this->addHTML( "<div class='templatesUsed'>
|
|
|
|
|
{$skin->formatTemplates( $article->getUsedTemplates() )}
|
|
|
|
|
</div>
|
|
|
|
|
" );
|
2003-09-09 05:46:22 +00:00
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2008-01-02 02:49:31 +00:00
|
|
|
# If the title doesn't exist, it's fairly pointless to print a return
|
|
|
|
|
# link to it. After all, you just tried editing it and couldn't, so
|
|
|
|
|
# what's there to do there?
|
2009-04-09 02:22:36 +00:00
|
|
|
if( $this->getTitle()->exists() ) {
|
|
|
|
|
$this->returnToMain( null, $this->getTitle() );
|
2008-01-02 02:49:31 +00:00
|
|
|
}
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function fatalError( $message ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2008-04-14 07:45:50 +00:00
|
|
|
throw new FatalError( $message );
|
2006-06-07 06:40:24 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function unexpectedValueError( $name, $val ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2006-06-07 06:40:24 +00:00
|
|
|
throw new FatalError( wfMsg( 'unexpected', $name, $val ) );
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function fileCopyError( $old, $new ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2006-06-07 06:40:24 +00:00
|
|
|
throw new FatalError( wfMsg( 'filecopyerror', $old, $new ) );
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function fileRenameError( $old, $new ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2006-06-07 06:40:24 +00:00
|
|
|
throw new FatalError( wfMsg( 'filerenameerror', $old, $new ) );
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function fileDeleteError( $name ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2006-06-07 06:40:24 +00:00
|
|
|
throw new FatalError( wfMsg( 'filedeleteerror', $name ) );
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-04 05:22:37 +00:00
|
|
|
/** @deprecated */
|
2006-11-07 05:37:31 +00:00
|
|
|
public function fileNotFoundError( $name ) {
|
2008-04-16 13:46:16 +00:00
|
|
|
wfDeprecated( __METHOD__ );
|
2006-06-07 06:40:24 +00:00
|
|
|
throw new FatalError( wfMsg( 'filenotfound', $name ) );
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function showFatalError( $message ) {
|
2003-04-14 23:10:40 +00:00
|
|
|
$this->setPageTitle( wfMsg( "internalerror" ) );
|
2008-07-23 19:05:43 +00:00
|
|
|
$this->setRobotPolicy( "noindex,nofollow" );
|
2004-01-17 09:49:43 +00:00
|
|
|
$this->setArticleRelated( false );
|
2004-03-23 10:19:31 +00:00
|
|
|
$this->enableClientCache( false );
|
2004-08-22 17:24:50 +00:00
|
|
|
$this->mRedirect = '';
|
2003-04-14 23:10:40 +00:00
|
|
|
$this->mBodytext = $message;
|
|
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function showUnexpectedValueError( $name, $val ) {
|
2006-06-07 06:40:24 +00:00
|
|
|
$this->showFatalError( wfMsg( 'unexpected', $name, $val ) );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function showFileCopyError( $old, $new ) {
|
2006-06-07 06:40:24 +00:00
|
|
|
$this->showFatalError( wfMsg( 'filecopyerror', $old, $new ) );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function showFileRenameError( $old, $new ) {
|
2006-06-07 06:40:24 +00:00
|
|
|
$this->showFatalError( wfMsg( 'filerenameerror', $old, $new ) );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function showFileDeleteError( $name ) {
|
2006-06-07 06:40:24 +00:00
|
|
|
$this->showFatalError( wfMsg( 'filedeleteerror', $name ) );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
public function showFileNotFoundError( $name ) {
|
2006-06-07 06:40:24 +00:00
|
|
|
$this->showFatalError( wfMsg( 'filenotfound', $name ) );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2007-07-29 23:53:45 +00:00
|
|
|
* Add a "return to" link pointing to a specified title
|
|
|
|
|
*
|
|
|
|
|
* @param Title $title Title to link
|
2009-07-14 21:25:33 +00:00
|
|
|
* @param string $query Query string
|
2007-07-29 23:53:45 +00:00
|
|
|
*/
|
2009-07-15 06:43:42 +00:00
|
|
|
public function addReturnTo( $title, $query = array() ) {
|
2007-07-29 23:53:45 +00:00
|
|
|
global $wgUser;
|
2008-12-24 19:08:18 +00:00
|
|
|
$this->addLink( array( 'rel' => 'next', 'href' => $title->getFullUrl() ) );
|
2009-07-14 21:25:33 +00:00
|
|
|
$link = wfMsgHtml( 'returnto', $wgUser->getSkin()->link(
|
|
|
|
|
$title, null, array(), $query ) );
|
2009-06-15 11:11:17 +00:00
|
|
|
$this->addHTML( "<p id=\"mw-returnto\">{$link}</p>\n" );
|
2007-07-29 23:53:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add a "return to" link pointing to a specified title,
|
|
|
|
|
* or the title indicated in the request, or else the main page
|
|
|
|
|
*
|
|
|
|
|
* @param null $unused No longer used
|
|
|
|
|
* @param Title $returnto Title to return to
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2009-07-14 21:25:33 +00:00
|
|
|
public function returnToMain( $unused = null, $returnto = null, $returntoquery = null ) {
|
2007-07-29 23:53:45 +00:00
|
|
|
global $wgRequest;
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-07-14 21:25:33 +00:00
|
|
|
if ( $returnto == null ) {
|
2004-04-01 12:44:54 +00:00
|
|
|
$returnto = $wgRequest->getText( 'returnto' );
|
|
|
|
|
}
|
2009-08-07 00:16:54 +00:00
|
|
|
|
2009-07-14 21:25:33 +00:00
|
|
|
if ( $returntoquery == null ) {
|
|
|
|
|
$returntoquery = $wgRequest->getText( 'returntoquery' );
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-06-21 16:28:04 +00:00
|
|
|
if ( '' === $returnto ) {
|
2006-12-03 00:22:14 +00:00
|
|
|
$returnto = Title::newMainPage();
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2006-06-21 16:28:04 +00:00
|
|
|
|
|
|
|
|
if ( is_object( $returnto ) ) {
|
|
|
|
|
$titleObj = $returnto;
|
|
|
|
|
} else {
|
|
|
|
|
$titleObj = Title::newFromText( $returnto );
|
|
|
|
|
}
|
2006-06-23 06:53:05 +00:00
|
|
|
if ( !is_object( $titleObj ) ) {
|
|
|
|
|
$titleObj = Title::newMainPage();
|
|
|
|
|
}
|
2006-06-21 16:28:04 +00:00
|
|
|
|
2009-07-14 21:25:33 +00:00
|
|
|
$this->addReturnTo( $titleObj, $returntoquery );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2006-11-07 05:37:31 +00:00
|
|
|
* @return string The doctype, opening <html>, and head element.
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2008-08-21 14:09:57 +00:00
|
|
|
public function headElement( Skin $sk ) {
|
2004-09-24 13:14:52 +00:00
|
|
|
global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
|
2007-01-07 22:31:07 +00:00
|
|
|
global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgEnableScriptLoader, $wgHtml5;
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2009-07-07 21:49:45 +00:00
|
|
|
$this->addMeta( "http:Content-Type", "$wgMimeType; charset={$wgOutputEncoding}" );
|
|
|
|
|
if ( $sk->commonPrintStylesheet() ) {
|
|
|
|
|
$this->addStyle( 'common/wikiprintable.css', 'print' );
|
|
|
|
|
}
|
2008-08-21 14:09:57 +00:00
|
|
|
$sk->setupUserCss( $this );
|
|
|
|
|
|
|
|
|
|
$ret = '';
|
|
|
|
|
|
2005-02-07 14:11:59 +00:00
|
|
|
if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) {
|
2009-03-16 00:34:46 +00:00
|
|
|
$ret .= "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?" . ">\n";
|
2004-04-03 10:01:08 +00:00
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2005-08-17 12:00:07 +00:00
|
|
|
if ( '' == $this->getHTMLTitle() ) {
|
|
|
|
|
$this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ));
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2005-02-07 14:11:59 +00:00
|
|
|
|
2009-08-22 01:24:04 +00:00
|
|
|
$dir = $wgContLang->getDir();
|
2009-07-15 22:55:30 +00:00
|
|
|
|
|
|
|
|
if ( $wgHtml5 ) {
|
|
|
|
|
$ret .= "<!doctype html>\n";
|
|
|
|
|
$ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
|
|
|
|
|
} else {
|
|
|
|
|
$ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
|
|
|
|
|
$ret .= "<html xmlns=\"{$wgXhtmlDefaultNamespace}\" ";
|
|
|
|
|
foreach($wgXhtmlNamespaces as $tag => $ns) {
|
|
|
|
|
$ret .= "xmlns:{$tag}=\"{$ns}\" ";
|
|
|
|
|
}
|
|
|
|
|
$ret .= "xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
|
2007-01-07 22:31:07 +00:00
|
|
|
}
|
2009-07-15 22:55:30 +00:00
|
|
|
|
2009-07-07 21:49:45 +00:00
|
|
|
$ret .= "<head>\n\t<title>" . htmlspecialchars( $this->getHTMLTitle() ) . "</title>\n\t";
|
|
|
|
|
$ret .= implode( "\n", array(
|
2008-08-21 14:09:57 +00:00
|
|
|
$this->getHeadLinks(),
|
|
|
|
|
$this->buildCssLinks(),
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$sk->getHeadScripts( $this ),
|
2008-08-21 14:09:57 +00:00
|
|
|
$this->getHeadItems(),
|
|
|
|
|
));
|
|
|
|
|
if( $sk->usercss ){
|
2009-08-11 00:09:24 +00:00
|
|
|
$ret .= Html::inlineStyle( $sk->usercss );
|
2008-08-10 07:14:08 +00:00
|
|
|
}
|
2004-04-09 04:53:52 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
if( $wgEnableScriptLoader )
|
|
|
|
|
$ret .= $this->getScriptLoaderJs();
|
|
|
|
|
|
2005-07-23 05:47:25 +00:00
|
|
|
if ($wgUseTrackbacks && $this->isArticleRelated())
|
2009-04-09 02:22:36 +00:00
|
|
|
$ret .= $this->getTitle()->trackbackRDF();
|
2005-07-23 05:47:25 +00:00
|
|
|
|
2004-04-09 04:53:52 +00:00
|
|
|
$ret .= "</head>\n";
|
|
|
|
|
return $ret;
|
|
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-07-02 22:52:22 +00:00
|
|
|
protected function addDefaultMeta() {
|
2009-07-10 04:19:51 +00:00
|
|
|
global $wgVersion, $wgHtml5;
|
2009-07-07 21:49:45 +00:00
|
|
|
|
|
|
|
|
static $called = false;
|
|
|
|
|
if ( $called ) {
|
|
|
|
|
# Don't run this twice
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$called = true;
|
|
|
|
|
|
2009-07-10 04:19:51 +00:00
|
|
|
if ( !$wgHtml5 ) {
|
|
|
|
|
$this->addMeta( 'http:Content-Style-Type', 'text/css' ); //bug 15835
|
|
|
|
|
}
|
2008-11-08 15:06:50 +00:00
|
|
|
$this->addMeta( 'generator', "MediaWiki $wgVersion" );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-07-23 19:05:43 +00:00
|
|
|
$p = "{$this->mIndexPolicy},{$this->mFollowPolicy}";
|
|
|
|
|
if( $p !== 'index,follow' ) {
|
2008-07-02 22:52:22 +00:00
|
|
|
// http://www.robotstxt.org/wc/meta-user.html
|
|
|
|
|
// Only show if it's different from the default robots policy
|
|
|
|
|
$this->addMeta( 'robots', $p );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( count( $this->mKeywords ) > 0 ) {
|
|
|
|
|
$strip = array(
|
2009-03-16 00:36:17 +00:00
|
|
|
"/<.*?" . ">/" => '',
|
2008-07-02 22:52:22 +00:00
|
|
|
"/_/" => ' '
|
|
|
|
|
);
|
|
|
|
|
$this->addMeta( 'keywords', preg_replace(array_keys($strip), array_values($strip),implode( ",", $this->mKeywords ) ) );
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-07-08 14:53:54 +00:00
|
|
|
|
2006-11-07 05:37:31 +00:00
|
|
|
/**
|
|
|
|
|
* @return string HTML tag links to be put in the header.
|
|
|
|
|
*/
|
|
|
|
|
public function getHeadLinks() {
|
2008-07-02 22:52:22 +00:00
|
|
|
global $wgRequest, $wgFeed;
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-07-02 22:52:22 +00:00
|
|
|
// Ideally this should happen earlier, somewhere. :P
|
|
|
|
|
$this->addDefaultMeta();
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-07-02 22:52:22 +00:00
|
|
|
$tags = array();
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2003-04-14 23:10:40 +00:00
|
|
|
foreach ( $this->mMetatags as $tag ) {
|
2004-08-22 17:24:50 +00:00
|
|
|
if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
|
|
|
|
|
$a = 'http-equiv';
|
2003-04-14 23:10:40 +00:00
|
|
|
$tag[0] = substr( $tag[0], 5 );
|
|
|
|
|
} else {
|
2004-08-22 17:24:50 +00:00
|
|
|
$a = 'name';
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2008-07-02 22:52:22 +00:00
|
|
|
$tags[] = Xml::element( 'meta',
|
|
|
|
|
array(
|
|
|
|
|
$a => $tag[0],
|
|
|
|
|
'content' => $tag[1] ) );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
|
|
|
|
foreach ( $this->mLinktags as $tag ) {
|
2008-07-02 22:52:22 +00:00
|
|
|
$tags[] = Xml::element( 'link', $tag );
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-02-22 12:33:51 +00:00
|
|
|
if( $wgFeed ) {
|
|
|
|
|
foreach( $this->getSyndicationLinks() as $format => $link ) {
|
|
|
|
|
# Use the page name for the title (accessed through $wgTitle since
|
|
|
|
|
# there's no other way). In principle, this could lead to issues
|
|
|
|
|
# with having the same name for different feeds corresponding to
|
|
|
|
|
# the same page, but we can't avoid that at this low a level.
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-07-02 22:52:22 +00:00
|
|
|
$tags[] = $this->feedLink(
|
2008-02-22 12:33:51 +00:00
|
|
|
$format,
|
|
|
|
|
$link,
|
2009-04-09 02:22:36 +00:00
|
|
|
wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() ) ); # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep)
|
2008-02-22 12:33:51 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
# Recent changes feed should appear on every page (except recentchanges,
|
|
|
|
|
# that would be redundant). Put it after the per-page feed to avoid
|
|
|
|
|
# changing existing behavior. It's still available, probably via a
|
2008-08-08 01:41:14 +00:00
|
|
|
# menu in your browser. Some sites might have a different feed they'd
|
|
|
|
|
# like to promote instead of the RC feed (maybe like a "Recent New Articles"
|
|
|
|
|
# or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
|
|
|
|
|
# If so, use it instead.
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-09-16 03:58:18 +00:00
|
|
|
global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses;
|
2008-02-22 12:33:51 +00:00
|
|
|
$rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2008-08-08 21:02:52 +00:00
|
|
|
if ( $wgOverrideSiteFeed ) {
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
foreach ( $wgOverrideSiteFeed as $type => $feedUrl ) {
|
2008-08-08 01:41:14 +00:00
|
|
|
$tags[] = $this->feedLink (
|
|
|
|
|
$type,
|
|
|
|
|
htmlspecialchars( $feedUrl ),
|
|
|
|
|
wfMsg( "site-{$type}-feed", $wgSitename ) );
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-04-09 02:22:36 +00:00
|
|
|
else if ( $this->getTitle()->getPrefixedText() != $rctitle->getPrefixedText() ) {
|
2008-09-16 03:58:18 +00:00
|
|
|
foreach( $wgFeedClasses as $format => $class ) {
|
|
|
|
|
$tags[] = $this->feedLink(
|
|
|
|
|
$format,
|
2009-02-20 20:49:47 +00:00
|
|
|
$rctitle->getLocalURL( "feed={$format}" ),
|
2008-09-16 03:58:18 +00:00
|
|
|
wfMsg( "site-{$format}-feed", $wgSitename ) ); # For grep: 'site-rss-feed', 'site-atom-feed'.
|
|
|
|
|
}
|
2008-06-12 00:51:04 +00:00
|
|
|
}
|
2004-03-19 08:05:36 +00:00
|
|
|
}
|
2005-01-18 00:05:35 +00:00
|
|
|
|
2009-07-07 21:49:45 +00:00
|
|
|
return implode( "\n\t", $tags ) . "\n";
|
2003-04-14 23:10:40 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-01-12 00:13:53 +00:00
|
|
|
/**
|
|
|
|
|
* Return URLs for each supported syndication format for this page.
|
|
|
|
|
* @return array associating format keys with URLs
|
|
|
|
|
*/
|
|
|
|
|
public function getSyndicationLinks() {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgFeedClasses;
|
2008-01-12 00:13:53 +00:00
|
|
|
$links = array();
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-01-12 00:13:53 +00:00
|
|
|
if( $this->isSyndicated() ) {
|
|
|
|
|
if( is_string( $this->getFeedAppendQuery() ) ) {
|
|
|
|
|
$appendQuery = "&" . $this->getFeedAppendQuery();
|
|
|
|
|
} else {
|
|
|
|
|
$appendQuery = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach( $wgFeedClasses as $format => $class ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
$links[$format] = $this->getTitle()->getLocalUrl( "feed=$format{$appendQuery}" );
|
2008-01-12 00:13:53 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $links;
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-09-24 18:25:56 +00:00
|
|
|
/**
|
|
|
|
|
* Generate a <link rel/> for an RSS feed.
|
|
|
|
|
*/
|
|
|
|
|
private function feedLink( $type, $url, $text ) {
|
|
|
|
|
return Xml::element( 'link', array(
|
|
|
|
|
'rel' => 'alternate',
|
|
|
|
|
'type' => "application/$type+xml",
|
|
|
|
|
'title' => $text,
|
2008-07-02 22:52:22 +00:00
|
|
|
'href' => $url ) );
|
2007-09-24 18:25:56 +00:00
|
|
|
}
|
2005-07-01 00:03:31 +00:00
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
/**
|
|
|
|
|
* Add a local or specified stylesheet, with the given media options.
|
|
|
|
|
* Meant primarily for internal use...
|
|
|
|
|
*
|
|
|
|
|
* @param $media -- to specify a media type, 'screen', 'printable', 'handheld' or any.
|
|
|
|
|
* @param $conditional -- for IE conditional comments, specifying an IE version
|
|
|
|
|
* @param $dir -- set to 'rtl' or 'ltr' for direction-specific sheets
|
|
|
|
|
*/
|
|
|
|
|
public function addStyle( $style, $media='', $condition='', $dir='' ) {
|
|
|
|
|
$options = array();
|
2009-08-18 21:22:59 +00:00
|
|
|
// Even though we expect the media type to be lowercase, but here we
|
|
|
|
|
// force it to lowercase to be safe.
|
2008-08-21 14:09:57 +00:00
|
|
|
if( $media )
|
|
|
|
|
$options['media'] = $media;
|
|
|
|
|
if( $condition )
|
|
|
|
|
$options['condition'] = $condition;
|
|
|
|
|
if( $dir )
|
|
|
|
|
$options['dir'] = $dir;
|
|
|
|
|
$this->styles[$style] = $options;
|
|
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds inline CSS styles
|
|
|
|
|
* @param $style_css Mixed: inline CSS
|
|
|
|
|
*/
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
public function addInlineStyle( $style_css ){
|
2009-08-11 00:09:24 +00:00
|
|
|
$this->mScripts .= Html::inlineStyle( $style_css );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
2009-07-15 00:55:58 +00:00
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
/**
|
|
|
|
|
* Build a set of <link>s for the stylesheets specified in the $this->styles array.
|
|
|
|
|
* These will be applied to various media & IE conditionals.
|
|
|
|
|
*/
|
|
|
|
|
public function buildCssLinks() {
|
|
|
|
|
$links = array();
|
|
|
|
|
foreach( $this->styles as $file => $options ) {
|
|
|
|
|
$link = $this->styleLink( $file, $options );
|
|
|
|
|
if( $link )
|
|
|
|
|
$links[] = $link;
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-07 21:49:45 +00:00
|
|
|
return "\t" . implode( "\n\t", $links );
|
2008-08-21 14:09:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function styleLink( $style, $options ) {
|
2009-08-10 19:23:21 +00:00
|
|
|
global $wgRequest;
|
2008-08-21 14:09:57 +00:00
|
|
|
|
|
|
|
|
if( isset( $options['dir'] ) ) {
|
|
|
|
|
global $wgContLang;
|
2009-08-22 01:24:04 +00:00
|
|
|
$siteDir = $wgContLang->getDir();
|
2008-08-21 14:09:57 +00:00
|
|
|
if( $siteDir != $options['dir'] )
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( isset( $options['media'] ) ) {
|
|
|
|
|
$media = $this->transformCssMedia( $options['media'] );
|
|
|
|
|
if( is_null( $media ) ) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2009-08-11 00:09:24 +00:00
|
|
|
$media = null;
|
2008-08-21 14:09:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( substr( $style, 0, 1 ) == '/' ||
|
|
|
|
|
substr( $style, 0, 5 ) == 'http:' ||
|
|
|
|
|
substr( $style, 0, 6 ) == 'https:' ) {
|
|
|
|
|
$url = $style;
|
|
|
|
|
} else {
|
|
|
|
|
global $wgStylePath, $wgStyleVersion;
|
|
|
|
|
$url = $wgStylePath . '/' . $style . '?' . $wgStyleVersion;
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-11 00:09:24 +00:00
|
|
|
$link = Html::linkedStyle( $url, $media );
|
2008-08-21 14:09:57 +00:00
|
|
|
|
|
|
|
|
if( isset( $options['condition'] ) ) {
|
|
|
|
|
$condition = htmlspecialchars( $options['condition'] );
|
|
|
|
|
$link = "<!--[if $condition]>$link<![endif]-->";
|
|
|
|
|
}
|
|
|
|
|
return $link;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function transformCssMedia( $media ) {
|
|
|
|
|
global $wgRequest, $wgHandheldForIPhone;
|
|
|
|
|
|
|
|
|
|
// Switch in on-screen display for media testing
|
|
|
|
|
$switches = array(
|
|
|
|
|
'printable' => 'print',
|
|
|
|
|
'handheld' => 'handheld',
|
|
|
|
|
);
|
|
|
|
|
foreach( $switches as $switch => $targetMedia ) {
|
|
|
|
|
if( $wgRequest->getBool( $switch ) ) {
|
|
|
|
|
if( $media == $targetMedia ) {
|
|
|
|
|
$media = '';
|
|
|
|
|
} elseif( $media == 'screen' ) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Expand longer media queries as iPhone doesn't grok 'handheld'
|
|
|
|
|
if( $wgHandheldForIPhone ) {
|
|
|
|
|
$mediaAliases = array(
|
|
|
|
|
'screen' => 'screen and (min-device-width: 481px)',
|
|
|
|
|
'handheld' => 'handheld, only screen and (max-device-width: 480px)',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if( isset( $mediaAliases[$media] ) ) {
|
|
|
|
|
$media = $mediaAliases[$media];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $media;
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-27 11:03:37 +00:00
|
|
|
/**
|
|
|
|
|
* Turn off regular page output and return an error reponse
|
|
|
|
|
* for when rate limiting has triggered.
|
|
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function rateLimited() {
|
2007-11-20 08:34:59 +00:00
|
|
|
|
|
|
|
|
$this->setPageTitle(wfMsg('actionthrottled'));
|
2007-11-20 17:32:43 +00:00
|
|
|
$this->setRobotPolicy( 'noindex,follow' );
|
2007-11-20 08:34:59 +00:00
|
|
|
$this->setArticleRelated( false );
|
|
|
|
|
$this->enableClientCache( false );
|
|
|
|
|
$this->mRedirect = '';
|
|
|
|
|
$this->clearHTML();
|
|
|
|
|
$this->setStatusCode(503);
|
2008-02-18 07:25:35 +00:00
|
|
|
$this->addWikiMsg( 'actionthrottledtext' );
|
2007-11-20 08:34:59 +00:00
|
|
|
|
2009-04-09 02:22:36 +00:00
|
|
|
$this->returnToMain( null, $this->getTitle() );
|
2005-05-27 11:03:37 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-05-01 20:35:08 +00:00
|
|
|
/**
|
|
|
|
|
* Show an "add new section" link?
|
|
|
|
|
*
|
2007-08-11 17:18:20 +00:00
|
|
|
* @return bool
|
2006-05-01 20:35:08 +00:00
|
|
|
*/
|
2006-11-07 05:37:31 +00:00
|
|
|
public function showNewSectionLink() {
|
2006-05-01 20:35:08 +00:00
|
|
|
return $this->mNewSectionLink;
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-02-19 22:14:59 +00:00
|
|
|
/**
|
|
|
|
|
* Forcibly hide the new section link?
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function forceHideNewSectionLink() {
|
|
|
|
|
return $this->mHideNewSectionLink;
|
|
|
|
|
}
|
|
|
|
|
|
2007-05-18 20:17:53 +00:00
|
|
|
/**
|
|
|
|
|
* Show a warning about slave lag
|
|
|
|
|
*
|
2007-08-11 17:18:20 +00:00
|
|
|
* If the lag is higher than $wgSlaveLagCritical seconds,
|
|
|
|
|
* then the warning is a bit more obvious. If the lag is
|
|
|
|
|
* lower than $wgSlaveLagWarning, then no warning is shown.
|
2007-05-18 20:17:53 +00:00
|
|
|
*
|
|
|
|
|
* @param int $lag Slave lag
|
|
|
|
|
*/
|
|
|
|
|
public function showLagWarning( $lag ) {
|
2007-05-24 18:06:21 +00:00
|
|
|
global $wgSlaveLagWarning, $wgSlaveLagCritical;
|
2007-08-11 17:18:20 +00:00
|
|
|
if( $lag >= $wgSlaveLagWarning ) {
|
|
|
|
|
$message = $lag < $wgSlaveLagCritical
|
|
|
|
|
? 'lag-warn-normal'
|
|
|
|
|
: 'lag-warn-high';
|
|
|
|
|
$warning = wfMsgExt( $message, 'parse', $lag );
|
2008-11-06 22:20:29 +00:00
|
|
|
$this->addHTML( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" );
|
2007-08-11 17:18:20 +00:00
|
|
|
}
|
2007-05-18 20:17:53 +00:00
|
|
|
}
|
2007-12-10 06:02:29 +00:00
|
|
|
|
2008-02-18 07:25:35 +00:00
|
|
|
/**
|
|
|
|
|
* Add a wikitext-formatted message to the output.
|
|
|
|
|
* This is equivalent to:
|
|
|
|
|
*
|
|
|
|
|
* $wgOut->addWikiText( wfMsgNoTrans( ... ) )
|
|
|
|
|
*/
|
|
|
|
|
public function addWikiMsg( /*...*/ ) {
|
|
|
|
|
$args = func_get_args();
|
|
|
|
|
$name = array_shift( $args );
|
|
|
|
|
$this->addWikiMsgArray( $name, $args );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add a wikitext-formatted message to the output.
|
|
|
|
|
* Like addWikiMsg() except the parameters are taken as an array
|
|
|
|
|
* instead of a variable argument list.
|
|
|
|
|
*
|
|
|
|
|
* $options is passed through to wfMsgExt(), see that function for details.
|
|
|
|
|
*/
|
|
|
|
|
public function addWikiMsgArray( $name, $args, $options = array() ) {
|
|
|
|
|
$options[] = 'parse';
|
|
|
|
|
$text = wfMsgExt( $name, $options, $args );
|
|
|
|
|
$this->addHTML( $text );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2008-04-14 07:45:50 +00:00
|
|
|
* This function takes a number of message/argument specifications, wraps them in
|
2008-02-18 07:25:35 +00:00
|
|
|
* some overall structure, and then parses the result and adds it to the output.
|
|
|
|
|
*
|
2008-04-14 07:45:50 +00:00
|
|
|
* In the $wrap, $1 is replaced with the first message, $2 with the second, and so
|
|
|
|
|
* on. The subsequent arguments may either be strings, in which case they are the
|
2009-05-19 23:27:53 +00:00
|
|
|
* message names, or arrays, in which case the first element is the message name,
|
2008-02-18 07:25:35 +00:00
|
|
|
* and subsequent elements are the parameters to that message.
|
|
|
|
|
*
|
|
|
|
|
* The special named parameter 'options' in a message specification array is passed
|
2008-04-14 07:45:50 +00:00
|
|
|
* through to the $options parameter of wfMsgExt().
|
2008-02-18 07:25:35 +00:00
|
|
|
*
|
2008-04-18 06:31:37 +00:00
|
|
|
* Don't use this for messages that are not in users interface language.
|
|
|
|
|
*
|
2008-02-18 07:25:35 +00:00
|
|
|
* For example:
|
|
|
|
|
*
|
|
|
|
|
* $wgOut->wrapWikiMsg( '<div class="error">$1</div>', 'some-error' );
|
2008-04-14 07:45:50 +00:00
|
|
|
*
|
2008-02-18 07:25:35 +00:00
|
|
|
* Is equivalent to:
|
|
|
|
|
*
|
|
|
|
|
* $wgOut->addWikiText( '<div class="error">' . wfMsgNoTrans( 'some-error' ) . '</div>' );
|
|
|
|
|
*/
|
|
|
|
|
public function wrapWikiMsg( $wrap /*, ...*/ ) {
|
|
|
|
|
$msgSpecs = func_get_args();
|
|
|
|
|
array_shift( $msgSpecs );
|
|
|
|
|
$msgSpecs = array_values( $msgSpecs );
|
|
|
|
|
$s = $wrap;
|
|
|
|
|
foreach ( $msgSpecs as $n => $spec ) {
|
|
|
|
|
$options = array();
|
|
|
|
|
if ( is_array( $spec ) ) {
|
|
|
|
|
$args = $spec;
|
|
|
|
|
$name = array_shift( $args );
|
|
|
|
|
if ( isset( $args['options'] ) ) {
|
|
|
|
|
$options = $args['options'];
|
|
|
|
|
unset( $args['options'] );
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$args = array();
|
|
|
|
|
$name = $spec;
|
|
|
|
|
}
|
2009-01-30 16:45:09 +00:00
|
|
|
$s = str_replace( '$' . ( $n + 1 ), wfMsgExt( $name, $options, $args ), $s );
|
2008-02-18 07:25:35 +00:00
|
|
|
}
|
2008-04-18 06:31:37 +00:00
|
|
|
$this->addHTML( $this->parse( $s, /*linestart*/true, /*uilang*/true ) );
|
2008-02-18 07:25:35 +00:00
|
|
|
}
|
2007-08-16 07:05:38 +00:00
|
|
|
}
|