@GWTConfig public final class MediaWikiIn extends TheatreInitializer0 implements EntryPointS
The following configuration properties are specific to this entry module. These are properties of global JavaScript object window.voGWTConfig. The short name (SHORT) of each is fully qualified as "window.voGWTConfig.s_gwt_mediawiki_SHORT".
Short name | Form | Value | Default |
---|---|---|---|
toTop | boolean | Specify true for top insertion of the stage. Otherwise the stage is placed as for remote drafting. | false |
Injection embeds the stage in a web page. Common patterns of injection are documented in the sections below.
// Crossforum Theatre stage. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // module.css and gwt.js must load before boot script nocache.js // http://reluk.ca/project/votorola/_/javadoc/votorola/s/gwt/mediawiki/MediaWikiIn.html if( $.client.profile().name != 'msie' ) // all but IE [1] { voInject = function() // implicitly declared so deletable below { if( !window.voGWTConfig ) voGWTConfig = {}; else if( window.voGWTConfig.s_gwt_mediawiki_isInjected ) return; // guard against double injection by both admin and user scripts window.voGWTConfig.s_gwt_mediawiki_isInjected = true; window.voGWTConfig.s_gwt_mediawiki_toTop = true; var context = 'CONTEXT'; document.write( "<link href='" + context // [2] + "/mediawiki/module.css' rel='stylesheet' type='text/css'/>" ); document.write( "<script src='" + context // [3] + "/w/publicConfig/gwt.js' type='text/javascript'></script>" ); document.write( "<script src='" + context // [3] + "/votorola.s.gwt.mediawiki.MediaWikiIn/votorola.s.gwt.mediawiki.MediaWikiIn.nocache.js'" + " type='text/javascript'></script>" ); } voInject(); delete voInject; // clean up } // // NOTES // // [1] IE excluded by conditional compilation in MediaWiki 16 and earlier, thus: // // /*@cc_on @if( false ) @*/ // /*@end @*/ // // And by JQuery in MediaWiki 17 and later, thus: // // if( $.client.profile().name != 'msie' ) // // [2] For MediaWiki 16 and earlier, would ordinarily use: importStylesheetURI( URL ) // For MediaWiki 17 and later: mw.loader.load( URL, 'text/css' ) // http://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_%28users%29 // // But instead write to ensure CSS link element precedes script element, else layout // may be unstable: http://mail.zelea.com/list/votorola/2012-November/001540.html // // [3] Scripts might instead be injected asynchronously using MediaWiki's mw.loader or // importScriptURI. We are no longer using the old cross-site linker ('xs') that // writes to the document. But asynchronous injection has not been tested yet. //
<ELEMENT id='bodyContent'/>
and inserts a newly
constructed stage view as its first child, which will normally
render just beneath the tabs and other navigation controls of the wiki (or if
ELEMENT cannot be located, then it defaults to top insertion). To install it add the following
to MediaWiki:Common.js or your
personal script/user script,
substituting the correct value for CONTEXT:// Crossforum Theatre stage for remote drafting. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // module.css and gwt.js must load before boot script nocache.js // http://reluk.ca/project/votorola/_/javadoc/votorola/s/gwt/mediawiki/MediaWikiIn.html if( $.client.profile().name != 'msie' ) // all but IE [1] { voInject = function() // implicitly declared so deletable below { var toInject = false; for( var c = wgCategories.length - 1; c >=0; --c ) { var category = wgCategories[c]; if( category == 'Remote draft' ) { toInject = true; // inject regardless for a remote draft page break; } } if( toInject ) { if( !window.voGWTConfig ) voGWTConfig = {}; else if( window.voGWTConfig.s_gwt_mediawiki_isInjected ) return; // guard against double injection by both admin and user scripts window.voGWTConfig.s_gwt_mediawiki_isInjected = true; var context = 'CONTEXT'; document.write( "<link href='" + context // [2] + "/mediawiki/module.css' rel='stylesheet' type='text/css'/>" ); document.write( "<script src='" + context // [3] + "/w/publicConfig/gwt.js' type='text/javascript'></script>" ); document.write( "<script src='" + context // [3] + "/votorola.s.gwt.mediawiki.MediaWikiIn/votorola.s.gwt.mediawiki.MediaWikiIn.nocache.js'" + " type='text/javascript'></script>" ); } } voInject(); delete voInject; // clean up } // // NOTES // // (same as farther above) //
As mentioned, this will ordinarily inject the stage only in remote draft pages. You may create such pages with the help of the template provided in the working examples farther below.
Note that the username of the logged in Votorola/Outcast user is not currently detectable in MediaWiki pages external to the pollwiki. This means that user-oriented links such as "my draft" in the link track will not be properly disabled when they are redundant, e.g. when "my draft" is already being shown.
EntryPointS.U
Constructor and Description |
---|
MediaWikiIn() |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Called after all modules are loaded provided the call was previously scheduled.
|
void |
initFrom(Stage s,
boolean _rPending)
Here the prop or other component initializes its own properties by reference to a
previously initialized stage.
|
void |
initTo(Stage s)
Here the prop or other component initializes the properties of the stage.
|
void |
initTo(Stage s,
TheatrePage _r)
Here the prop or other component initializes the properties of the stage.
|
static void |
insertStageVTop(JavaScriptObject voGWTConfig)
Constructs a stage view and ordinarily inserts it as the first
child of the body element.
|
void |
onModuleLoad()
Called first during the load of any module M that declares an
entry-point in its declaration file M.gwt.xml , this
method (a) finalizes the configuration of any other modules
on which this one depends, and (b) ensures that any views are solidly placed that
might affect the position or size of already placed views, such as those of an
embedding page or those previously attached by other modules. |
initFromComplete, initToComplete, initUltimately
public MediaWikiIn()
public static void insertStageVTop(JavaScriptObject voGWTConfig)
public void onModuleLoad()
EntryPointS
entry-point
in its declaration file M.gwt.xml
, this
method (a) finalizes the configuration of any other modules
on which this one depends, and (b) ensures that any views are solidly placed that
might affect the position or size of already placed views, such as those of an
embedding page or those previously attached by other modules. This is to ensure
that the page content does not jitter from late attachments. Otherwise this
method depends as little as possible on other application
modules, as they might not be fully functional yet.
This method may also (c) schedule the invocation of the execute method.
onModuleLoad
in interface EntryPoint
onModuleLoad
in interface EntryPointS
public void execute()
EntryPointS
execute
in interface Scheduler.ScheduledCommand
execute
in interface EntryPointS
EntryPointS.onModuleLoad()
public void initFrom(Stage s, boolean _rPending)
TheatreInitializer
The equivalent JavaScript callback is the global function
voGWTConfig.s_gwt_stage_Stage_initFrom
. It may be defined in the
gwt.js configuration script, for
example.
initFrom
in interface TheatreInitializer
initFrom
in class TheatreInitializer0
_rPending
- whether the referrer (if any) remains to be resolved. If this
flag is true, then initialization will eventually complete at initUltimately; otherwise it will
complete earlier at initFromComplete.public void initTo(Stage s)
TheatreInitializer
The equivalent JavaScript callback is the global function
voGWTConfig.s_gwt_stage_Stage_initTo
. It may be defined in the
gwt.js configuration script, for
example.
initTo
in interface TheatreInitializer
initTo
in class TheatreInitializer0
public void initTo(Stage s, TheatrePage _r)
TheatreInitializer
r
parameter. The prop will also provide a means of selecting other
differences and of re-selecting the original one, such that the user need never
navigate back and re-transit the link for this purpose.
A prop ought generally to avoid transferring a given property from a referrer when it already has a non-default value on the destination, whether set by the scene or by another prop. By the same token, an initializer that sets a default value for a property, such as actor name, will typically null the ordinary value to ensure that the default is immediately exhibited. It is recommended however that defaults be set earlier, e.g. during module initialization.
The equivalent JavaScript callback is the global function
voGWTConfig.s_gwt_stage_Stage_initTo
. It may be defined in the
gwt.js configuration script, for
example.
initTo
in interface TheatreInitializer
initTo
in class TheatreInitializer0
_r
- the theatre page that linked to this page (referrer), or null if
there was none.