User:DreamRimmer/MergeHelper.js: Difference between revisions

Content deleted Content added
create
 
tweak
 
(8 intermediate revisions by the same user not shown)
Line 8:
page2Input = new OO.ui.TextInputWidget({ placeholder: 'Destination page' }),
loadBtn = new OO.ui.ButtonWidget({ label: 'Load wikitext', flags: ['primary'] }),
page1Text = new OO.ui.MultilineTextInputWidget({ placeholder: 'Wikitext:Source +page page1Namewikitext', autosize: true, rows: 20, disabled: true }),
page2Text = new OO.ui.MultilineTextInputWidget({ placeholder: 'Wikitext:Destination +page page2Namewikitext', autosize: true, rows: 20, disabled: true }),
summary1Input = new OO.ui.TextInputWidget({ placeholder: 'Summary:Edit + page1Namesummary' }),
summary2Input = new OO.ui.TextInputWidget({ placeholder: 'Summary:Edit + page2Namesummary' }),
redirectCheck = new OO.ui.CheckboxInputWidget({ selected: false }).on('change', updateRedirect),
previewBtn = new OO.ui.ButtonWidget({ label: 'Preview Changes', flags: ['primary'], disabled: true }),
Line 17:
cancelBtn = new OO.ui.ButtonWidget({ label: 'Cancel', flags: ['primary', 'destructive'], href: 'https:' + mw.config.get('wgServer') }),
logDiv = $("<div>").hide(),
redirectDiv = $('<div>').css({ 'display': 'flex', 'align-items': 'center', 'gap': '10px' }).append(redirectCheck.$element, $('<p>').text('Redirect the firstsource page to the seconddestination page')).hide();
 
$('#mw-content-text').append(
$('<p>').text('FirstSource Pagepage:').css('font-weight', 'bold'), page1Input.$element,
$('<p>').text('SecondDestination Pagepage:').css('font-weight', 'bold'), page2Input.$element,
loadBtn.$element,
$('<div>').css({ 'display': 'flex', 'gap': '10px' }).append(
$('<div>').css({ 'flex': '1', 'border': '1px solid #ccc', 'padding': '10px', 'box-sizing': 'border-box', 'min-width': '45%', 'max-width': '45%', 'overflow': 'auto' }).append(
$('<p>').text('WikitextSource ofpage the First Pagewikitext:').css('font-weight', 'bold'), page1Text.$element
),
$('<div>').css({ 'flex': '1', 'border': '1px solid #ccc', 'padding': '10px', 'box-sizing': 'border-box', 'min-width': '45%', 'max-width': '45%', 'overflow': 'auto' }).append(
$('<p>').text('WikitextDestination ofpage the Second Pagewikitext:').css('font-weight', 'bold'), page2Text.$element
)
),
$('<div>').css({ 'display': 'flex', 'gap': '10px' }).append(
$('<div>').css({ 'flex': '1', 'border': '1px solid #ccc', 'padding': '10px', 'box-sizing': 'border-box', 'min-width': '45%', 'max-width': '45%', 'overflow': 'auto' }).append(
$('<p>').text('Summary for First Page:').css('font-weight', 'bold'), summary1Input.$element
),
$('<div>').css({ 'flex': '1', 'border': '1px solid #ccc', 'padding': '10px', 'box-sizing': 'border-box', 'min-width': '45%', 'max-width': '45%', 'overflow': 'auto' }).append(
$('<p>').text('Summary for Second Page:').css('font-weight', 'bold'), summary2Input.$element
)
),
Line 135:
content2 = page2Text.getValue();
 
var preview1 = $('<div>').css({ border: '1px solid #ccc', padding: '10px', margin: '10px', flex: '1', overflow: 'auto', height: '1000px', width: '412px' });
var preview2 = $('<div>').css({ border: '1px solid #ccc', padding: '10px', margin: '10px', flex: '1', overflow: 'auto', height: '1000px', width: '412px' });
 
logDiv.empty().append(
Line 152:
var page1Name = page1Input.getValue().trim(),
page2Name = page2Input.getValue().trim(),
summary1 = summary1Input.getValue().trim() + " (using [[User:DreamRimmer/MergeHelper|MergeHelper.js]])",
summary2 = summary2Input.getValue().trim() + " (using [[User:DreamRimmer/MergeHelper|MergeHelper.js]])",
content1 = page1Text.getValue(),
content2 = page2Text.getValue();