2007-09-28 05:07:14 +00:00
|
|
|
from Tags import P, Div, A, Input, Span, Br
|
2008-10-27 23:23:27 +00:00
|
|
|
from model.Notebook import Notebook
|
2007-07-16 20:22:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Toolbar( Div ):
|
2008-10-27 23:23:27 +00:00
|
|
|
def __init__( self, notebook, hide_toolbar = False, note_word = None ):
|
2007-07-16 20:22:38 +00:00
|
|
|
Div.__init__(
|
|
|
|
self,
|
2007-09-28 05:07:14 +00:00
|
|
|
Div(
|
|
|
|
P(
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2008-12-03 23:11:49 +00:00
|
|
|
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",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2007-10-25 23:19:57 +00:00
|
|
|
id = u"createLink", title = u"link [ctrl-L]",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button createLink_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), 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(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2008-06-19 00:14:07 +00:00
|
|
|
id = u"attachFile", title = u"attach file or image",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button attachFile_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ) or None,
|
2007-09-28 05:07:14 +00:00
|
|
|
),
|
|
|
|
P(
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2007-10-25 23:19:57 +00:00
|
|
|
id = u"bold", title = u"bold [ctrl-B]",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button bold_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2007-10-25 23:19:57 +00:00
|
|
|
id = u"italic", title = u"italic [ctrl-I]",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button italic_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2007-10-25 23:19:57 +00:00
|
|
|
id = u"underline", title = u"underline [ctrl-U]",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button underline_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2008-05-14 00:07:02 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
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",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2009-05-14 23:20:43 +00:00
|
|
|
Div( Input(
|
|
|
|
type = u"button",
|
|
|
|
id = u"color", title = u"text color",
|
|
|
|
class_ = "image_button color_large",
|
|
|
|
), class_ = u"button_background" ),
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2008-12-11 07:21:44 +00:00
|
|
|
id = u"font", title = u"font",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button font_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2008-12-23 08:27:44 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2008-12-23 08:27:44 +00:00
|
|
|
id = u"title", title = u"title",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button title_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2007-09-28 05:07:14 +00:00
|
|
|
),
|
|
|
|
P(
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2007-10-25 23:19:57 +00:00
|
|
|
id = u"insertUnorderedList", title = u"bullet list [ctrl-period]",
|
2009-04-24 00:46:06 +00:00
|
|
|
class_ = "image_button insertUnorderedList_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2007-10-25 23:19:57 +00:00
|
|
|
Div( Input(
|
2009-03-29 19:23:55 +00:00
|
|
|
type = u"button",
|
2007-10-25 23:19:57 +00:00
|
|
|
id = u"insertOrderedList", title = u"numbered list [ctrl-1]",
|
2009-04-24 21:31:03 +00:00
|
|
|
class_ = "image_button insertOrderedList_large",
|
2009-03-29 19:23:55 +00:00
|
|
|
), class_ = u"button_background" ),
|
2007-09-28 05:07:14 +00:00
|
|
|
),
|
|
|
|
class_ = u"button_wrapper",
|
2007-07-16 20:22:38 +00:00
|
|
|
),
|
2007-10-25 23:19:57 +00:00
|
|
|
|
2007-07-16 20:22:38 +00:00
|
|
|
id = u"toolbar",
|
2007-10-16 21:37:12 +00:00
|
|
|
class_ = hide_toolbar and u"undisplayed" or None,
|
2007-07-16 20:22:38 +00:00
|
|
|
)
|