This repository has been archived by the owner on Aug 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
did some work on the form builder page plugin
- Loading branch information
Josh Adams
committed
Jan 18, 2009
1 parent
0209659
commit 436d193
Showing
5 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Fckeditor | ||
module Helper | ||
def fckeditor_textarea_tag(name, value='', options={}) | ||
options[:id] ||= name | ||
cols = options[:cols].nil? ? '' : "cols='"+options[:cols]+"'" | ||
rows = options[:rows].nil? ? '' : "rows='"+options[:rows]+"'" | ||
|
||
width = options[:width].nil? ? '100%' : options[:width] | ||
height = options[:height].nil? ? '100%' : options[:height] | ||
|
||
toolbarSet = options[:toolbarSet].nil? ? 'Default' : options[:toolbarSet] | ||
|
||
if options[:ajax] | ||
inputs = "<input type='hidden' id='#{options[:id]}_hidden' name='#{name}'>\n" << | ||
"<textarea class='#{options[:className]}' id='#{options[:id]}' #{cols} #{rows} name='#{options[:id]}'>#{value}</textarea>\n" | ||
else | ||
inputs = "<textarea class='#{options[:className]}' id='#{options[:id]}' #{cols} #{rows} name='#{name}'>#{value}</textarea>\n" | ||
end | ||
|
||
js_path = "#{ActionController::Base.relative_url_root}/javascripts" | ||
base_path = "#{js_path}/fckeditor/" | ||
return inputs << | ||
javascript_tag("jQuery(document).ready(function(){ var oFCKeditor = new FCKeditor('#{options[:id]}', '#{width}', '#{height}', '#{toolbarSet}');\n" << | ||
"oFCKeditor.BasePath = \"#{base_path}\"\n" << | ||
"oFCKeditor.Config['CustomConfigurationsPath'] = '#{js_path}/fckcustom.js';\n" << | ||
"oFCKeditor.ReplaceTextarea(); });\n") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
vendor/plugins/ansuz_form_builder/app/models/ansuz/j_adams/form_field_text_field.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters