witten
/
luminotes
Archived
1
0
Fork 0
This repository has been archived on 2023-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
luminotes/view/Toolbar.py

83 lines
3.0 KiB
Python
Raw Permalink Normal View History

from Tags import P, Div, A, Input, Span, Br
2008-10-27 23:23:27 +00:00
from model.Notebook import Notebook
class Toolbar( Div ):
2008-10-27 23:23:27 +00:00
def __init__( self, notebook, hide_toolbar = False, note_word = None ):
Div.__init__(
self,
Div(
P(
Div( Input(
type = u"button",
id = u"newNote", title = u"make a new %s [ctrl-M]" % ( note_word or u"note" ),
2009-04-24 00:46:06 +00:00
class_ = "image_button newNote_large",
), class_ = u"button_background" ),
Div( Input(
type = u"button",
id = u"createLink", title = u"link [ctrl-L]",
2009-04-24 00:46:06 +00:00
class_ = "image_button createLink_large",
), class_ = u"button_background" ),
2008-10-27 23:23:27 +00:00
# Notebook.READ_WRITE_FOR_OWN_NOTES should not have a file upload button
( notebook.read_write == Notebook.READ_WRITE ) and Div( Input(
type = u"button",
id = u"attachFile", title = u"attach file or image",
2009-04-24 00:46:06 +00:00
class_ = "image_button attachFile_large",
), class_ = u"button_background" ) or None,
),
P(
Div( Input(
type = u"button",
id = u"bold", title = u"bold [ctrl-B]",
2009-04-24 00:46:06 +00:00
class_ = "image_button bold_large",
), class_ = u"button_background" ),
Div( Input(
type = u"button",
id = u"italic", title = u"italic [ctrl-I]",
2009-04-24 00:46:06 +00:00
class_ = "image_button italic_large",
), class_ = u"button_background" ),
Div( Input(
type = u"button",
id = u"underline", title = u"underline [ctrl-U]",
2009-04-24 00:46:06 +00:00
class_ = "image_button underline_large",
), class_ = u"button_background" ),
2008-05-14 00:07:02 +00:00
Div( Input(
type = u"button",
2008-05-14 00:07:02 +00:00
id = u"strikethrough", title = u"strikethrough [ctrl-S]",
2009-04-24 00:46:06 +00:00
class_ = "image_button strikethrough_large",
), class_ = u"button_background" ),
Div( Input(
type = u"button",
id = u"color", title = u"text color",
class_ = "image_button color_large",
), class_ = u"button_background" ),
Div( Input(
type = u"button",
id = u"font", title = u"font",
2009-04-24 00:46:06 +00:00
class_ = "image_button font_large",
), class_ = u"button_background" ),
Div( Input(
type = u"button",
id = u"title", title = u"title",
2009-04-24 00:46:06 +00:00
class_ = "image_button title_large",
), class_ = u"button_background" ),
),
P(
Div( Input(
type = u"button",
id = u"insertUnorderedList", title = u"bullet list [ctrl-period]",
2009-04-24 00:46:06 +00:00
class_ = "image_button insertUnorderedList_large",
), class_ = u"button_background" ),
Div( Input(
type = u"button",
id = u"insertOrderedList", title = u"numbered list [ctrl-1]",
2009-04-24 21:31:03 +00:00
class_ = "image_button insertOrderedList_large",
), class_ = u"button_background" ),
),
class_ = u"button_wrapper",
),
id = u"toolbar",
class_ = hide_toolbar and u"undisplayed" or None,
)