%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Key aliases for file browser (v3) in server mode
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% FBROWSER v.3 

[Protocol]=Server

FBROWSER_INIT=\
        Make(var,fbrowser_dir,cat $(TmpDir)/ar_storedir.tmp);

FBROWSER_EXIT=\
        Exec(echo "$(fbrowser_dir)" > $(TmpDir)/ar_storedir.tmp);
	
FBROWSER_FILL_LIST=\
	Set(popup,show,Please wait);\
	Set(list,replace,Files,..);\
	ExecAndSet(list,add,SAME,cd "$(fbrowser_dir)";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep '/');\
	ExecAndSet(list,add,SAME,cd "$(fbrowser_dir)";ls -F --quoting-style=shell|sed 's/\*//;s/,/\r/g;s/@//;s/$/,/'|grep -v '/');\
	Set(popup,hide);

FBROWSER_GO_TO=\
	Make(var,goto,by_value,$(Param));\
	Make(var,fbrowser_dir,cd "$(fbrowser_dir)";if [ -d "$(goto)" ]; then cd "$(goto)";fi;pwd);\
	Macro(FBROWSER_FILL_LIST);

FBROWSER_GO_HOME=\
	Make(var,fbrowser_dir,cd;pwd);\
	Macro(FBROWSER_FILL_LIST);

Push($$)=\
	Macro(FBROWSER_GO_TO);

[End]
