Class: Notes::NotesBlock
Instance Attribute Summary collapse
-
#after_header ⇒ Object
Returns the value of attribute after_header.
-
#header ⇒ Object
Returns the value of attribute header.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#archive ⇒ Object
cuts the block, and stores it in archive.file.notes example: ruby.notes -> archive.ruby.notes.
- #blink ⇒ Object
- #content ⇒ Object
- #delete_content ⇒ Object
- #fade_in ⇒ Object
- #fade_out ⇒ Object
- #hide_text ⇒ Object
-
#initialize(left, after_header, right) ⇒ NotesBlock
constructor
A new instance of NotesBlock.
- #positions ⇒ Object
-
#show_text ⇒ Object
initialize an overlay for this notes block it has a special hook that updates name to be header always this way we can always find the overlay corresponding to header.
- #to_s ⇒ Object
Constructor Details
#initialize(left, after_header, right) ⇒ NotesBlock
Returns a new instance of NotesBlock.
752 753 754 755 756 |
# File 'lib/xiki/notes.rb', line 752 def initialize(left, after_header, right) @left, @after_header, @right = left, after_header, right @header = $el.buffer_substring left, after_header @text = $el.buffer_substring after_header, right end |
Instance Attribute Details
#after_header ⇒ Object
Returns the value of attribute after_header.
749 750 751 |
# File 'lib/xiki/notes.rb', line 749 def after_header @after_header end |
#header ⇒ Object
Returns the value of attribute header.
750 751 752 |
# File 'lib/xiki/notes.rb', line 750 def header @header end |
#left ⇒ Object
Returns the value of attribute left.
749 750 751 |
# File 'lib/xiki/notes.rb', line 749 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
749 750 751 |
# File 'lib/xiki/notes.rb', line 749 def right @right end |
#text ⇒ Object
Returns the value of attribute text.
750 751 752 |
# File 'lib/xiki/notes.rb', line 750 def text @text end |
Instance Method Details
#archive ⇒ Object
cuts the block, and stores it in archive.file.notes example: ruby.notes -> archive.ruby.notes
806 807 808 809 810 811 812 |
# File 'lib/xiki/notes.rb', line 806 def archive delete_content filename = 'archive.' + $el.file_name_nondirectory(buffer_file_name) = "--- archived on #{Time.now.strftime('%Y-%m-%d at %H:%M')} --- \n" $el.append_to_file , nil, filename $el.append_to_file content, nil, filename end |
#blink ⇒ Object
770 771 772 |
# File 'lib/xiki/notes.rb', line 770 def blink Effects.blink :left => after_header, :right => right end |
#content ⇒ Object
762 763 764 |
# File 'lib/xiki/notes.rb', line 762 def content header + text end |
#delete_content ⇒ Object
782 783 784 |
# File 'lib/xiki/notes.rb', line 782 def delete_content $el.delete_region left, right end |
#fade_in ⇒ Object
778 779 780 |
# File 'lib/xiki/notes.rb', line 778 def fade_in Effects.glow :fade_in=>1, :what=>[left, right] end |
#fade_out ⇒ Object
774 775 776 |
# File 'lib/xiki/notes.rb', line 774 def fade_out Effects.glow :fade_out=>1, :what=>[left, right] end |
#hide_text ⇒ Object
797 798 799 800 801 802 |
# File 'lib/xiki/notes.rb', line 797 def hide_text @header_overlay ||= Overlay.find_or_make(left, after_header - 1) @body_overlay ||= Overlay.find_or_make(after_header, right) @body_overlay.invisible = true end |
#positions ⇒ Object
758 759 760 |
# File 'lib/xiki/notes.rb', line 758 def positions [left, after_header, right] end |
#show_text ⇒ Object
initialize an overlay for this notes block it has a special hook that updates name to be header always this way we can always find the overlay corresponding to header
790 791 792 793 794 795 |
# File 'lib/xiki/notes.rb', line 790 def show_text @header_overlay ||= Overlay.find_or_make(left, after_header - 1) @body_overlay ||= Overlay.find_or_make(after_header, right) @body_overlay.invisible = false end |
#to_s ⇒ Object
766 767 768 |
# File 'lib/xiki/notes.rb', line 766 def to_s content end |