MediaWiki:Common.js: Unterschied zwischen den Versionen

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
/* Das folgende JavaScript wird für alle Benutzer geladen. */
var surfaceModel = ve.init.target.getSurface().getModel();
var surfaceModel = ve.init.target.getSurface().getModel();
surfaceModel.getFragment().collapseToEnd().insertContent(
surfaceModel.getFragment()
  [
.adjustLinearSelection( 1 )
    {
.collapseToStart()
      type: 'mwTransclusionInline',
.insertContent( [
      attributes: {
{ type: 'table' },
        mw: {
{ type: 'tableCaption' },
          parts: [
{ type: 'paragraph' }, 'C', 'a', 'p', 't', 'i', 'o', 'n', { type: '/paragraph' },
            {
{ type: '/tableCaption' },
              template: {
{ type: 'tableSection', attributes: { style: 'body' } },
                target: {
{ type: 'tableRow' },
                  href: 'Template:cite web',
{ type: 'tableCell', attributes: { style: 'header' } },
                  wt: 'cite web'
{ type: 'paragraph' }, 'A', { type: '/paragraph' },
                },
{ type: '/tableCell' },
                params: {
{ type: 'tableCell', attributes: { style: 'data' } },
                  first: { wt: 'first name' },
{ type: 'paragraph' }, 'A', '1', { type: '/paragraph' },
                  last: { wt: 'last name' },
{ type: '/tableCell' },
                  title: { wt: 'title' },
{ type: 'tableCell', attributes: { style: 'data' } },
                  url: { wt: 'http://en.wikipedia.org' }
{ type: 'paragraph' }, 'A', '2', { type: '/paragraph' },
                }
{ type: '/tableCell' },
              }
{ type: 'tableCell', attributes: { style: 'data' } },
            }
{ type: 'paragraph' }, 'A', '3', { type: '/paragraph' },
          ]
{ type: '/tableCell' },
        }
{ type: '/tableRow' },
      }
{ type: 'tableRow' },
    }
{ type: 'tableCell', attributes: { style: 'header' } },
  ]
{ type: 'paragraph' }, 'B', { type: '/paragraph' },
).collapseToEnd().select();
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'B', '1', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'B', '2', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: 'tableCell', attributes: { style: 'data' } },
{ type: 'paragraph' }, 'B', '3', { type: '/paragraph' },
{ type: '/tableCell' },
{ type: '/tableRow' },
{ type: '/tableSection' },
{ type: '/table' }
] );

Version vom 1. Februar 2016, 18:17 Uhr

var surfaceModel = ve.init.target.getSurface().getModel();
surfaceModel.getFragment()
	.adjustLinearSelection( 1 )
	.collapseToStart()
	.insertContent( [
		{ type: 'table' },
		{ type: 'tableCaption' },
			{ type: 'paragraph' }, 'C', 'a', 'p', 't', 'i', 'o', 'n', { type: '/paragraph' },
		{ type: '/tableCaption' },
		{ type: 'tableSection', attributes: { style: 'body' } },
		{ type: 'tableRow' },
		{ type: 'tableCell', attributes: { style: 'header' } },
			{ type: 'paragraph' }, 'A', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: 'tableCell', attributes: { style: 'data' } },
			{ type: 'paragraph' }, 'A', '1', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: 'tableCell', attributes: { style: 'data' } },
			{ type: 'paragraph' }, 'A', '2', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: 'tableCell', attributes: { style: 'data' } },
			{ type: 'paragraph' }, 'A', '3', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: '/tableRow' },
		{ type: 'tableRow' },
		{ type: 'tableCell', attributes: { style: 'header' } },
			{ type: 'paragraph' }, 'B', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: 'tableCell', attributes: { style: 'data' } },
			{ type: 'paragraph' }, 'B', '1', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: 'tableCell', attributes: { style: 'data' } },
			{ type: 'paragraph' }, 'B', '2', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: 'tableCell', attributes: { style: 'data' } },
			{ type: 'paragraph' }, 'B', '3', { type: '/paragraph' },
		{ type: '/tableCell' },
		{ type: '/tableRow' },
		{ type: '/tableSection' },
		{ type: '/table' }
	] );