webmcp

diff framework/env/ui/partial.lua @ 11:d76a8857ba62

Added ui.partial and other functions, which allow partial content replacement using XMLHttpRequests; Image support for ui.link

Also includes following changes:
- Fix for rocketcgi library to accept POST data content-types, which contain additional charset information.
- Support arrays passed as params to encode.url (only for keys ending with "[]")
- Version information changed to "1.0.7"

Documentation for added functions is not yet complete.
author jbe/bsw
date Fri Feb 12 18:40:22 2010 +0100 (2010-02-12)
parents
children f3d3203cd2e4
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/framework/env/ui/partial.lua	Fri Feb 12 18:40:22 2010 +0100
     1.3 @@ -0,0 +1,26 @@
     1.4 +--[[--
     1.5 +ui.partial{
     1.6 +  module =
     1.7 +  view =
     1.8 +  id =
     1.9 +  params =
    1.10 +  target =
    1.11 +  content = function()
    1.12 +    ...                   -- 
    1.13 +  end
    1.14 +}
    1.15 +
    1.16 +TODO: documentation
    1.17 +
    1.18 +--]]--
    1.19 +
    1.20 +function ui.partial(args)
    1.21 +  local old_state = ui._partial_state
    1.22 +  ui._partial_state = table.new(args)
    1.23 +  ui._partial_state.param_name_hash = {}
    1.24 +  if args.param_names then
    1.25 +    ui.add_partial_param_names(args.param_names)
    1.26 +  end
    1.27 +  args.content()
    1.28 +  ui._partial_state = old_state
    1.29 +end

Impressum / About Us