webmcp

diff framework/env/encode/url.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 9fdfb27f8e67
children 3a6962b9121c
line diff
     1.1 --- a/framework/env/encode/url.lua	Wed Feb 03 00:57:18 2010 +0100
     1.2 +++ b/framework/env/encode/url.lua	Fri Feb 12 18:40:22 2010 +0100
     1.3 @@ -81,7 +81,14 @@
     1.4        add("_webmcp_id=", encode.url_part(id), "&")
     1.5      end
     1.6      for key, value in pairs(params) do
     1.7 -      add(encode.url_part(key), "=", encode.url_part(value), "&")
     1.8 +      -- TODO: better way to detect arrays?
     1.9 +      if string.match(key, "%[%]$") then
    1.10 +        for idx, entry in ipairs(value) do
    1.11 +          add(encode.url_part(key), "=", encode.url_part(entry), "&")
    1.12 +        end
    1.13 +      else
    1.14 +        add(encode.url_part(key), "=", encode.url_part(value), "&")
    1.15 +      end
    1.16      end
    1.17      result[#result] = nil  -- remove last '&' or '?'
    1.18    end

Impressum / About Us