Module: FCKEditor

Instance Method Summary collapse

Instance Method Details

#enter_source_text(editor, text) ⇒ Object



15
16
17
18
19
# File 'lib/sambal-cle/rich_text.rb', line 15

def enter_source_text(editor, text)
  source(editor)
  source_field(editor).wait_until_present
  source_field(editor).set text
end

#entity_picker(editor) ⇒ Object



33
34
35
36
37
38
# File 'lib/sambal-cle/rich_text.rb', line 33

def entity_picker(editor)
  editor.div(:title=>"Sakai_Entity_Link").wait_until_present
  editor.div(:title=>"Sakai_Entity_Link").click
  @browser.frame(:index=>2).frame(:id=>"frmMain").button(:value=>"Browse Server").click
  @browser.window(:index=>1).use
end

#get_source_text(editor) ⇒ Object



21
22
23
24
25
# File 'lib/sambal-cle/rich_text.rb', line 21

def get_source_text(editor)
  source(editor)
  source_field(editor).wait_until_present
  source_field(editor).value
end

#prepend(editor, string) ⇒ Object

Adds the specified string of text to the beginning of the existing text in the target FCKEditor.



29
30
31
# File 'lib/sambal-cle/rich_text.rb', line 29

def prepend(editor, string)
  editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(string)
end

#select_all(editor) ⇒ Object



10
11
12
13
# File 'lib/sambal-cle/rich_text.rb', line 10

def select_all(editor)
  editor.div(:title=>"Select All").wait_until_present
  editor.div(:title=>"Select All").click
end

#source(editor) ⇒ Object

This has to be defined this way because there several pages that have multiple rich text editors.



5
6
7
8
# File 'lib/sambal-cle/rich_text.rb', line 5

def source(editor)
  editor.div(:title=>/Source/).wait_until_present
  editor.div(:title=>/Source/).click
end

#source_field(editor) ⇒ Object



40
41
42
# File 'lib/sambal-cle/rich_text.rb', line 40

def source_field(editor)
  editor.text_field(:class=>"SourceField")
end