Content deleted Content added
Writ Keeper (talk | contribs) fix |
maintenance: more info Uncaught TypeError: Cannot read property 'ButtonInputWidget' of undefined (oojs ui is not always loaded) |
||
Line 20:
});
}
var previewDiffButton = new OO.ui.ButtonInputWidget({label:'Show preview and changes', useInputTag: true, value: 'wpPreview', name: 'wpPreview', type:"submit", accessKey:"o", tabIndex: ($("#wpDiff").prop("tabIndex") + 1)});▼
mw.loader.using('oojs-ui').then(function () {
previewDiffButton.setTitle("Show a preview of your changes, as well as a diff of what you changed");▼
▲ var previewDiffButton = new OO.ui.ButtonInputWidget({label:'Show preview and changes', useInputTag: true, value: 'wpPreview', name: 'wpPreview', type:"submit", accessKey:"o", tabIndex: ($("#wpDiff").prop("tabIndex") + 1)});
▲ previewDiffButton.setTitle("Show a preview of your changes, as well as a diff of what you changed");
$("#wpDiffWidget").after(previewDiffButton.$element);▼
previewDiffButton.$element.children("input").click(function()▼
▲ $("#wpDiffWidget").after(previewDiffButton.$element);
{▼
▲ previewDiffButton.$element.children("input").click(function()
var formAction = $("#editform").attr("action");▼
▲ {
$("#editform").attr("action", formAction+"&previewanddiff=true");▼
▲ var formAction = $("#editform").attr("action");
▲ $("#editform").attr("action", formAction+"&previewanddiff=true");
});
});
}
|