Skip to content

Instantly share code, notes, and snippets.

@jdlrobson
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdlrobson/78047e537434977c3649 to your computer and use it in GitHub Desktop.
Save jdlrobson/78047e537434977c3649 to your computer and use it in GitHub Desktop.
'mobile.editor.ws' => $wgMFMobileResourceBoilerplate + array(
'dependencies' => array(
'mobile.editor',
),
'scripts' => array(
'javascripts/modules/editor/ws.js',
),
),
( function( M, $ ) {
function toggleImage( overlay ) {
overlay.$( 'textarea' ).toggle();
}
M.on( 'editor.postRender', function( overlay ) {
var $container = $( '<li>' ).appendTo( overlay.$( '.overlay-header ul' ).eq( 0 ) );
$( '<button>' ).text( 'View' ).on( 'click', function() {
toggleImage( overlay );
} ).appendTo( $container );
$( '<img>' ).insertAfter( overlay.$( '.content' ) );
} );
}( mw.mobileFrontend, jQuery ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment