diff --git a/CHANGELOG b/CHANGELOG index e40974192..06aedf03d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,21 +3,23 @@ === Edge * Simplify admin tab API [Jim Gay, John Long, Sean Cribbs] + +=== 0.9.0 RC1 (October 9, 2009) + +* Turned on HAML's "ugly" whitespace mode in production [John Muhl] +* Use HTML 5 doctype. [John Muhl] +* Miscellaneous HTML standards improvements [John Muhl] * Fixed bug where pages were being cached in dev mode. This has been a problem since switching to Rack::Cache. [Jason Garber] * Snippets are now only accessible to people with the "Designer" role. [John Long] * Renamed "Developer" role to "Designer". [John Long] -* Invoke sudo on unix systems when installing the gem using rake [John Long] -* Undefine prototype rake tasks in instance mode. [Sean Cribbs] * Verify that the cache directory exists before trying to store a response. [Sean Cribbs] * Fix page-part deletion in JS. [Sean Cribbs] * Don't cache extension-defined javascripts, but do cache the defaults. [Sean Cribbs] * Fix dev-site behavior when 'dev.host' is configured. [Chris Ricca] -* Use HTML 5 doctype. [John Muhl] * Concatenate admin javascript files. [John Muhl] * Use more descriptive page titles. [John Muhl] * Allow non-standard controller methods for render_region. [Jim Gay] * Updated to use Radius 0.6.1. [John Long] -* Use root_path instead of "/" on View Site link. [John Long] * Correct type on content-type and move to more/hide language. [John Long] * Add some helpful shortcut keys. [Sean Cribbs] * Implemented "Blade" user-interface. [John Long, Chris Parrish, Daniel Beach, Brandon Mathis, Sean Cribbs, Ben Morrow, John Muhl] diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 86f6af798..a32190ebc 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -5,6 +5,7 @@ core: === Edge +* Jason Garber * Chris Ricca * Jim Gay * John Muhl diff --git a/app/models/standard_tags.rb b/app/models/standard_tags.rb index a65c7117a..b2244183f 100644 --- a/app/models/standard_tags.rb +++ b/app/models/standard_tags.rb @@ -774,6 +774,10 @@ class TagError < StandardError; end page's URL * @selected@ specifies the state of the link when the current page matches is a child of the specified url + # @if_last@ renders its contents within a @normal@, @here@ or + @selected@ tag if the item is the last in the navigation elements + # @if_first@ renders its contents within a @normal@, @here@ or + @selected@ tag if the item is the first in the navigation elements The @between@ tag specifies what should be inserted in between each of the links. @@ -798,11 +802,13 @@ class TagError < StandardError; end key = parts.join(':') [key.strip, value.strip] end - pairs.each do |title, url| + pairs.each_with_index do |(title, url), i| compare_url = remove_trailing_slash(url) page_url = remove_trailing_slash(self.url) hash[:title] = title hash[:url] = url + tag.locals.first_child = i == 0 + tag.locals.last_child = i == pairs.length - 1 case page_url when compare_url result << (hash[:here] || hash[:selected] || hash[:normal]).call @@ -828,6 +834,30 @@ class TagError < StandardError; end end end + desc %{ + Renders the containing elements if the element is the first + in the navigation list + + *Usage:* + +
...
+ } + tag 'navigation:if_first' do |tag| + tag.expand if tag.locals.first_child + end + + desc %{ + Renders the containing elements if the element is the last + in the navigation list + + *Usage:* + +
...
+ } + tag 'navigation:if_last' do |tag| + tag.expand if tag.locals.last_child + end + desc %{ Renders the containing elements only if Radiant in is development mode. diff --git a/app/views/admin/layouts/_form.html.haml b/app/views/admin/layouts/_form.html.haml index 2e6a98504..b20bbd0f5 100644 --- a/app/views/admin/layouts/_form.html.haml +++ b/app/views/admin/layouts/_form.html.haml @@ -1,4 +1,4 @@ -- form_for [:admin, @layout], :html => {:onsubmit_status => onsubmit_status(@layout)} do |f| +- form_for [:admin, @layout], :html => {'data-onsubmit_status' => onsubmit_status(@layout)} do |f| = f.hidden_field :lock_version = render_region :form_top .form_area diff --git a/app/views/admin/layouts/index.html.haml b/app/views/admin/layouts/index.html.haml index ba4953e7e..3e90c864f 100644 --- a/app/views/admin/layouts/index.html.haml +++ b/app/views/admin/layouts/index.html.haml @@ -1,7 +1,7 @@ - @page_title = 'Layouts - ' + default_page_title .outset - - render_region :top + = render_region :top %table#layouts.index %thead %tr diff --git a/app/views/admin/layouts/remove.html.haml b/app/views/admin/layouts/remove.html.haml index a6cc180af..ed5cf1443 100644 --- a/app/views/admin/layouts/remove.html.haml +++ b/app/views/admin/layouts/remove.html.haml @@ -9,7 +9,7 @@ = image('layout', :alt => '') = h @layout.name -- form_for [:admin, @layout], :html => { :method => 'delete', :onsubmit_status=>"Removing layout…" } do +- form_for [:admin, @layout], :html => { :method => 'delete', 'data-onsubmit_status'=>"Removing layout…" } do %p.buttons %input.button{:type=>"submit", :value=>"Delete Layout"}/ or diff --git a/app/views/admin/page_parts/_page_part.html.haml b/app/views/admin/page_parts/_page_part.html.haml index 931d99798..01b8725bf 100644 --- a/app/views/admin/page_parts/_page_part.html.haml +++ b/app/views/admin/page_parts/_page_part.html.haml @@ -1,4 +1,4 @@ -.page{:id => "page_#{page_part.name.to_slug}", :"data-caption"=>h(page_part.name)} +.page{:id => "page_#{page_part.name.to_slug}", 'data-caption'=>h(page_part.name)} .part{:id => "part-#{page_part.name.to_slug}"} = hidden_field_tag "page[parts_attributes][#{page_part_counter}][name]", page_part.name, :id => "part_#{page_part.name.to_slug}_name" = hidden_field_tag "page[parts_attributes][#{page_part_counter}][id]", page_part.id, :id => "part_#{page_part_counter}_id", :class => "id_input" diff --git a/app/views/admin/pages/_popups.html.haml b/app/views/admin/pages/_popups.html.haml index df995132f..87fbfd146 100644 --- a/app/views/admin/pages/_popups.html.haml +++ b/app/views/admin/pages/_popups.html.haml @@ -6,7 +6,7 @@ %p %label{:for => 'part_name_field'} Name = f.text_field :name, :id => 'part_name_field', :maxlength => 100, :style => "width: 15em", :class => "textbox big" - = hidden_field_tag 'index', @page.parts.size, :id => 'page_part_index_field' + = hidden_field_tag 'index', 0, :id => 'page_part_index_field' %p.buttons = submit_tag "Add Part", :id => 'add_part_button', :class => "button" or diff --git a/app/views/admin/pages/edit.html.haml b/app/views/admin/pages/edit.html.haml index a8ac521c0..a14d3d819 100644 --- a/app/views/admin/pages/edit.html.haml +++ b/app/views/admin/pages/edit.html.haml @@ -6,9 +6,9 @@ - main.edit_header do %h1 Edit Page - main.edit_form do - - form_for :page, @page, :url => admin_page_path(@page), :html => {:method => :put, :multipart => true, :id => 'edit_page'} do |fields| + - form_for :page, @page, :url => admin_page_path(@page), :html => {:method => :put, :multipart => true, :id => 'edit_page', 'data-onsubmit_status'=>"Saving Changes…"} do |fields| = render :partial => "fields", :object => fields - main.edit_popups do = render :partial => "popups" -- content_for 'page_scripts', page_edit_javascripts \ No newline at end of file +- content_for 'page_scripts', page_edit_javascripts diff --git a/app/views/admin/pages/new.html.haml b/app/views/admin/pages/new.html.haml index 0bc061951..2c9e0c479 100644 --- a/app/views/admin/pages/new.html.haml +++ b/app/views/admin/pages/new.html.haml @@ -4,9 +4,9 @@ - main.edit_header do %h1 New Page - main.edit_form do - - form_for :page, @page, :url => admin_pages_path, :html => {:id => 'new_page', :multipart => true} do |f| + - form_for :page, @page, :url => admin_pages_path, :html => {:id => 'new_page', :multipart => true, 'data-onsubmit_status'=>"Creating page…"} do |f| = render :partial => "fields", :object => f - main.edit_popups do = render :partial => "popups" -- content_for 'page_scripts', page_edit_javascripts \ No newline at end of file +- content_for 'page_scripts', page_edit_javascripts diff --git a/app/views/admin/pages/remove.html.haml b/app/views/admin/pages/remove.html.haml index 8b595c1a3..2a3c64162 100644 --- a/app/views/admin/pages/remove.html.haml +++ b/app/views/admin/pages/remove.html.haml @@ -14,7 +14,7 @@ %tbody = render_node @page, :simple => true -- form_for [:admin, @page.becomes(Page)], :html => {:method => :delete, :onsubmit_status=>"Removing pages…"} do +- form_for [:admin, @page.becomes(Page)], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing pages…"} do %p.buttons %input.button{:type=>"submit", :value=>"Delete Pages"}/ or diff --git a/app/views/admin/preferences/edit.html.haml b/app/views/admin/preferences/edit.html.haml index 8327b12fa..42317f054 100644 --- a/app/views/admin/preferences/edit.html.haml +++ b/app/views/admin/preferences/edit.html.haml @@ -6,7 +6,7 @@ - main.edit_header do %h1 Personal Preferences - main.edit_form do - - form_for @user, :url => admin_preferences_url, :html => { :method => :put, :onsubmit_status => "Saving preferences…" } do |f| + - form_for @user, :url => admin_preferences_url, :html => { :method => :put, 'data-onsubmit_status' => "Saving preferences…" } do |f| = render_region :form_top - render_region :form do |form| diff --git a/app/views/admin/snippets/_form.html.haml b/app/views/admin/snippets/_form.html.haml index 2acb45bdc..4aae3bdd5 100644 --- a/app/views/admin/snippets/_form.html.haml +++ b/app/views/admin/snippets/_form.html.haml @@ -1,4 +1,4 @@ -- form_for [:admin, @snippet], :html => {:onsubmit_status => onsubmit_status(@snippet)} do |f| +- form_for [:admin, @snippet], :html => {'data-onsubmit_status' => onsubmit_status(@snippet)} do |f| = f.hidden_field :lock_version = render_region :form_top .form_area diff --git a/app/views/admin/snippets/index.html.haml b/app/views/admin/snippets/index.html.haml index ffe6d98a1..e6f5b35c5 100644 --- a/app/views/admin/snippets/index.html.haml +++ b/app/views/admin/snippets/index.html.haml @@ -1,7 +1,7 @@ - @page_title = 'Snippets - ' + default_page_title .outset - - render_region :top + = render_region :top %table#snippets.index %thead %tr diff --git a/app/views/admin/snippets/remove.html.haml b/app/views/admin/snippets/remove.html.haml index f6a65da27..f849cc3d4 100644 --- a/app/views/admin/snippets/remove.html.haml +++ b/app/views/admin/snippets/remove.html.haml @@ -12,7 +12,7 @@ = image('snippet', :alt => "") %span.title= @snippet.name -- form_for [:admin, @snippet], :html => {:method => :delete, :onsubmit_status=>"Removing snippet…"} do +- form_for [:admin, @snippet], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing snippet…"} do %p.buttons %input.button{:type=>"submit", :value=>"Delete Snippet"}/ or diff --git a/app/views/admin/users/remove.html.haml b/app/views/admin/users/remove.html.haml index 5c6844847..4c8fb60a3 100644 --- a/app/views/admin/users/remove.html.haml +++ b/app/views/admin/users/remove.html.haml @@ -11,7 +11,7 @@ %td.user %span.title= @user.name -- form_for [:admin, @user], :html => { :method => :delete, :onsubmit_status=>"Removing user…" } do +- form_for [:admin, @user], :html => { :method => :delete, 'data-onsubmit_status'=>"Removing user…" } do %p.buttons %input.button{:type=>"submit", :value=>"Delete User"}/ or diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index f73ba0c3a..b3e597613 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,7 +1,7 @@ - -%html{html_attrs} +!!! +%html{:lang=>"en-US"} %head - %meta{"http-equiv"=>"Content-type", :content=>"text/html;charset=utf-8"}/ + %meta{:charset=>"utf-8"}/ %title= @page_title || default_page_title - @stylesheets.uniq.each do |stylesheet| = stylesheet_link_tag stylesheet diff --git a/config/environment.rb b/config/environment.rb index 3bc2658be..a96ef9ab6 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -75,4 +75,7 @@ inflect.uncountable 'config' end end -end \ No newline at end of file +end + +Haml::Template.options[:format] = :html5 +Haml::Template.options[:ugly] = true if ENV['RAILS_ENV'] == 'production' diff --git a/lib/generators/instance/templates/instance_environment.rb b/lib/generators/instance/templates/instance_environment.rb index 488c9746f..d48d9e807 100644 --- a/lib/generators/instance/templates/instance_environment.rb +++ b/lib/generators/instance/templates/instance_environment.rb @@ -75,4 +75,7 @@ inflect.uncountable 'config' end end -end \ No newline at end of file +end + +Haml::Template.options[:format] = :html5 +Haml::Template.options[:ugly] = true if ENV['RAILS_ENV'] == 'production' diff --git a/lib/radiant/admin_ui.rb b/lib/radiant/admin_ui.rb index 469722dfd..2dc6e10ca 100644 --- a/lib/radiant/admin_ui.rb +++ b/lib/radiant/admin_ui.rb @@ -209,7 +209,6 @@ def load_default_snippet_regions edit.form_bottom.concat %w{edit_buttons edit_timestamp} end snippet.index = RegionSet.new do |index| - index.top.concat %w{help_text} index.thead.concat %w{title_header modify_header} index.tbody.concat %w{title_cell modify_cell} index.bottom.concat %w{new_button} @@ -226,7 +225,6 @@ def load_default_layout_regions edit.form_bottom.concat %w{edit_buttons edit_timestamp} end layout.index = RegionSet.new do |index| - index.top.concat %w{help_text} index.thead.concat %w{title_header modify_header} index.tbody.concat %w{title_cell modify_cell} index.bottom.concat %w{new_button} diff --git a/lib/radiant/extension/script.rb b/lib/radiant/extension/script.rb index 4998c4c01..6019d2e98 100644 --- a/lib/radiant/extension/script.rb +++ b/lib/radiant/extension/script.rb @@ -31,6 +31,12 @@ class Action def rake(command) `rake #{command} RAILS_ENV=#{RAILS_ENV}` end + + def file_utils + FileUtils + end + + delegate :cd, :cp_r, :rm_r, :to => :file_utils end class Installer < Action @@ -46,8 +52,8 @@ def install end def copy_to_vendor_extensions - FileUtils.cp_r(self.path, File.expand_path(File.join(RAILS_ROOT, 'vendor', 'extensions', name))) - FileUtils.rm_r(self.path) + cp_r(self.path, File.expand_path(File.join(RAILS_ROOT, 'vendor', 'extensions', name))) + rm_r(self.path) end def migrate @@ -75,7 +81,7 @@ def migrate_down end def remove_extension_directory - FileUtils.rm_r(File.join(RAILS_ROOT, 'vendor', 'extensions', name)) + rm_r(File.join(RAILS_ROOT, 'vendor', 'extensions', name)) end end @@ -95,7 +101,7 @@ def install def checkout self.path = File.join(Dir.tmpdir, name) - system "cd #{Dir.tmpdir}; #{checkout_command}" + cd(Dir.tmpdir) { system "#{checkout_command}" } end end @@ -136,10 +142,14 @@ def checkout_command def checkout if project_in_git? system "git submodule add #{url} vendor/extensions/#{name}" - system "cd vendor/extensions/#{name}; git submodule init && git submodule update" + cd(File.join('vendor', 'extensions', name)) do + system "git submodule init && git submodule update" + end else super - system "cd #{path}; git submodule init && git submodule update" + cd(path) do + system "git submodule init && git submodule update" + end end end @@ -166,7 +176,10 @@ def download end def unpack - output = `cd #{Dir.tmpdir}; gem unpack #{filename.split('-').first}` + output = nil + cd(Dir.tmpdir) do + output = `gem unpack #{filename.split('-').first}` + end self.path = output.match(/'(.*)'/)[1] end end @@ -177,7 +190,8 @@ def filename end def unpack - output = `cd #{Dir.tmpdir}; tar xvf #{filename}` + output = nil + cd(Dir.tmpdir) { output = `tar xvf #{filename}` } self.path = File.join(Dir.tmpdir, output.split(/\n/).first.split('/').first) end end @@ -188,7 +202,7 @@ def filename end def unpack - system "cd #{Dir.tmpdir}; gunzip #{self.filename}" + cd(Dir.tmpdir) { system "gunzip #{self.filename}" } @unpacked = true super end @@ -200,7 +214,7 @@ def filename end def unpack - system "cd #{Dir.tmpdir}; bunzip2 #{self.filename}" + cd(Dir.tmpdir) { system "bunzip2 #{self.filename}" } @unpacked = true super end @@ -208,7 +222,8 @@ def unpack class Zip < Download def unpack - output = `cd #{Dir.tmpdir}; unzip #{filename} -d #{name}` + output = nil + cd(Dir.tmpdir) { output = `unzip #{filename} -d #{name}` } self.path = File.join(Dir.tmpdir, name) end end diff --git a/public/javascripts/admin/codearea.js b/public/javascripts/admin/codearea.js index 79e36d959..f3fb0a6a8 100644 --- a/public/javascripts/admin/codearea.js +++ b/public/javascripts/admin/codearea.js @@ -1,5 +1,6 @@ -// Based on code from: +// Originally based on code from: // http://ajaxian.com/archives/handling-tabs-in-textareas + var CodeAreaBehavior = Behavior.create({ initialize: function() { new CodeArea(this.element); @@ -15,52 +16,150 @@ var CodeArea = Class.create({ onkeydown: function(event) { // Set desired tab - defaults to two space softtab var tab = " "; + var tabStop = tab.length; - var t = event.target; - var ss = t.selectionStart; - var se = t.selectionEnd; + var t = this.element; - // Tab key - insert tab expansion - if (event.keyCode == 9) { - event.preventDefault(); - if (ss != se && t.value.slice(ss,se).indexOf("\n") != -1) { - // Special case of multi line selection - // In case selection was not of entire lines (e.g. selection begins in the middle of a line) - // we ought to tab at the beginning as well as at the start of every following line. - var pre = t.value.slice(0,ss); - var sel = t.value.slice(ss,se).replace(/\n/g,"\n"+tab); - var post = t.value.slice(se,t.value.length); - t.value = pre.concat(tab).concat(sel).concat(post); - t.selectionStart = ss + tab.length; - t.selectionEnd = se + tab.length; - } else { - // "Normal" case (no selection or selection on one line only) - t.value = t.value.slice(0,ss).concat(tab).concat(t.value.slice(ss,t.value.length)); - if (ss == se) { - t.selectionStart = t.selectionEnd = ss + tab.length; + if (Prototype.Browser.IE) { + // Very limited support for IE + + if (event.keyCode == Event.KEY_TAB && !event.shiftKey) { + event.preventDefault(); + document.selection.createRange().text = tab; + } + + } else { + // Safari and Firefox + + // If this is the tab key, make the selection start at the begining and end of lines for + // multi-line selections + if (event.keyCode == Event.KEY_TAB) this.normalizeSelection(t); + + var ss = t.selectionStart; + var se = t.selectionEnd; + + if (event.keyCode == Event.KEY_TAB) { + // Tab key + + event.preventDefault(); + + if (event.shiftKey) { + // Shift + Tab + + if (t.value.slice(ss,se).indexOf("\n") != -1) { + // Special case of multi line selection + + var pre = t.value.slice(0, ss) + var sel = t.value.slice(ss, se) + var post = t.value.slice(se, t.value.length); + + // Back off one tab + sel = sel.replace(new RegExp("^" + tab, "gm"), '') + + // Put everything back together + t.value = pre.concat(sel).concat(post); + + // Readjust the selection + t.selectionStart = pre.length; + t.selectionEnd = pre.length + sel.length; + + } else { + // "Normal" case (no selection or selection on one line only) + + if (t.value.slice(ss - tabStop, ss) == tab) { + // Only unindent if there is a tab before the cursor + + t.value = t.value.slice(0, ss - tabStop).concat(t.value.slice(ss, t.value.length)); + t.selectionStart = ss - tabStop; + t.selectionEnd = se - tabStop; + } + } } else { - t.selectionStart = ss + tab.length; - t.selectionEnd = se + tab.length; + // Tab + + if (ss != se && t.value.slice(ss, se).indexOf("\n") != -1) { + // Special case of multi line selection + + // In case selection was not of entire lines (e.g. selection begins in the middle of a line) + // we ought to tab at the beginning as well as at the start of every following line. + var pre = t.value.slice(0, ss); + var sel = t.value.slice(ss, se); + var post = t.value.slice(se, t.value.length); + + // Indent one tab + sel = sel.replace(/^/gm, tab) + + // Put everything back together + t.value = pre.concat(sel).concat(post); + + // Readjust the selection + t.selectionStart = pre.length; + t.selectionEnd = pre.length + sel.length; + + } else { + // "Normal" case (no selection or selection on one line only) + + t.value = t.value.slice(0, ss).concat(tab).concat(t.value.slice(ss, t.value.length)); + if (ss == se) { + t.selectionStart = t.selectionEnd = ss + tabStop; + } else { + t.selectionStart = ss + tabStop; + t.selectionEnd = se + tabStop; + } + } } + + } else if (event.keyCode == Event.KEY_BACKSPACE && ss == se && t.value.slice(ss - tabStop, ss) == tab) { + // Backspace - delete preceding tab expansion, if it exists and nothing is selected + + event.preventDefault(); + t.value = t.value.slice(0, ss - tabStop).concat(t.value.slice(ss, t.value.length)); + t.selectionStart = ss - tabStop; + t.selectionEnd = se - tabStop; + + } else if (event.keyCode == Event.KEY_DELETE && t.value.slice(se, se + tabStop) == tab) { + // Delete key - delete following tab expansion, if exists + + event.preventDefault(); + t.value = t.value.slice(0, ss).concat(t.value.slice(ss + tabStop ,t.value.length)); + t.selectionStart = t.selectionEnd = ss; + + } else if (event.keyCode == Event.KEY_LEFT && t.value.slice(ss - tabStop, ss) == tab) { + // Left arrow - move across the tab in one go + + event.preventDefault(); + t.selectionStart = t.selectionEnd = ss - tabStop; + } else if (event.keyCode == Event.KEY_RIGHT && t.value.slice(ss, ss + tabStop) == tab) { + // Left/right arrow - move across the tab in one go + + event.preventDefault(); + t.selectionStart = t.selectionEnd = ss + tabStop; + } - } else if (event.keyCode == Event.KEY_BACKSPACE && t.value.slice(ss - tab.length,ss) == tab) { - // Backspace key - delete preceding tab expansion, if exists - event.preventDefault(); - t.value = t.value.slice(0,ss - tab.length).concat(t.value.slice(ss,t.value.length)); - t.selectionStart = t.selectionEnd = ss - tab.length; - } else if (event.keyCode == Event.KEY_DELETE && t.value.slice(se,se + tab.length) == tab) { - // Delete key - delete following tab expansion, if exists - event.preventDefault(); - t.value = t.value.slice(0,ss).concat(t.value.slice(ss + tab.length,t.value.length)); - t.selectionStart = t.selectionEnd = ss; - } else if (event.keyCode == Event.KEY_LEFT && t.value.slice(ss - tab.length,ss) == tab) { - // Left arrow key - move across the tab in one go - event.preventDefault(); - t.selectionStart = t.selectionEnd = ss - tab.length; - } else if (event.keyCode == Event.KEY_RIGHT && t.value.slice(ss,ss + tab.length) == tab) { - // Left/right arrow keys - move across the tab in one go - event.preventDefault(); - t.selectionStart = t.selectionEnd = ss + tab.length; + } + }, + + normalizeSelection: function(textarea) { + var b = 0; + var value = textarea.value; + var e = textarea.length; + var ss = textarea.selectionStart; + var se = textarea.selectionEnd; + + if (ss != se && textarea.value.slice(ss, se).indexOf("\n") != -1) { + // If multi-line adjust the selection + + // If the end of the line is selected back off one character + if (textarea.value.slice(se - 1, se) == "\n") se = se - 1; + + // If the selection does not end with a new line or the end of the document increment until it does + while ((se < e) && (textarea.value.slice(se, se + 1) != "\n")) se += 1; + + // If the selection does not begin at a new line or the begining of the document back off until it does + while ((ss > b) && (textarea.value.slice(ss - 1, ss) != "\n")) ss -= 1; + + textarea.selectionStart = ss; + textarea.selectionEnd = se; } } }); \ No newline at end of file diff --git a/public/javascripts/admin/status.js b/public/javascripts/admin/status.js index ea89d35b0..5a7df3dfd 100644 --- a/public/javascripts/admin/status.js +++ b/public/javascripts/admin/status.js @@ -10,10 +10,10 @@ * * Event.addBehavior({'form': Status.FormBehavior()}); * - * And then add an "onsubmit_status" to each form that you want to display + * And then add an "data-onsubmit_status" to each form that you want to display * a status message on submit for: * - *
+ * * * Based on code from popup.js. * @@ -77,7 +77,7 @@ Status.preloadImages = function() { Status.FormBehavior = Behavior.create({ initialize: function() { - var attr = this.element.attributes['onsubmit_status'] + var attr = this.element.attributes['data-onsubmit_status'] if (attr) this.status = attr.value; if (this.status) this.element.observe('submit', function() { showStatus(this.status) }.bind(this)); } diff --git a/public/javascripts/admin/tabcontrol.js b/public/javascripts/admin/tabcontrol.js index 704d43bb0..570433a25 100644 --- a/public/javascripts/admin/tabcontrol.js +++ b/public/javascripts/admin/tabcontrol.js @@ -25,6 +25,7 @@ var TabControl = Class.create({ var tab = new TabControl.Tab(page); this.tabs.push(tab); this.tabContainer.insert({bottom: tab}); + $('page_part_index_field').setValue(this.tabs.length); page.hide(); }, @@ -133,7 +134,7 @@ TabControl.Tab = Class.create({ }, toElement: function() { - this.element = $a({'class': 'tab', 'href': '#'}, $span(this.caption), $img({'src': '/images/admin/tab_close.png', 'class': 'close', 'alt': 'Remove part', 'title': 'Remove part'})); + this.element = $a({'href': '#'}, $span(this.caption), $img({'src': '/images/admin/tab_close.png', 'class': 'close', 'alt': 'Remove part', 'title': 'Remove part'})).addClassName('tab'); return this.element; } }); diff --git a/radiant.gemspec b/radiant.gemspec index 00b9cd7a7..0d6589e45 100644 --- a/radiant.gemspec +++ b/radiant.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Radiant CMS dev team"] - s.date = %q{2009-09-30} + s.date = %q{2009-10-09} s.default_executable = %q{radiant} s.description = %q{Radiant is a simple and powerful publishing system designed for small teams. It is built with Rails and is similar to Textpattern or MovableType, but is diff --git a/spec/lib/radiant/extension/script_spec.rb b/spec/lib/radiant/extension/script_spec.rb index 228689a55..b58b8fcb1 100644 --- a/spec/lib/radiant/extension/script_spec.rb +++ b/spec/lib/radiant/extension/script_spec.rb @@ -244,6 +244,7 @@ @methods = [:copy_to_vendor_extensions, :migrate, :update].each do |method| @checkout.stub!(method).and_return(true) end + @checkout.stub!(:cd).and_yield end it "should set the name and url" do @@ -263,7 +264,8 @@ it "should checkout the source" do @checkout.stub!(:checkout_command).and_return('echo') - @checkout.should_receive(:system).with(/^cd (.*); echo/) + @checkout.should_receive(:cd) + @checkout.should_receive(:system).with('echo') @checkout.checkout @checkout.path.should_not be_nil @checkout.path.should =~ /example/ @@ -313,6 +315,7 @@ @extension = mock("Extension", :name => 'example', :repository_url => 'http://localhost/') @git = Registry::Git.new(@extension) @git.stub!(:system) + @git.stub!(:cd).and_yield end describe "when the Radiant project is not stored in git" do @@ -326,15 +329,17 @@ it "should initialize and update submodules" do Dir.stub!(:tmpdir).and_return('/tmp') - @git.should_receive(:system).with("cd /tmp; git clone http://localhost/ example").ordered - @git.should_receive(:system).with("cd /tmp/example; git submodule init && git submodule update").ordered + @git.should_receive(:cd).with("/tmp").ordered + @git.should_receive(:system).with("git clone http://localhost/ example").ordered + @git.should_receive(:cd).with("/tmp/example").ordered + @git.should_receive(:system).with("git submodule init && git submodule update").ordered @git.checkout end it "should copy the extension to vendor/extensions" do @git.path = "/tmp" - FileUtils.should_receive(:cp_r).with('/tmp', "#{RAILS_ROOT}/vendor/extensions/example") - FileUtils.should_receive(:rm_r).with('/tmp') + @git.should_receive(:cp_r).with('/tmp', "#{RAILS_ROOT}/vendor/extensions/example") + @git.should_receive(:rm_r).with('/tmp') @git.copy_to_vendor_extensions end end @@ -346,13 +351,14 @@ it "should add the extension as a submodule and initialize and update its submodules" do @git.should_receive(:system).with("git submodule add http://localhost/ vendor/extensions/example").ordered - @git.should_receive(:system).with("cd vendor/extensions/example; git submodule init && git submodule update").ordered + @git.should_receive(:cd).with("vendor/extensions/example").ordered + @git.should_receive(:system).with("git submodule init && git submodule update").ordered @git.checkout end it "should not copy the extension" do - FileUtils.should_not_receive(:cp_r) - FileUtils.should_not_receive(:rm_r) + @git.should_not_receive(:cp_r) + @git.should_not_receive(:rm_r) @git.copy_to_vendor_extensions end end diff --git a/spec/models/standard_tags_spec.rb b/spec/models/standard_tags_spec.rb index 079c5368c..f9fe81653 100644 --- a/spec/models/standard_tags_spec.rb +++ b/spec/models/standard_tags_spec.rb @@ -656,6 +656,36 @@ expected = %{Home: Boy | Archives | Docs} page(:radius).should render(tags).as(expected) end + + it 'should render text under and only on the first and last item, respectively' do + tags = %{ + () + () + () + } + expected = %{(Home Assorted Parent Radius)} + page(:radius).should render(tags).as(expected) + end + + it 'should render text under on every item but the first' do + tags = %{ + > + > + > + } + expected = %{Home > Assorted > Parent > Radius} + page(:radius).should render(tags).as(expected) + end + + it 'should render text under on every item but the last' do + tags = %{ + > + > + > + } + expected = %{Home > Assorted > Parent > Radius} + page(:radius).should render(tags).as(expected) + end end describe "" do @@ -994,4 +1024,4 @@ def page_children_last_tags(attr = nil) def page_eachable_children(page) page.children.select(&:published?).reject(&:virtual) end -end \ No newline at end of file +end diff --git a/vendor/radius/lib/radius/parser/scan.rb b/vendor/radius/lib/radius/parser/scan.rb index 362f09a33..284751ab8 100644 --- a/vendor/radius/lib/radius/parser/scan.rb +++ b/vendor/radius/lib/radius/parser/scan.rb @@ -1,6 +1,4 @@ - # line 1 "scan.rl" - # line 83 "scan.rl" @@ -37,132 +35,50 @@ def self.perform_parse(prefix, data) @prefix = prefix -# line 41 "scan.rb" -class << self - attr_accessor :_parser_actions - private :_parser_actions, :_parser_actions= -end -self._parser_actions = [ - 0, 1, 0, 1, 1, 1, 2, 1, - 3, 1, 4, 1, 5, 1, 6, 1, - 7, 1, 8, 1, 9, 1, 13, 1, - 14, 1, 18, 1, 20, 1, 21, 1, - 22, 2, 4, 5, 2, 5, 6, 2, - 8, 4, 2, 8, 9, 2, 9, 8, - 2, 10, 19, 2, 11, 19, 2, 12, - 19, 2, 15, 16, 2, 15, 17, 3, - 4, 5, 6, 3, 8, 4, 5, 3, - 15, 5, 16, 4, 8, 4, 5, 6, - 4, 15, 4, 5, 16, 5, 15, 8, - 4, 5, 16 -] - -class << self - attr_accessor :_parser_key_offsets - private :_parser_key_offsets, :_parser_key_offsets= -end -self._parser_key_offsets = [ - 0, 0, 11, 21, 34, 47, 61, 65, - 70, 72, 74, 87, 100, 101, 103, 118, - 133, 149, 155, 161, 176, 179, 182, 185, - 200, 202, 204, 219, 235, 241, 247, 250, - 253, 269, 285, 302, 309, 315, 331, 335, - 351, 366, 369, 371, 381, 392, 402, 416, - 420, 420, 421, 430, 430, 430, 432, 434, - 437, 440, 442, 444 -] - +# line 39 "scan.rb" class << self attr_accessor :_parser_trans_keys private :_parser_trans_keys, :_parser_trans_keys= end self._parser_trans_keys = [ - 58, 63, 95, 45, 46, 48, 57, 65, - 90, 97, 122, 63, 95, 45, 46, 48, - 58, 65, 90, 97, 122, 32, 47, 62, - 63, 95, 9, 13, 45, 58, 65, 90, - 97, 122, 32, 47, 62, 63, 95, 9, - 13, 45, 58, 65, 90, 97, 122, 32, - 61, 63, 95, 9, 13, 45, 46, 48, - 58, 65, 90, 97, 122, 32, 61, 9, - 13, 32, 34, 39, 9, 13, 34, 92, - 34, 92, 32, 47, 62, 63, 95, 9, - 13, 45, 58, 65, 90, 97, 122, 32, - 47, 62, 63, 95, 9, 13, 45, 58, - 65, 90, 97, 122, 62, 34, 92, 32, - 34, 47, 62, 63, 92, 95, 9, 13, - 45, 58, 65, 90, 97, 122, 32, 34, - 47, 62, 63, 92, 95, 9, 13, 45, - 58, 65, 90, 97, 122, 32, 34, 61, - 63, 92, 95, 9, 13, 45, 46, 48, - 58, 65, 90, 97, 122, 32, 34, 61, - 92, 9, 13, 32, 34, 39, 92, 9, - 13, 32, 34, 47, 62, 63, 92, 95, - 9, 13, 45, 58, 65, 90, 97, 122, - 34, 62, 92, 34, 39, 92, 34, 39, - 92, 32, 39, 47, 62, 63, 92, 95, - 9, 13, 45, 58, 65, 90, 97, 122, - 39, 92, 39, 92, 32, 39, 47, 62, - 63, 92, 95, 9, 13, 45, 58, 65, - 90, 97, 122, 32, 39, 61, 63, 92, - 95, 9, 13, 45, 46, 48, 58, 65, - 90, 97, 122, 32, 39, 61, 92, 9, - 13, 32, 34, 39, 92, 9, 13, 34, - 39, 92, 34, 39, 92, 32, 34, 39, - 47, 62, 63, 92, 95, 9, 13, 45, - 58, 65, 90, 97, 122, 32, 34, 39, - 47, 62, 63, 92, 95, 9, 13, 45, - 58, 65, 90, 97, 122, 32, 34, 39, - 61, 63, 92, 95, 9, 13, 45, 46, - 48, 58, 65, 90, 97, 122, 32, 34, - 39, 61, 92, 9, 13, 32, 34, 39, - 92, 9, 13, 32, 34, 39, 47, 62, - 63, 92, 95, 9, 13, 45, 58, 65, - 90, 97, 122, 34, 39, 62, 92, 32, - 34, 39, 47, 62, 63, 92, 95, 9, - 13, 45, 58, 65, 90, 97, 122, 32, - 39, 47, 62, 63, 92, 95, 9, 13, - 45, 58, 65, 90, 97, 122, 39, 62, - 92, 39, 92, 63, 95, 45, 46, 48, - 57, 65, 90, 97, 122, 58, 63, 95, - 45, 46, 48, 57, 65, 90, 97, 122, - 63, 95, 45, 46, 48, 58, 65, 90, - 97, 122, 32, 62, 63, 95, 9, 13, - 45, 46, 48, 58, 65, 90, 97, 122, - 32, 62, 9, 13, 60, 47, 63, 95, - 45, 57, 65, 90, 97, 122, 34, 92, - 34, 92, 34, 39, 92, 34, 39, 92, - 39, 92, 39, 92, 0 + 0, 0, 45, 122, 45, 122, + 9, 122, 9, 122, 9, + 122, 9, 61, 9, 39, + 34, 92, 34, 92, 9, 122, + 9, 122, 62, 62, 34, + 92, 9, 122, 9, 122, + 9, 122, 9, 92, 9, 92, + 9, 122, 34, 92, 34, + 92, 34, 92, 9, 122, + 39, 92, 39, 92, 9, 122, + 9, 122, 9, 92, 9, + 92, 34, 92, 34, 92, + 9, 122, 9, 122, 9, 122, + 9, 92, 9, 92, 9, + 122, 34, 92, 9, 122, + 9, 122, 39, 92, 39, 92, + 45, 122, 45, 122, 45, + 122, 9, 122, 9, 62, + 0, 0, 60, 60, 45, 122, + 0, 0, 0, 0, 34, + 92, 34, 92, 34, 92, + 34, 92, 39, 92, 39, 92, + 0, 0, 0 ] class << self - attr_accessor :_parser_single_lengths - private :_parser_single_lengths, :_parser_single_lengths= + attr_accessor :_parser_key_spans + private :_parser_key_spans, :_parser_key_spans= end -self._parser_single_lengths = [ - 0, 3, 2, 5, 5, 4, 2, 3, - 2, 2, 5, 5, 1, 2, 7, 7, - 6, 4, 4, 7, 3, 3, 3, 7, - 2, 2, 7, 6, 4, 4, 3, 3, - 8, 8, 7, 5, 4, 8, 4, 8, - 7, 3, 2, 2, 3, 2, 4, 2, - 0, 1, 3, 0, 0, 2, 2, 3, - 3, 2, 2, 0 -] - -class << self - attr_accessor :_parser_range_lengths - private :_parser_range_lengths, :_parser_range_lengths= -end -self._parser_range_lengths = [ - 0, 4, 4, 4, 4, 5, 1, 1, - 0, 0, 4, 4, 0, 0, 4, 4, - 5, 1, 1, 4, 0, 0, 0, 4, - 0, 0, 4, 5, 1, 1, 0, 0, - 4, 4, 5, 1, 1, 4, 0, 4, - 4, 0, 0, 4, 4, 4, 5, 1, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0 +self._parser_key_spans = [ + 0, 78, 78, 114, 114, 114, 53, 31, + 59, 59, 114, 114, 1, 59, 114, 114, + 114, 84, 84, 114, 59, 59, 59, 114, + 54, 54, 114, 114, 84, 84, 59, 59, + 114, 114, 114, 84, 84, 114, 59, 114, + 114, 54, 54, 78, 78, 78, 114, 54, + 0, 1, 78, 0, 0, 59, 59, 59, + 59, 54, 54, 0 ] class << self @@ -170,14 +86,14 @@ class << self private :_parser_index_offsets, :_parser_index_offsets= end self._parser_index_offsets = [ - 0, 0, 8, 15, 25, 35, 45, 49, - 54, 57, 60, 70, 80, 82, 85, 97, - 109, 121, 127, 133, 145, 149, 153, 157, - 169, 172, 175, 187, 199, 205, 211, 215, - 219, 232, 245, 258, 265, 271, 284, 289, - 302, 314, 318, 321, 328, 336, 343, 353, - 357, 358, 360, 367, 368, 369, 372, 375, - 379, 383, 386, 389 + 0, 0, 79, 158, 273, 388, 503, 557, + 589, 649, 709, 824, 939, 941, 1001, 1116, + 1231, 1346, 1431, 1516, 1631, 1691, 1751, 1811, + 1926, 1981, 2036, 2151, 2266, 2351, 2436, 2496, + 2556, 2671, 2786, 2901, 2986, 3071, 3186, 3246, + 3361, 3476, 3531, 3586, 3665, 3744, 3823, 3938, + 3993, 3994, 3996, 4075, 4076, 4077, 4137, 4197, + 4257, 4317, 4372, 4427 ] class << self @@ -185,55 +101,560 @@ class << self private :_parser_indicies, :_parser_indicies= end self._parser_indicies = [ - 2, 1, 1, 1, 1, 1, 1, 0, - 3, 3, 3, 3, 3, 3, 0, 4, - 6, 7, 5, 5, 4, 5, 5, 5, - 0, 8, 10, 11, 9, 9, 8, 9, - 9, 9, 0, 13, 15, 14, 14, 13, - 14, 14, 14, 14, 12, 16, 17, 16, - 12, 17, 18, 19, 17, 12, 21, 22, - 20, 24, 25, 23, 26, 28, 29, 27, - 27, 26, 27, 27, 27, 12, 30, 32, - 33, 31, 31, 30, 31, 31, 31, 12, - 34, 12, 35, 25, 23, 36, 24, 38, - 39, 37, 25, 37, 36, 37, 37, 37, - 23, 40, 24, 42, 43, 41, 25, 41, - 40, 41, 41, 41, 23, 44, 24, 46, - 45, 25, 45, 44, 45, 45, 45, 45, - 23, 47, 24, 48, 25, 47, 23, 48, - 49, 50, 25, 48, 23, 51, 21, 53, - 54, 52, 22, 52, 51, 52, 52, 52, - 20, 24, 55, 25, 23, 57, 58, 59, - 56, 61, 35, 62, 60, 64, 24, 66, - 67, 65, 68, 65, 64, 65, 65, 65, - 63, 24, 68, 63, 61, 68, 63, 69, - 24, 71, 72, 70, 68, 70, 69, 70, - 70, 70, 63, 73, 24, 75, 74, 68, - 74, 73, 74, 74, 74, 74, 63, 76, - 24, 77, 68, 76, 63, 77, 78, 79, - 68, 77, 63, 80, 58, 59, 56, 81, - 81, 62, 60, 82, 61, 35, 84, 85, - 83, 62, 83, 82, 83, 83, 83, 60, - 86, 61, 35, 88, 89, 87, 62, 87, - 86, 87, 87, 87, 60, 90, 61, 35, - 92, 91, 62, 91, 90, 91, 91, 91, - 91, 60, 93, 61, 35, 94, 62, 93, - 60, 94, 95, 96, 62, 94, 60, 97, - 80, 58, 99, 100, 98, 59, 98, 97, - 98, 98, 98, 56, 61, 35, 101, 62, - 60, 97, 57, 58, 99, 100, 98, 59, - 98, 97, 98, 98, 98, 56, 103, 21, - 105, 106, 104, 107, 104, 103, 104, 104, - 104, 102, 24, 108, 68, 63, 21, 107, - 102, 109, 109, 109, 109, 109, 109, 0, - 111, 110, 110, 110, 110, 110, 110, 0, + 1, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 0, 0, + 0, 0, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 0, + 0, 0, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 3, + 3, 0, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 0, 0, 0, + 0, 3, 0, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 0, 0, 0, + 0, 3, 0, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 0, 4, 4, + 4, 4, 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 5, 5, 6, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 0, 0, 0, 7, 5, 0, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 0, 0, 0, 0, 5, 0, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 0, 8, 8, 8, 8, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 9, 9, 10, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 0, 0, 0, 11, 9, + 0, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 0, 0, 0, 0, 9, + 0, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 0, 13, 13, 13, 13, + 13, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 13, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 14, 14, 12, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 12, 12, + 15, 12, 14, 12, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 12, 12, + 12, 12, 14, 12, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 12, 16, + 16, 16, 16, 16, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 16, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 17, 12, 17, 17, 17, + 17, 17, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 17, 12, 18, 12, + 12, 12, 12, 19, 12, 21, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 22, + 20, 24, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 25, 23, 26, 26, 26, + 26, 26, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 26, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 27, 27, 28, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 12, + 12, 12, 29, 27, 12, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 12, + 12, 12, 12, 27, 12, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 12, + 30, 30, 30, 30, 30, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 30, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 31, 31, 32, 31, + 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 12, 12, 12, 33, 31, 12, + 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 12, 12, 12, 12, 31, 12, + 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 12, 34, 12, 35, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 25, + 23, 36, 36, 36, 36, 36, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 36, 23, 24, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 37, 37, 38, + 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 23, 23, 23, 39, 37, + 23, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 23, 25, 23, 23, 37, + 23, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 23, 40, 40, 40, 40, + 40, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 40, 23, 24, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 41, 41, 42, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 23, 23, + 23, 43, 41, 23, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 23, 25, + 23, 23, 41, 23, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 23, 44, + 44, 44, 44, 44, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 44, 23, + 24, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 45, 45, 23, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 23, 23, 46, 23, 45, 23, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 23, 25, 23, 23, 45, 23, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, + 45, 23, 47, 47, 47, 47, 47, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 47, 23, 24, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 48, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 25, 23, 48, + 48, 48, 48, 48, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 48, 23, + 49, 23, 23, 23, 23, 50, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 25, 23, 51, 51, 51, 51, + 51, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 51, 20, 21, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, + 52, 52, 53, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 20, 20, + 20, 54, 52, 20, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 20, 22, + 20, 20, 52, 20, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 20, 24, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 55, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 25, 23, 57, 56, 56, 56, 56, + 58, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 59, 56, 61, + 60, 60, 60, 60, 35, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 62, 60, 64, 64, 64, 64, 64, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 64, 63, 63, 63, 63, 63, + 63, 24, 63, 63, 63, 63, 63, 65, + 65, 66, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 63, 63, 63, + 67, 65, 63, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 63, 68, 63, + 63, 65, 63, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 63, 24, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 68, 63, 61, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 68, 63, 69, 69, 69, 69, + 69, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 69, 63, 63, 63, 63, + 63, 63, 24, 63, 63, 63, 63, 63, + 70, 70, 71, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 63, 63, + 63, 72, 70, 63, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 63, 68, + 63, 63, 70, 63, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 63, 73, + 73, 73, 73, 73, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 73, 63, + 63, 63, 63, 63, 63, 24, 63, 63, + 63, 63, 63, 74, 74, 63, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, + 74, 63, 63, 75, 63, 74, 63, 74, + 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, + 74, 63, 68, 63, 63, 74, 63, 74, + 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, + 74, 74, 74, 74, 74, 74, 74, 74, + 74, 63, 76, 76, 76, 76, 76, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 76, 63, 63, 63, 63, 63, 63, + 24, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 77, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 68, 63, 77, + 77, 77, 77, 77, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 77, 63, + 78, 63, 63, 63, 63, 79, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 68, 63, 80, 56, 56, 56, + 56, 58, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 59, 56, + 81, 60, 60, 60, 60, 81, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 62, 60, 82, 82, 82, 82, + 82, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 82, 60, 61, 60, 60, + 60, 60, 35, 60, 60, 60, 60, 60, + 83, 83, 84, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 60, 60, + 60, 85, 83, 60, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 60, 62, + 60, 60, 83, 60, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 60, 86, + 86, 86, 86, 86, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 86, 60, + 61, 60, 60, 60, 60, 35, 60, 60, + 60, 60, 60, 87, 87, 88, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, + 87, 60, 60, 60, 89, 87, 60, 87, + 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, + 87, 60, 62, 60, 60, 87, 60, 87, + 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, + 87, 60, 90, 90, 90, 90, 90, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 90, 60, 61, 60, 60, 60, 60, + 35, 60, 60, 60, 60, 60, 91, 91, + 60, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 60, 60, 92, 60, + 91, 60, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 60, 62, 60, 60, + 91, 60, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 60, 93, 93, 93, + 93, 93, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 93, 60, 61, 60, + 60, 60, 60, 35, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 94, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 62, 60, 94, 94, 94, 94, 94, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 94, 60, 95, 60, 60, 60, 60, + 96, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 62, 60, 97, + 97, 97, 97, 97, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 97, 56, + 80, 56, 56, 56, 56, 58, 56, 56, + 56, 56, 56, 98, 98, 99, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 56, 56, 56, 100, 98, 56, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 56, 59, 56, 56, 98, 56, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 56, 61, 60, 60, 60, 60, 35, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 101, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 62, 60, 97, 97, + 97, 97, 97, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 97, 56, 57, + 56, 56, 56, 56, 58, 56, 56, 56, + 56, 56, 98, 98, 99, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 56, 56, 56, 100, 98, 56, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 56, 59, 56, 56, 98, 56, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 56, 103, 103, 103, 103, 103, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 103, 102, 102, 102, 102, 102, 102, 21, + 102, 102, 102, 102, 102, 104, 104, 105, + 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 102, 102, 102, 106, 104, + 102, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 102, 107, 102, 102, 104, + 102, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 102, 24, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 108, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 68, 63, 21, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, + 107, 102, 109, 109, 0, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 0, + 0, 0, 0, 0, 109, 0, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, + 0, 0, 0, 0, 109, 0, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 109, 109, 109, 109, 109, + 0, 110, 110, 0, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 111, 0, + 0, 0, 0, 110, 0, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 0, + 0, 0, 0, 110, 0, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 0, + 112, 112, 0, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 0, 0, + 0, 0, 112, 0, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 0, 0, + 0, 0, 112, 0, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 0, 113, - 115, 114, 114, 113, 114, 114, 114, 114, - 0, 116, 117, 116, 0, 118, 120, 119, - 123, 122, 122, 122, 122, 122, 121, 124, - 125, 24, 25, 23, 24, 25, 23, 61, - 35, 62, 60, 61, 35, 62, 60, 24, - 68, 63, 24, 68, 63, 126, 0 + 113, 113, 113, 113, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 113, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 114, 114, 0, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 0, 0, 0, 115, 114, 0, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 0, 0, 0, 0, 114, 0, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 0, 116, 116, 116, 116, 116, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 116, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 117, + 0, 118, 120, 119, 122, 122, 123, 122, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 121, 121, 121, 121, 121, 122, 121, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 121, 121, 121, 121, 122, 121, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 121, 124, 125, 24, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 25, + 23, 24, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 25, 23, 61, 60, 60, + 60, 60, 35, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 62, + 60, 61, 60, 60, 60, 60, 35, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 62, 60, 24, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 68, 63, 24, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 68, 63, 126, 0 ] class << self @@ -264,22 +685,22 @@ class << self private :_parser_trans_actions, :_parser_trans_actions= end self._parser_trans_actions = [ - 29, 0, 3, 5, 7, 0, 7, 7, - 0, 13, 0, 0, 31, 15, 0, 15, - 0, 0, 0, 0, 17, 42, 17, 0, - 19, 0, 9, 63, 33, 33, 0, 36, - 11, 11, 0, 19, 9, 63, 33, 80, - 0, 36, 11, 71, 15, 0, 15, 0, - 0, 19, 0, 39, 75, 67, 85, 57, - 17, 45, 42, 17, 0, 19, 0, 0, - 9, 63, 33, 80, 0, 0, 36, 11, - 71, 15, 0, 15, 0, 0, 0, 19, - 42, 19, 9, 63, 33, 80, 0, 36, - 11, 71, 15, 0, 15, 0, 0, 19, - 19, 39, 75, 67, 85, 57, 17, 39, - 75, 67, 85, 17, 57, 1, 0, 3, - 5, 7, 0, 7, 0, 0, 0, 25, - 60, 27, 1, 0, 51, 48, 54 + 1, 0, 2, 3, 4, 0, 4, 4, + 0, 5, 0, 0, 6, 7, 0, 7, + 0, 0, 0, 0, 8, 9, 8, 0, + 10, 0, 11, 12, 13, 13, 0, 14, + 15, 15, 0, 10, 11, 12, 13, 16, + 0, 14, 15, 17, 7, 0, 7, 0, + 0, 10, 0, 18, 19, 20, 21, 22, + 8, 23, 9, 8, 0, 10, 0, 0, + 11, 12, 13, 16, 0, 0, 14, 15, + 17, 7, 0, 7, 0, 0, 0, 10, + 9, 10, 11, 12, 13, 16, 0, 14, + 15, 17, 7, 0, 7, 0, 0, 10, + 10, 18, 19, 20, 21, 22, 8, 18, + 19, 20, 21, 8, 22, 24, 0, 2, + 3, 4, 0, 4, 0, 0, 0, 27, + 28, 29, 24, 0, 30, 31, 32 ] class << self @@ -293,7 +714,7 @@ class << self 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 21, 21, 0, 0, 0, 0, 0, 0, + 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] @@ -308,7 +729,7 @@ class << self 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 23, 0, 0, 0, 0, 0, 0, + 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] @@ -349,10 +770,9 @@ class << self end self.parser_en_main = 49; - # line 118 "scan.rl" -# line 356 "scan.rb" +# line 776 "scan.rb" begin p ||= 0 pe ||= data.length @@ -361,12 +781,12 @@ class << self te = nil act = 0 end - # line 119 "scan.rl" -# line 368 "scan.rb" +# line 787 "scan.rb" begin - _klen, _trans, _keys, _acts, _nacts = nil + testEof = false + _slen, _trans, _keys, _inds, _acts, _nacts = nil _goto_level = 0 _resume = 10 _eof_trans = 15 @@ -374,7 +794,6 @@ class << self _test_eof = 30 _out = 40 while true - _trigger_goto = false if _goto_level <= 0 if p == pe _goto_level = _test_eof @@ -386,92 +805,37 @@ class << self end end if _goto_level <= _resume - _acts = _parser_from_state_actions[cs] - _nacts = _parser_actions[_acts] - _acts += 1 - while _nacts > 0 - _nacts -= 1 - _acts += 1 - case _parser_actions[_acts - 1] - when 14 then + case _parser_from_state_actions[cs] + when 26 then # line 1 "scan.rl" begin ts = p end # line 1 "scan.rl" -# line 403 "scan.rb" - end # from state action switch - end - if _trigger_goto - next +# line 816 "scan.rb" end - _keys = _parser_key_offsets[cs] - _trans = _parser_index_offsets[cs] - _klen = _parser_single_lengths[cs] - _break_match = false - - begin - if _klen > 0 - _lower = _keys - _upper = _keys + _klen - 1 - - loop do - break if _upper < _lower - _mid = _lower + ( (_upper - _lower) >> 1 ) - - if data[p] < _parser_trans_keys[_mid] - _upper = _mid - 1 - elsif data[p] > _parser_trans_keys[_mid] - _lower = _mid + 1 - else - _trans += (_mid - _keys) - _break_match = true - break - end - end # loop - break if _break_match - _keys += _klen - _trans += _klen - end - _klen = _parser_range_lengths[cs] - if _klen > 0 - _lower = _keys - _upper = _keys + (_klen << 1) - 2 - loop do - break if _upper < _lower - _mid = _lower + (((_upper-_lower) >> 1) & ~1) - if data[p] < _parser_trans_keys[_mid] - _upper = _mid - 2 - elsif data[p] > _parser_trans_keys[_mid+1] - _lower = _mid + 2 - else - _trans += ((_mid - _keys) >> 1) - _break_match = true - break - end - end # loop - break if _break_match - _trans += _klen - end - end while false - _trans = _parser_indicies[_trans] + _keys = cs << 1 + _inds = _parser_index_offsets[cs] + _slen = _parser_key_spans[cs] + _trans = if ( _slen > 0 && + _parser_trans_keys[_keys] <= data[p] && + data[p] <= _parser_trans_keys[_keys + 1] + ) then + _parser_indicies[ _inds + data[p] - _parser_trans_keys[_keys] ] + else + _parser_indicies[ _inds + _slen ] + end end if _goto_level <= _eof_trans cs = _parser_trans_targs[_trans] if _parser_trans_actions[_trans] != 0 - _acts = _parser_trans_actions[_trans] - _nacts = _parser_actions[_acts] - _acts += 1 - while _nacts > 0 - _nacts -= 1 - _acts += 1 - case _parser_actions[_acts - 1] -when 0 then + case _parser_trans_actions[_trans] + when 24 then # line 5 "scan.rl" begin mark_pfx = p end # line 5 "scan.rl" -when 1 then + when 2 then # line 6 "scan.rl" begin @@ -479,88 +843,56 @@ class << self @nodes.last << data[mark_pfx-1..p] begin p += 1 - _trigger_goto = true _goto_level = _out - break + next end end end # line 6 "scan.rl" -when 2 then + when 3 then # line 12 "scan.rl" begin mark_stg = p end # line 12 "scan.rl" -when 3 then + when 4 then # line 13 "scan.rl" begin @starttag = data[mark_stg..p-1] end # line 13 "scan.rl" -when 4 then + when 11 then # line 14 "scan.rl" begin mark_attr = p end # line 14 "scan.rl" -when 5 then + when 15 then # line 15 "scan.rl" begin @attrs[@nat] = @vat end # line 15 "scan.rl" -when 6 then + when 5 then # line 24 "scan.rl" begin mark_nat = p end # line 24 "scan.rl" -when 7 then + when 7 then # line 25 "scan.rl" begin @nat = data[mark_nat..p-1] end # line 25 "scan.rl" -when 8 then + when 8 then # line 26 "scan.rl" begin mark_vat = p end # line 26 "scan.rl" -when 9 then + when 10 then # line 27 "scan.rl" begin @vat = data[mark_vat..p-1] end # line 27 "scan.rl" -when 10 then -# line 29 "scan.rl" - begin - @flavor = :open end -# line 29 "scan.rl" -when 11 then -# line 30 "scan.rl" - begin - @flavor = :self end -# line 30 "scan.rl" -when 12 then -# line 31 "scan.rl" - begin - @flavor = :close end -# line 31 "scan.rl" -when 15 then -# line 1 "scan.rl" - begin -te = p+1 - end -# line 1 "scan.rl" -when 16 then -# line 69 "scan.rl" - begin -act = 1; end -# line 69 "scan.rl" -when 17 then -# line 78 "scan.rl" - begin -act = 2; end -# line 78 "scan.rl" -when 18 then + when 27 then # line 78 "scan.rl" begin te = p+1 @@ -570,28 +902,7 @@ class << self end end # line 78 "scan.rl" -when 19 then -# line 69 "scan.rl" - begin -te = p -p = p - 1; begin - tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs} - @prefix = nil - @name = nil - @flavor = :tasteless - @attrs = {} - @nodes << tag << '' - begin - p += 1 - _trigger_goto = true - _goto_level = _out - break - end - - end - end -# line 69 "scan.rl" -when 20 then + when 29 then # line 78 "scan.rl" begin te = p @@ -601,7 +912,7 @@ class << self end end # line 78 "scan.rl" -when 21 then + when 1 then # line 78 "scan.rl" begin begin p = ((te))-1; end @@ -611,7 +922,7 @@ class << self end end # line 78 "scan.rl" -when 22 then + when 6 then # line 1 "scan.rl" begin case act @@ -626,9 +937,8 @@ class << self @nodes << tag << '' begin p += 1 - _trigger_goto = true _goto_level = _out - break + next end end @@ -641,33 +951,270 @@ class << self end end # line 1 "scan.rl" -# line 645 "scan.rb" - end # action switch + when 13 then +# line 14 "scan.rl" + begin + mark_attr = p end +# line 14 "scan.rl" +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" + when 14 then +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" +# line 24 "scan.rl" + begin + mark_nat = p end +# line 24 "scan.rl" + when 18 then +# line 26 "scan.rl" + begin + mark_vat = p end +# line 26 "scan.rl" +# line 14 "scan.rl" + begin + mark_attr = p end +# line 14 "scan.rl" + when 9 then +# line 26 "scan.rl" + begin + mark_vat = p end +# line 26 "scan.rl" +# line 27 "scan.rl" + begin + @vat = data[mark_vat..p-1] end +# line 27 "scan.rl" + when 23 then +# line 27 "scan.rl" + begin + @vat = data[mark_vat..p-1] end +# line 27 "scan.rl" +# line 26 "scan.rl" + begin + mark_vat = p end +# line 26 "scan.rl" + when 31 then +# line 29 "scan.rl" + begin + @flavor = :open end +# line 29 "scan.rl" +# line 69 "scan.rl" + begin +te = p +p = p - 1; begin + tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs} + @prefix = nil + @name = nil + @flavor = :tasteless + @attrs = {} + @nodes << tag << '' + begin + p += 1 + _goto_level = _out + next + end + + end end +# line 69 "scan.rl" + when 30 then +# line 30 "scan.rl" + begin + @flavor = :self end +# line 30 "scan.rl" +# line 69 "scan.rl" + begin +te = p +p = p - 1; begin + tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs} + @prefix = nil + @name = nil + @flavor = :tasteless + @attrs = {} + @nodes << tag << '' + begin + p += 1 + _goto_level = _out + next end - if _trigger_goto + + end + end +# line 69 "scan.rl" + when 32 then +# line 31 "scan.rl" + begin + @flavor = :close end +# line 31 "scan.rl" +# line 69 "scan.rl" + begin +te = p +p = p - 1; begin + tag = {:prefix=>@prefix, :name=>@starttag, :flavor => @flavor, :attrs => @attrs} + @prefix = nil + @name = nil + @flavor = :tasteless + @attrs = {} + @nodes << tag << '' + begin + p += 1 + _goto_level = _out next + end + + end + end +# line 69 "scan.rl" + when 22 then +# line 1 "scan.rl" + begin +te = p+1 + end +# line 1 "scan.rl" +# line 69 "scan.rl" + begin +act = 1; end +# line 69 "scan.rl" + when 28 then +# line 1 "scan.rl" + begin +te = p+1 + end +# line 1 "scan.rl" +# line 78 "scan.rl" + begin +act = 2; end +# line 78 "scan.rl" + when 12 then +# line 14 "scan.rl" + begin + mark_attr = p end +# line 14 "scan.rl" +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" +# line 24 "scan.rl" + begin + mark_nat = p end +# line 24 "scan.rl" + when 20 then +# line 26 "scan.rl" + begin + mark_vat = p end +# line 26 "scan.rl" +# line 14 "scan.rl" + begin + mark_attr = p end +# line 14 "scan.rl" +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" + when 17 then +# line 1 "scan.rl" + begin +te = p+1 + end +# line 1 "scan.rl" +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" +# line 69 "scan.rl" + begin +act = 1; end +# line 69 "scan.rl" + when 19 then +# line 26 "scan.rl" + begin + mark_vat = p end +# line 26 "scan.rl" +# line 14 "scan.rl" + begin + mark_attr = p end +# line 14 "scan.rl" +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" +# line 24 "scan.rl" + begin + mark_nat = p end +# line 24 "scan.rl" + when 16 then +# line 1 "scan.rl" + begin +te = p+1 + end +# line 1 "scan.rl" +# line 14 "scan.rl" + begin + mark_attr = p end +# line 14 "scan.rl" +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" +# line 69 "scan.rl" + begin +act = 1; end +# line 69 "scan.rl" + when 21 then +# line 1 "scan.rl" + begin +te = p+1 + end +# line 1 "scan.rl" +# line 26 "scan.rl" + begin + mark_vat = p end +# line 26 "scan.rl" +# line 14 "scan.rl" + begin + mark_attr = p end +# line 14 "scan.rl" +# line 15 "scan.rl" + begin + + @attrs[@nat] = @vat + end +# line 15 "scan.rl" +# line 69 "scan.rl" + begin +act = 1; end +# line 69 "scan.rl" +# line 1205 "scan.rb" + end end end if _goto_level <= _again - _acts = _parser_to_state_actions[cs] - _nacts = _parser_actions[_acts] - _acts += 1 - while _nacts > 0 - _nacts -= 1 - _acts += 1 - case _parser_actions[_acts - 1] -when 13 then + case _parser_to_state_actions[cs] + when 25 then # line 1 "scan.rl" begin ts = nil; end # line 1 "scan.rl" -# line 666 "scan.rb" - end # to state action switch - end - if _trigger_goto - next +# line 1216 "scan.rb" end + if cs == 0 _goto_level = _out next @@ -685,14 +1232,14 @@ class << self _goto_level = _eof_trans next; end -end + end + end if _goto_level <= _out break end +end end - end - # line 120 "scan.rl" return p end diff --git a/vendor/radius/tasks/scan.rake b/vendor/radius/tasks/scan.rake index de934540c..dca4e6358 100644 --- a/vendor/radius/tasks/scan.rake +++ b/vendor/radius/tasks/scan.rake @@ -8,7 +8,7 @@ namespace :scan do desc 'turn the scan.rl file into a ruby file' file 'lib/radius/parser/scan.rb' => ['lib/radius/parser/scan.rl'] do |t| cd 'lib/radius/parser' do - sh "ragel -R scan.rl" + sh "ragel -R -F1 scan.rl" end end