OpenThought
view release on metacpan or search on metacpan
lib/OpenThought.pm view on Meta::CPAN
require => { ... },
http_request_type => string,
channel_type => string,
channel_visible => boolean,
channel_url_replace => boolean,
selectbox_max_width => size,
selectbox_trim_string => string,
selectbox_single_row_mode => string,
selectbox_multi_row_mode => string,
checkbox_true_value => string,
checkbox_false_value => string,
radio_null_selection_value => string,
data_mode => string,
});
Alter settings in the OpenThought application running in the browser. Each
parameter is optional. Only pass in the option(s) you wish to change.
For additional information on configuration, and for how/where to set the
defaults, please see the section labeled C<CONFIGURATION>.
This method accepts a hash reference where the keys are names of OpenThought
options, and the values are the new option values.
By default, these options will only be good for one request. You can change
that behaviour by either passing in the C<persist> option to this method.
You can set the defaults for most of these settings at the top of the
OpenThought.js file.
=over 4
=item Parameters
=over 4
=item settings_persist()
$OT->settings({ settings_persist => "true" });
This specifies whether or not the settings being changed in the browser should
be just for this request, or whether they should persist as long as the current
page is loaded.
The default is to not persist.
If you use this parameter, only items you specify will be executed. That is,
if you fail to mention where C<fields> should be in the order, then C<fields>
will be completely ignored for that request.
If C<url> is not last, everything sent after it will be lost when the page
changes.
=item log_enabled
$OT->settings({ log_enabled => "true" });
Enable a log window so you can see what's going on behind the scenes. If
something in your app isn't working, try enabling this. This can be very
useful for debugging, but you probably want it disabled while your app is in
production. This, of course, won't work if your popup blocking software
doesn't allow popups from the site you're running your application from.
=item log_level
$OT->settings({ log_level => "info" });
What log level to run at. You have the ability to enable lots of debugging
output, only serious errors, and various levels in between.
Options are C<debug>, C<info>, C<warn>, C<error>, C<fatal>
=item require
$OT->settings({ require =>
{ "40dom" => "http://example.com/no_40dom",
"xmlhttp" => "http://example.com/no_xmlhttp",
} })
Define a set of browser requirements, and a page to go to if that requirement
is not met.
Available requirements are C<40dom>, C<xmlhttp>, C<layer>, C<iframe>,
C<htmlrewrite>.
=item http_request_type (EXPERIMENTAL)
$OT->settings({ http_request_type => "POST" });
The request type for communications with the server. This can be
overridden at any time by passing in either GET or POST as the first
parameter to CallUrl(). The default (and known to work) option is GET.
Using POST has only been minimally tested. There have been problems noted when
using Firefox and POST, if the C<channel_type> option was changed from C<auto>
to C<iframes>. This appears to be a Firefox bug.
Options are C<GET> or C<POST> (case sensitive).
=item channel_type
$OT->settings({ channel_type => "iframe" });
The type of channel to use for communicating with the browser.
By default, OpenThought will attempt to use the XMLHttpRequest or XMLHTTP
functions available in recent browsers, then fall back to iframes if the
browser doesn't support those newer options.
However, XMLHttpRequest and XMLHTTP have one limitation -- for any given
request, the server can only respond once, and the response is all at the same
time.
Iframes don't have that restriction, and the server can send a variety of
responses throughout the duration of the request.
XMLHttpRequest/XMLHTTP are fine for most uses, but some applications may
benefit from being able to have the browser receive data a number of times
throughtout a single request (ie, irc and other realtime chat applications).
Options are C<auto> or C<iframe>.
( run in 1.595 second using v1.01-cache-2.11-cpan-364913b4093 )