mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
23 lines
No EOL
624 B
JavaScript
23 lines
No EOL
624 B
JavaScript
require(["gitbook", "jQuery"], function(gitbook, $) {
|
|
gitbook.events.bind('start', function (e, config) {
|
|
var conf = config.editlink
|
|
var label = conf.label
|
|
var base = conf.base
|
|
var multilingual = conf.multilingual || false
|
|
|
|
if (base.slice(-1) !== "/") {
|
|
base += "/"
|
|
}
|
|
|
|
gitbook.toolbar.createButton({
|
|
icon: 'fa fa-edit',
|
|
text: label,
|
|
onClick: function() {
|
|
var filepath = gitbook.state.filepath
|
|
var lang = multilingual && $('html').attr('lang') ? $('html').attr('lang') + '/' : ''
|
|
|
|
window.open(base + lang + filepath)
|
|
}
|
|
})
|
|
})
|
|
}) |