{
var ret;
createCookie("CO_bin5_pref_ring_endauct", ($('preferences').ring_endauct ? "true" : "false"), 24*3650, cookiepath);
- ret = server_request('mesg', 'preferences_update');
+ ret = server_request('index_wr.php', sess, 'mesg', 'preferences_update');
}
function act_preferences_update()
/*
- * brisk - commons.js
+ * brisk / fieldify - commons.js
*
- * Copyright (C) 2006-2015 Matteo Nastasi
+ * Copyright (C) 2006-2016 Matteo Nastasi
* mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
if var name == '__POST__' than all other vars will be managed as POST content
and the call will be a POST
*/
-function server_request()
+function server_request(page, sess)
{
var xhr_wr = createXMLHttpRequest();
var i, collect = "", post_collect = null, is_post = false;
if (arguments.length > 0) {
- for (i = 0 ; i < arguments.length ; i+= 2) {
+ for (i = 2 ; i < arguments.length ; i+= 2) {
if (arguments[i] == "__POST__") {
is_post = true;
post_collect = "";
}
// alert("Args: "+arguments.length);
- var is_conn = (sess == "not_connected" ? false : true);
-
- // console.log("server_request:preresp: "+xhr_wr.responseText);
-
+ var uri = page + '?' + (sess != null ? 'sess=' + sess + '&' : '') + collect;
if (is_post) {
- xhr_wr.open('POST', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+collect, false);
+ xhr_wr.open('POST', uri, false);
xhr_wr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
}
else {
- xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+collect, false);
+ xhr_wr.open('GET', uri, false);
}
xhr_wr.onreadystatechange = function() { return; };
xhr_wr.send(post_collect);
{
obj.form.elements['realsub'].value = obj.id;
}
+
+function class_check(item, cls_name)
+{
+ if ((" " + item.className + " ").indexOf(" " + cls_name + " ") == -1)
+ return (false);
+ else
+ return (true);
+}
+
+function class_add(item, cls_name)
+{
+ if (! class_check(item, cls_name)) {
+ item.className = item.className + " " + cls_name;
+ }
+}
+
+function class_rem(item, cls_name)
+{
+ var item_spc = " " + item.className + " ";
+ var cls_spc = " " + cls_name + " ";
+ var cls_out;
+
+ var pos = item_spc.indexOf(cls_spc);
+ if (pos != -1) {
+ cls_out = item_spc.substring(0, pos) + item_spc.substring(pos + cls_spc.length - 1);
+ if (cls_out == " ") {
+ item.className = "";
+ }
+ else {
+ item.className = cls_out.substring(1, cls_out.length - 1);
+ }
+ }
+}
+
+function class_subst(item, cls_out, cls_in)
+{
+ class_rem(item, cls_out);
+ class_add(item, cls_in);
+}
+
<table width="100%%" border="0" cols="3"><tr>
<td align="left"><div style="padding-left: 8px;">'.$banner_top_left.'</div></td>
<td align="center">'.(($G_with_topbanner || $G_with_donors) ? '<table><tr><td>' : '').'<div style="text-align: center;">
- <!--<img class="nobo" src="img/brisk_logo64.png">--><img class="nobo" src="img/brisk_logo64_blackribbon.png" title="ciao grrr">
+ <img class="nobo" src="img/brisk_logo64.png">
'.$mlang_room['headline'][$G_lang].'<br>
</div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>',
($G_with_topbanner ? $G_topbanner :
function info_show(username)
{
- var info_in_in = server_request('mesg', 'chatt|/info ' +
+ var info_in_in = server_request('index_wr.php', sess, 'mesg', 'chatt|/info ' +
encodeURIComponent(username));
var info_in = JSON.parse(info_in_in);
var info = null;
info = info_fld($('info'));
jinfo = info.dom2json();
- ret = server_request('mesg', 'info|save','__POST__', 'info', JSON.stringify(jinfo));
+ ret = server_request('index_wr.php', sess, 'mesg', 'info|save','__POST__', 'info', JSON.stringify(jinfo));
if (ret == 1) {
$('info').style.visibility = 'hidden';
if (typeof(g_prefs) == 'undefined')
return false;
- ret = server_request('mesg', 'prefs|save','__POST__', 'prefs', JSON.stringify(g_prefs));
+ ret = server_request('index_wr.php', sess, 'mesg', 'prefs|save','__POST__', 'prefs', JSON.stringify(g_prefs));
if (ret == 1) {
$('preferences').style.visibility = 'hidden';
{
var ret;
- ret = server_request('mesg', 'prefs|reset');
+ ret = server_request('index_wr.php', sess, 'mesg', 'prefs|reset');
}
function prefs_update(field)
}
// submit the request
- token = server_request('mesg', 'apprentice',
+ token = server_request('index_wr.php', sess, 'mesg', 'apprentice',
'cli_name', encodeURIComponent(form.elements['nameid'].value),
'cli_email', encodeURIComponent(form.elements['emailid'].value),
'cli_lang', g_lang);
else {
// console.log("richiesta token");
/* richiede token */
- token = server_request('mesg', 'getchallenge', 'cli_name', encodeURIComponent(form.elements['nameid'].value));
+ token = server_request('index_wr.php', sess, 'mesg', 'getchallenge', 'cli_name', encodeURIComponent(form.elements['nameid'].value));
tokens = token.split('|');
// console.log('XX token: '+token);
}
// submit the request
- token = server_request('mesg', 'warranty',
+ token = server_request('index_wr.php', sess, 'mesg', 'warranty',
'cli_name', encodeURIComponent(form.elements['name'].value),
'cli_email', encodeURIComponent(form.elements['email'].value) );
if (token == "1") {
}
// submit the request
- token = server_request('mesg', 'mesgtoadm',
+ token = server_request('index_wr.php', sess, 'mesg', 'mesgtoadm',
'cli_subj', encodeURIComponent(form.elements['subj'].value),
'cli_mesg', encodeURIComponent(form.elements['mesg'].value) );
if (token == "1") {
else
choose = form.elements[i].value;
- token = server_request('mesg', 'poll',
+ token = server_request('index_wr.php', sess, 'mesg', 'poll',
'cli_choose', encodeURIComponent(choose) );
if (token == "1") {