2023-08-15 05:53:00 -04:00
|
|
|
import App from '../../base'
|
|
|
|
import importOverleafModules from '../../../macros/import-overleaf-module.macro'
|
|
|
|
|
|
|
|
const eModules = importOverleafModules('editorToolbarButtons')
|
|
|
|
const editorToolbarButtons = eModules.map(item => item.import.default)
|
|
|
|
|
2023-10-13 05:13:49 -04:00
|
|
|
export default App.controller('EditorToolbarController', [
|
|
|
|
'$scope',
|
|
|
|
'ide',
|
|
|
|
function ($scope, ide) {
|
|
|
|
const editorButtons = []
|
2023-08-15 05:53:00 -04:00
|
|
|
|
2023-10-13 05:13:49 -04:00
|
|
|
for (const editorToolbarButton of editorToolbarButtons) {
|
|
|
|
const button = editorToolbarButton.button($scope, ide)
|
2023-08-15 05:53:00 -04:00
|
|
|
|
2023-10-13 05:13:49 -04:00
|
|
|
if (editorToolbarButton.source) {
|
|
|
|
editorButtons.push(button)
|
|
|
|
}
|
2023-08-15 05:53:00 -04:00
|
|
|
}
|
|
|
|
|
2023-10-13 05:13:49 -04:00
|
|
|
$scope.editorButtons = editorButtons
|
|
|
|
},
|
|
|
|
])
|