Personal wiki notebook (not under development)
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.

Toolbar.py 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. from Tags import P, Div, A, Input, Span, Br
  2. from model.Notebook import Notebook
  3. class Toolbar( Div ):
  4. def __init__( self, notebook, hide_toolbar = False, note_word = None ):
  5. Div.__init__(
  6. self,
  7. Div(
  8. P(
  9. Div( Input(
  10. type = u"button",
  11. id = u"newNote", title = u"make a new %s [ctrl-M]" % ( note_word or u"note" ),
  12. class_ = "image_button newNote_large",
  13. ), class_ = u"button_background" ),
  14. Div( Input(
  15. type = u"button",
  16. id = u"createLink", title = u"link [ctrl-L]",
  17. class_ = "image_button createLink_large",
  18. ), class_ = u"button_background" ),
  19. # Notebook.READ_WRITE_FOR_OWN_NOTES should not have a file upload button
  20. ( notebook.read_write == Notebook.READ_WRITE ) and Div( Input(
  21. type = u"button",
  22. id = u"attachFile", title = u"attach file or image",
  23. class_ = "image_button attachFile_large",
  24. ), class_ = u"button_background" ) or None,
  25. ),
  26. P(
  27. Div( Input(
  28. type = u"button",
  29. id = u"bold", title = u"bold [ctrl-B]",
  30. class_ = "image_button bold_large",
  31. ), class_ = u"button_background" ),
  32. Div( Input(
  33. type = u"button",
  34. id = u"italic", title = u"italic [ctrl-I]",
  35. class_ = "image_button italic_large",
  36. ), class_ = u"button_background" ),
  37. Div( Input(
  38. type = u"button",
  39. id = u"underline", title = u"underline [ctrl-U]",
  40. class_ = "image_button underline_large",
  41. ), class_ = u"button_background" ),
  42. Div( Input(
  43. type = u"button",
  44. id = u"strikethrough", title = u"strikethrough [ctrl-S]",
  45. class_ = "image_button strikethrough_large",
  46. ), class_ = u"button_background" ),
  47. Div( Input(
  48. type = u"button",
  49. id = u"color", title = u"text color",
  50. class_ = "image_button color_large",
  51. ), class_ = u"button_background" ),
  52. Div( Input(
  53. type = u"button",
  54. id = u"font", title = u"font",
  55. class_ = "image_button font_large",
  56. ), class_ = u"button_background" ),
  57. Div( Input(
  58. type = u"button",
  59. id = u"title", title = u"title",
  60. class_ = "image_button title_large",
  61. ), class_ = u"button_background" ),
  62. ),
  63. P(
  64. Div( Input(
  65. type = u"button",
  66. id = u"insertUnorderedList", title = u"bullet list [ctrl-period]",
  67. class_ = "image_button insertUnorderedList_large",
  68. ), class_ = u"button_background" ),
  69. Div( Input(
  70. type = u"button",
  71. id = u"insertOrderedList", title = u"numbered list [ctrl-1]",
  72. class_ = "image_button insertOrderedList_large",
  73. ), class_ = u"button_background" ),
  74. ),
  75. class_ = u"button_wrapper",
  76. ),
  77. id = u"toolbar",
  78. class_ = hide_toolbar and u"undisplayed" or None,
  79. )