Changeset 1119
- Timestamp:
- 2008-07-25 10:01:05 (6 months ago)
- Files:
-
- trunk/app/helpers/application_helper.rb (modified) (2 diffs)
- trunk/lib/parser/lib/rules/zena.rb (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/helpers/application_helper.rb
r1111 r1119 126 126 end 127 127 <<-EOL 128 < div class="date_box"><img src="/calendar/iconCalendar.gif" id="#{opts[:button]}"/>128 <span class="date_box"><img src="/calendar/iconCalendar.gif" id="#{opts[:button]}" alt='#{_('date selection')}'/> 129 129 #{fld} 130 130 <script type="text/javascript"> … … 135 135 showsTime : true 136 136 }); 137 </script></ div>137 </script></span> 138 138 EOL 139 139 end trunk/lib/parser/lib/rules/zena.rb
r1118 r1119 864 864 @html_tag = 'input' 865 865 @html_tag_params[:type] = @params[:type] 866 @html_tag_params[:text] = @params[:text] 866 @html_tag_params[:text] = @params[:text] if @params[:text] 867 867 @html_tag_params.merge!(html_attributes) 868 868 render_html_tag(nil) … … 899 899 id_hash[:style] = "display:none;" 900 900 901 cancel = "< span class='btn_x'><a href='#' onclick='[\"#{erb_dom_id}_add\", \"#{erb_dom_id}_form\"].each(Element.toggle);return false;'>#{_('btn_x')}</a></span>\n"901 cancel = "<p class='btn_x'><a href='#' onclick='[\"#{erb_dom_id}_add\", \"#{erb_dom_id}_form\"].each(Element.toggle);return false;'>#{_('btn_x')}</a></p>\n" 902 902 form = "<%= form_remote_tag(:url => #{base_class.to_s.underscore.pluralize}_path, :html => {:id => \"#{dom_id}_form_t\"}) %>\n" 903 903 else … … 908 908 cancel = <<-END_TXT 909 909 <% if #{node}.new_record? -%> 910 < span class='btn_x'><a href='#' onclick='[\"<%= params[:dom_id] %>_add\", \"<%= params[:dom_id] %>_form\"].each(Element.toggle);return false;'>#{_('btn_x')}</a></span>910 <p class='btn_x'><a href='#' onclick='[\"<%= params[:dom_id] %>_add\", \"<%= params[:dom_id] %>_form\"].each(Element.toggle);return false;'>#{_('btn_x')}</a></p> 911 911 <% else -%> 912 < span class='btn_x'><%= link_to_remote(#{_('btn_x').inspect}, :url => #{base_class.to_s.underscore}_path(#{node_id}) + \"/zafu?t_url=#{CGI.escape(template_url)}&dom_id=\#{params[:dom_id]}#{@context[:need_link_id] ? "&link_id=\#{#{node}.link_id}" : ''}\", :method => :get) %></span>912 <p class='btn_x'><%= link_to_remote(#{_('btn_x').inspect}, :url => #{base_class.to_s.underscore}_path(#{node_id}) + \"/zafu?t_url=#{CGI.escape(template_url)}&dom_id=\#{params[:dom_id]}#{@context[:need_link_id] ? "&link_id=\#{#{node}.link_id}" : ''}\", :method => :get) %></p> 913 913 <% end -%> 914 914 END_TXT … … 2282 2282 end 2283 2283 2284 def context_name2285 return (@context[:name] || 'list') if @context2286 @name || @params[:id] || parent ? parent.context_name : 'root'2287 end2288 2289 def context2290 return @context if @context2291 # not rendered yet, find first parent with context2292 @context = parent ? parent.context : {}2293 end2294 2295 # prefix for DOM id2296 def dom_prefix2297 (@context ? @context[:dom_prefix] : nil) || (@dom_prefix ||= unique_name)2298 end2299 2300 # use our own scope2301 def clear_dom_scope2302 @context.delete(:dom_prefix) # should not propagate2303 @context.delete(:make_form) # should not propagate2304 @context.delete(:saved_template) # should not propagate2305 end2306 2307 # create our own ajax DOM scope2308 def new_dom_scope2309 clear_dom_scope2310 @context[:dom_prefix] = self.dom_prefix2311 end2312 2313 2284 # DOM id for the current context 2314 2285 def dom_id(suffix='') … … 2372 2343 template_url + '_form' 2373 2344 end 2374 2345 2346 2347 def context 2348 return @context if @context 2349 # not rendered yet, find first parent with context 2350 @context = parent ? parent.context : {} 2351 end 2352 2353 # prefix for DOM id 2354 def dom_prefix 2355 (@context ? @context[:dom_prefix] : nil) || (@dom_prefix ||= unique_name) 2356 end 2357 2358 # use our own scope 2359 def clear_dom_scope 2360 @context.delete(:dom_prefix) # should not propagate 2361 @context.delete(:make_form) # should not propagate 2362 @context.delete(:saved_template) # should not propagate 2363 end 2364 2365 # create our own ajax DOM scope 2366 def new_dom_scope 2367 clear_dom_scope 2368 @context[:dom_prefix] = self.dom_prefix 2369 end 2370 2375 2371 # Return a different name on each call 2376 2372 def unique_name 2377 2373 base = context_name 2378 2374 root.next_name_index(base, base == @name).gsub(/[^\d\w\/]/,'_') 2375 end 2376 2377 def context_name 2378 return (@name || @context[:name] || 'list') if @context 2379 @name || @params[:id] || (parent ? parent.context_name : 'root') 2379 2380 end 2380 2381
