From ad5edae885f629dc478dfeda167f6fa0db0e1830 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Fri, 13 Nov 2015 18:44:38 +0100 Subject: [PATCH] info reset action added --- web/Obj/brisk.phh | 6 ++++++ web/info.js | 25 +++---------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index ce5d106..a8220f8 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -1643,6 +1643,12 @@ class Brisk } } + /* + function info_show($user, $user_login, $dt) + + if success return assoc. array with "ret" => 0 and other fields + else return an assoc. array with "ret: != 0 and "mesg" with an error description + */ function info_show($user, $user_login, $dt) { GLOBAL $G_lang, $mlang_brisk, $G_base; diff --git a/web/info.js b/web/info.js index c7f473f..8e30988 100644 --- a/web/info.js +++ b/web/info.js @@ -65,29 +65,10 @@ function info_show_cb(e) } } -function info_save() -{ - var ret; - - info = info_fld($('info')); - ret = info.dom2json(); - - console.log(ret); - - if (0 == 1) { - if (typeof(g_prefs) == 'undefined') - return false; - - ret = server_request('mesg', 'info|save','__POST__', 'prefs', JSON.stringify(g_prefs)); - - if (ret == 1) - $('preferences').style.visibility = 'hidden'; - } -} - function info_reset() { - var ret; + var ret, target; - ret = server_request('mesg', 'prefs|reset'); + target = $('info').getElementsByClassName('login_id')[0].innerHTML; + return info_show(target); } -- 2.17.1