Gadget:InhaltGadget.js

Aus Mythopedia
ve.ui.MyTool = function () { 

var surfaceModel = ve.init.target.getSurface().getModel();
surfaceModel.getFragment().collapseToEnd().insertContent(
  [
    {
      type: 'mwTransclusionInline',
      attributes: {
        mw: {
          parts: [
            {
              template: {
                target: {
                  href: 'Template:Inhalt',
                  wt: 'Inhalt'
                },
                params: {
                  1: { wt: 'Mitraspera' },
                  2: { wt: '-' },
                  3: { wt: '-' },
                  4: { wt: '2019' }
                }
              }
            }
          ]
        }
      }
    }
  ]
).collapseToEnd().select();

}