not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8 KiB

  1. // Toolbar item
  2. var ToolbarItem = {
  3. template: `
  4. <div class="splitbar" v-if="isSplitbar"/>
  5. <button v-on:click="onClick()" v-bind:id="id" v-bind:title="title" v-bind:class="toRight ? 'toolbutton pull-right' : 'toolbutton'" v-else/>
  6. `,
  7. props: ['id', 'title', 'isSplitbar', 'toRight'],
  8. methods: {
  9. onClick: function() {
  10. this.$emit('clicked');
  11. }
  12. }
  13. }
  14. // Toolbar component
  15. var Toolbar = {
  16. components: {'toolbar-item': ToolbarItem},
  17. template: `
  18. <div id="main-toolbar" class="toolbar">
  19. <toolbar-item id="activity-button" v-bind:title="l10n.stringEbookReaderActivity"></toolbar-item>
  20. <toolbar-item isSplitbar="true"></toolbar-item>
  21. <toolbar-item ref="switchbutton" v-on:clicked="getApp().switchView()" class="toolbutton" id="library-button" v-bind:title="l10n.stringLibrary"></toolbar-item>
  22. <div class="splitbar"></div>
  23. <toolbar-item ref="settings" v-on:clicked="getApp().setLibraryUrl()" class="toolbutton" id="settings-button" v-bind:title="l10n.stringSettings"></toolbar-item>
  24. <toolbar-item v-on:clicked="getApp().onStop()" id="stop-button" title="Stop" toRight="true"></toolbar-item>
  25. <toolbar-item ref="fullscreen" v-on:clicked="getApp().fullscreen()" id="fullscreen-button" v-bind:title="l10n.stringFullscreen" toRight="true"></toolbar-item>
  26. <toolbar-item v-on:clicked="getApp().onHelp()" id="help-button" v-bind:title="l10n.stringHelp" toRight="true"></toolbar-item>
  27. </div>
  28. `,
  29. data: function() {
  30. return {
  31. l10n: {
  32. stringEbookReaderActivity: '',
  33. stringPrevious: '',
  34. stringNext: '',
  35. stringLibrary: '',
  36. stringSettings: '',
  37. stringHelp: '',
  38. stringFullscreen: ''
  39. }
  40. }
  41. },
  42. methods: {
  43. localized: function(localization) {
  44. var vm = this;
  45. Object.keys(this.l10n).forEach(function(key, index) {
  46. vm.l10n[key] = localization.get(key.substr(6));
  47. });
  48. },
  49. getApp: function() {
  50. return app;
  51. }
  52. }
  53. }