Added underline button to toolbar. Useful for things like book titles.
This commit is contained in:
parent
62b222f2d9
commit
e2d85b79a5
|
@ -36,6 +36,7 @@ class Html_cleaner(HTMLParser):
|
|||
'ul',
|
||||
'p',
|
||||
'strong',
|
||||
'u',
|
||||
]
|
||||
|
||||
# A list of tags that are forcibly removed from the input. Tags that
|
||||
|
|
|
@ -86,6 +86,10 @@ ol li {
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
#underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -101,6 +101,7 @@ Wiki.prototype.populate = function ( result ) {
|
|||
connect( window, "onunload", function ( event ) { self.editor_focused( null, true ); } );
|
||||
connect( "bold", "onclick", function ( event ) { self.toggle_button( event, "bold" ); } );
|
||||
connect( "italic", "onclick", function ( event ) { self.toggle_button( event, "italic" ); } );
|
||||
connect( "underline", "onclick", function ( event ) { self.toggle_button( event, "underline" ); } );
|
||||
connect( "title", "onclick", function ( event ) { self.toggle_button( event, "title", "h3" ); } );
|
||||
connect( "insertUnorderedList", "onclick", function ( event ) { self.toggle_button( event, "insertUnorderedList" ); } );
|
||||
connect( "insertOrderedList", "onclick", function ( event ) { self.toggle_button( event, "insertOrderedList" ); } );
|
||||
|
@ -442,6 +443,9 @@ Wiki.prototype.editor_key_pressed = function ( editor, event ) {
|
|||
// ctrl-i: italic
|
||||
} else if ( code == 73 ) {
|
||||
this.toggle_button( event, "italic" );
|
||||
// ctrl-u: underline
|
||||
} else if ( code == 85 ) {
|
||||
this.toggle_button( event, "underline" );
|
||||
// ctrl-t: title
|
||||
} else if ( code == 84 ) {
|
||||
this.toggle_button( event, "title", "h3" );
|
||||
|
@ -498,6 +502,7 @@ Wiki.prototype.update_toolbar = function() {
|
|||
if ( this.focused_editor ) {
|
||||
this.update_button( "bold" );
|
||||
this.update_button( "italic" );
|
||||
this.update_button( "underline" );
|
||||
this.update_button( "title", "h3" );
|
||||
this.update_button( "insertUnorderedList" );
|
||||
this.update_button( "insertOrderedList" );
|
||||
|
|
|
@ -8,6 +8,7 @@ class Toolbar( Div ):
|
|||
Ul(
|
||||
Li( Input( type = u"button", value = u"B", id = u"bold", title = u"bold [ctrl-B]", class_ = u"button" ) ),
|
||||
Li( Input( type = u"button", value = u"I", id = u"italic", title = u"italic [ctrl-I]", class_ = u"button" ) ),
|
||||
Li( Input( type = u"button", value = u"U", id = u"underline", title = u"underline [ctrl-U]", class_ = u"button" ) ),
|
||||
Li( Input( type = u"button", value = u"T", id = u"title", title = u"title [ctrl-T]", class_ = u"button" ) ),
|
||||
Li( Input( type = u"button", value = u"•", id = u"insertUnorderedList", title = u"unordered list [ctrl-U]", class_ = u"button" ) ),
|
||||
Li( Input( type = u"button", value = u"1.", id = u"insertOrderedList", title = u"numbered list [ctrl-1]", class_ = u"button" ) ),
|
||||
|
|
Reference in New Issue