Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
To contact staff directly or to report bugs, please use Special:Contact.
How do I add and create a dropdown menu for summary, and a dropdown menu for images copyright? Tedjuh10
- Well in your wikis MediaWiki:Common.js you could add:
// 2.- Edit Menu // From http://www.sourcewatch.org/index.php?title=MediaWiki:Monobook.js#Edit_summary_stuff // Modify by [[User:Cizagna]] // The original value of the edit summary field is stored here var editsummOriginalSummary = new String(); // A global ref to the dropdown with canned edit summaries var editsummDropdown = null; function editsummInitialize() { var label = document.getElementById('wpSummaryLabel'); if(label == null) return; label.firstChild.style.cssText = 'display:none'; // Save the original value of the edit summary field editsummOriginalSummary = document.forms.editform.wpSummary.value; // For convenience, add a dropdown box with some canned edit // summaries to the form. var dropdown = document.createElement('select'); dropdown.setAttribute('title', 'Standard Summaries') dropdown.style.cssText = 'margin-top:3px;'; dropdown.onchange = new Function('editsummOnCannedSummarySelected()'); addDropdownOption(dropdown,'','(Summary)'); addDropdownOption(dropdown,'','Refactoring:'); addDropdownOption(dropdown,'Cleanup','— Cleanup'); addDropdownOption(dropdown,'Formating','— Formatting'); addDropdownOption(dropdown,'HTML tidying','— HTML tidying'); addDropdownOption(dropdown,'Wikification','— Wikification'); addDropdownOption(dropdown,'','Content:'); addDropdownOption(dropdown,'Page created','— Page created'); addDropdownOption(dropdown,'Update with new info.','— Update with new info.'); addDropdownOption(dropdown,'Expansion','— Expansion'); addDropdownOption(dropdown,'Rewrite','— Rewrite'); addDropdownOption(dropdown,'Fix spelling/grammar','— Corrected spelling/grammar'); addDropdownOption(dropdown,'','Remove/Revert:'); addDropdownOption(dropdown,'Revert Vandalism','— Revert Vandalism'); addDropdownOption(dropdown,'-unverified info','— Remove unverified info'); addDropdownOption(dropdown,'','Templates:'); addDropdownOption(dropdown,'+Infobox','— Added Infobox'); addDropdownOption(dropdown,'Corrected template usage','— Corrected template usage'); addDropdownOption(dropdown,'','Categories:'); addDropdownOption(dropdown,'+Cat','— Added Category'); addDropdownOption(dropdown,'-Cat','— Remove Category'); addDropdownOption(dropdown,'Alphabetized ""','— Alphabetized '); /*addDropdownOption(dropdown,'',''); addDropdownOption(dropdown,'','');*/ label.appendChild(dropdown); // Store a global ref to it editsummDropdown = dropdown; var onMonaco = skin == 'monaco' ? true : false; if(onMonaco) { // even thougth this can be configure by MediaWiki pages its better this way so it only affects monaco pages document.getElementById('wpMinoredit').nextSibling.nextSibling.innerHTML = 'Minor'; document.getElementById('wpWatchthis').nextSibling.nextSibling.innerHTML = 'Watch'; }else { var wpSumamaryCssSize = document.getElementById('wpSummary'); wpSumamaryCssSize.style.cssText = 'width:70%'; //FF wpSumamaryCssSize.size = '60'; //IE } } // Adds options to the drop down menu on "editsummInitialize()" function addDropdownOption(dropdown,optionValue,optionText) { var option = document.createElement('option'); option.setAttribute('value', optionValue) option.appendChild(document.createTextNode(optionText)); dropdown.appendChild(option); } // There's a cross-browser issue when accessing the selected text: // *In Firefox you can use: selectObj.value // *In IE, you have to use: selectObj.options[selectObj.selectedIndex].text // *The latter method also works in Firefox function editsummOnCannedSummarySelected() { var newSummary = editsummOriginalSummary; if(newSummary.length!=0) newSummary += " - "; var idx = editsummDropdown.selectedIndex; var canned = editsummDropdown.options[idx].value; newSummary += canned; document.forms.editform.wpSummary.value = newSummary; } addOnloadHook(editsummInitialize);
- Modify as need it should work you can see the list up there the first value is for what will be add and the 2nd how it will look on the dropdown. Just remember i have copy this from other wiki and adapt it to wikia but only have test it for my self not release it on the wikis i administrate so there is a potential for uknown issues. --17:03, 28 May 2009 (UTC)
MediaWiki:Licenses is less complicated if you want to modify that instead. --Michaeldsuarez (Talk) (Deeds) 19:48, 28 May 2009 (UTC)
- Even thought it covers the first request and looks like i forgot the 2nd part that would be the same as Michael gave. The biggest difference is that the JS will cover most of the wiki summaries and will not interfere with the normal dropdowns, and part of its complications is because monaco's modifications and IE being a stubborn... the rest of MediaWiki dropdowns are:
- MediaWiki:deletereason-dropdown deletion of pages
- MediaWiki:filedelete-reason-dropdown file deletion
- MediaWiki:ipbreason-dropdown ip block
- --22:27, 28 May 2009 (UTC)