User:MidPhoto/add building address.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
jQuery(function($) {
var editor = $('#wpTextbox1');
if (editor && editor.wikiEditor) {
editor.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'insert',
tools: {
buttonId: {
label: 'Add Building address',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1c/SymbolPost.svg/24px-SymbolPost.svg.png',
action: {
type: 'encapsulate',
options: {
pre: '{{Building address\n' +
' | Street name = \n' +
' | House number = \n' +
' | City = \n' +
' | Postal code = \n' +
' | State = NL-\n' +
' | Country = NL\n' +
' | Listing = \n' +
'}}\n'
}
}
}
}
});
}
});