Changeset 1598 in genapp


Ignore:
Timestamp:
Nov 13, 2018, 6:44:56 PM (3 years ago)
Author:
ehb
Message:

Updated genapp to latest genappalpha

Files:
306 added
64 edited

Legend:

Unmodified
Added
Removed
  • bin/genapp_mkappconfig

    r1401 r1598  
    239239    $$json{ "messaging" }{ "tcphostip" } = $$cfgjson{ "messaging" }{ "tcphostip" } || die "$0 tcphostip not defined in $cfgjsonf. $cfgjsonnotes";
    240240    $$json{ "messaging" }{ "tcpport" }   = $$cfgjson{ "messaging" }{ "tcpport" } || die "$0 tcpport not defined in $cfgjsonf. $cfgjsonnotes";
     241    $$json{ "messaging" }{ "tcprport" }  = $$cfgjson{ "messaging" }{ "tcprport" } || die "$0 tcprport not defined in $cfgjsonf. $cfgjsonnotes";
     242    $$json{ "messaging" }{ "tcptimeout" }  = $$cfgjson{ "messaging" }{ "tcptimeout" } || die "$0 tcptimeout not defined in $cfgjsonf. $cfgjsonnotes";
    241243
    242244    $$json{ "restricted" }{ "admin" } = ( $admin ) if $admin;
     
    248250
    249251    $$json{ "lockdir" } = "$gb/etc";
     252
     253    $$json{ "mongo" }{ "url" }    = $$cfgjson{ "mongo" }{ "url" }    if $$cfgjson{ "mongo" }{ "url" };
     254    $$json{ "mongo" }{ "cafile" } = $$cfgjson{ "mongo" }{ "cafile" } if $$cfgjson{ "mongo" }{ "cafile" };
    250255
    251256    $f = "$targetdir/appconfig.json";
     
    332337    }
    333338
     339    die "$0 tcprport not defined in $cfgjsonf. $cfgjsonnotes" if !$$cfgjson{ 'messaging' }{ 'tcprport' };
     340    if ( $$appjson{ 'messaging' }{ 'tcprport' } ne $$cfgjson{ 'messaging' }{ 'tcprport' } ) {
     341        $changes .= "messaging:tcprport updated from [$$appjson{'messaging'}{'tcprport'}] to [$$cfgjson{'messaging'}{'tcprport'}]\n";
     342        $$appjson{ 'messaging' }{ 'tcprport' } = $$cfgjson{ 'messaging' }{ 'tcprport' };
     343    }
     344
     345    die "$0 tcptimeout not defined in $cfgjsonf. $cfgjsonnotes" if !$$cfgjson{ 'messaging' }{ 'tcptimeout' };
     346    if ( $$appjson{ 'messaging' }{ 'tcptimeout' } ne $$cfgjson{ 'messaging' }{ 'tcptimeout' } ) {
     347        $mongochanges++;
     348        $changes .= "messaging:tcptimeout updated from [$$appjson{'messaging'}{'tcptimeout'}] to [$$cfgjson{'messaging'}{'tcptimeout'}]\n";
     349        $$appjson{ 'messaging' }{ 'tcptimeout' } = $$cfgjson{ 'messaging' }{ 'tcptimeout' };
     350    }
     351
     352    if ( $$dirjson{ 'mongo' }{ 'url' } ne $$cfgjson{ 'mongo' }{ 'url' } ) {
     353        $mongochanges++;
     354        $$dirjson{ 'mongo' }{ 'url' } = $$cfgjson{ 'mongo' }{ 'url' };
     355    }
     356
     357    if ( $$dirjson{ 'mongo' }{ 'cafile' } ne $$cfgjson{ 'mongo' }{ 'cafile' } ) {
     358        $mongochanges++;
     359        $$dirjson{ 'mongo' }{ 'cafile' } = $$cfgjson{ 'mongo' }{ 'cafile' };
     360    }
     361
    334362    if ( $changes ) {
    335        
    336363        $f = "$cwd/appconfig.json";
    337364        open  $fh, ">$f" || die "$0: could not open $f for writing\n";
     
    346373        print '-'x( length( "updated $f" ) + 10 ) . "\n";
    347374    } else {
    348         print "no differences\n" if $debug;
    349     }
    350 }
    351 
    352 
     375        print "appconfig.json: no differences\n" if $debug;
     376    }
     377
     378    if ( $mongochanges ) {
     379        $f = "$cwd/directives.json";
     380        open  $fh, ">$f" || die "$0: could not open $f for writing\n";
     381        {
     382            my $js = JSON->new;
     383            print $fh $js->pretty->encode( $dirjson );
     384        }
     385        close $fh;
     386        print '-'x( length( "updated $f" ) + 10 ) . "\n";
     387        print "updated $f\n";
     388        print $changes;
     389        print '-'x( length( "updated $f" ) + 10 ) . "\n";
     390    } else {
     391        print "directives.json: no differences\n" if $debug;
     392    }
     393}
     394
     395
  • bin/genapp_run.pl

    r1420 r1598  
    413413                    }
    414414
     415                    foreach my $sub ( keys %extra_subs ) {
     416                        print "doing extra sub $sub to $extra_subs{$sub}\n" if $debug_srplc;
     417                        grep s/$sub/$extra_subs{$sub}/g, @l;
     418                    }
     419
    415420                    if ( $$rplc_menu{ "menu:modules:id" } )
    416421                    {
     
    570575                                print "rplc menu:id " . $$rplc_menu2{ "menu:id" } . " " . $$rplc_menu{ 'menu:id' } . "\n" if $debug_srplc;
    571576                                @l = @l_sav;
     577                                if ( grep /__modulejson__/, @l ) {
     578                                    my $js = JSON->new;
     579                                    $js->canonical(1);
     580                                    my $enc_mod_json = $js->encode( get_file_json_lang_specific( $module_to_file{ $l }{ $$rplc_menu2{ 'menu:modules:id' } }, $l, 1 ) );
     581                                    grep s/__modulejson__/$enc_mod_json/g, @l;
     582                                }
     583                                foreach my $sub ( keys %extra_subs ) {
     584                                    print "doing extra sub $sub to $extra_subs{$sub}\n" if $debug_srplc;
     585                                    grep s/$sub/$extra_subs{$sub}/g, @l;
     586                                }
     587
    572588                                while ( my ( $k, $v ) = each %$rplc_directives )
    573589                                {
     
    626642                                    grep s/__${k}__/${v}/g, @l;
    627643                                }
    628                                
     644
     645                                # print "outdata 3--------\n";
     646                                # print join '', @l;
    629647                                print "adding to outdata------------------------------\n" if $debug_srplc;
    630648                                $outdata .= join '', @l;
     
    874892                if ( $doexec eq 'true' ) {
    875893                    my $cmd = "bash $fo";
     894                    if ( $fo =~ /\.js$/ ) {
     895                        $fo = "node $fo";
     896                    } else {
     897                        $fo = "./$fo" if $fo !~ /\.sh$/;
     898                    }
    876899                    print "executing: $cmd\n";
    877900                    print `$cmd`;
     
    879902                if ( $doexec eq 'atend' ) {
    880903                    my $cmd = "cd output/$l; bash $use_output";
     904                    if ( $use_output =~ /\.js$/ ) {
     905                        $cmd = "cd output/$l; node $use_output";
     906                    } else {
     907                        $cmd = "cd output/$l; ./$use_output" if $use_output !~ /\.sh$/;
     908                    }
    881909                    push @post_cmds, $cmd;
    882910                    print "pushing $cmd to post processing commands\n";
     
    10191047    if ( $$lang{ 'register' } ) {
    10201048        my $cmd = $$lang{ 'register' };
     1049        $cmd =~ s/__genapp__/$gap/g;
     1050        $error .= "registration command $cmd does not exist\n" if !-e $cmd;
    10211051        my $res = `$cmd`;
    10221052        print "registering:$res\n" if $debug_main;
  • etc/bp/perl

    r1363 r1598  
    5656}
    5757
    58 $ref = decode_json( shift );
     58$req = decode_json( shift );
    5959
    6060## messaging setup
     
    6868    };
    6969
    70     my $domsg = $$ref{ "_uuid" } && $$ref{ "_udpport" } && $$ref{ "_udphost" };
     70    my $domsg = $$req{ "_uuid" } && $$req{ "_udpport" } && $$req{ "_udphost" };
    7171
    7272    my $sock;
    73     $sock = IO::Socket::INET->new( Proto => 'udp', PeerPort => $$ref{ "_udpport" }, PeerAddr => $$ref{ "_udphost" } ) if $domsg;
     73    $sock = IO::Socket::INET->new( Proto => 'udp', PeerPort => $$req{ "_udpport" }, PeerAddr => $$req{ "_udphost" } ) if $domsg;
    7474
    7575    sub sendmsg {
     
    8181        if ( length( $text ) || length( $prog ) ) {
    8282            my $msg  = {};
    83             $$msg{ "_uuid" } = $$ref{ "_uuid" };
     83            $$msg{ "_uuid" } = $$req{ "_uuid" };
    8484            $$msg{ "_textarea" } = $text if length( $text );
    8585            $$msg{ "_progress" } = $prog if length( $prog );
     
    118118    print OUT "$0\n";
    119119    print OUT "--- input ---\n";
    120     print OUT Dumper($ref);
     120    print OUT Dumper($req);
    121121    print OUT "--- output ---\n";
    122122    print OUT Dumper($res);
  • etc/monitor/monitor.pl

    r1363 r1598  
    2020die "$0: configuration file $cf does not exist\n" if !-e $cf;
    2121
    22 $version = "Web monitor 0.6";
     22$version = "Web monitor 0.7";
    2323
    2424sub read_params {
    2525    print "read_params\n";
     26    undef %msgs;
     27    undef %failmsgs;
     28    undef @check;
     29
    2630    my $json = {};
    2731    {
  • etc/perl/genapp_util.pl

    r1363 r1598  
    732732    }
    733733
     734    # remove tags with structures and store in last_json
     735
     736    if ( $$json{ 'dependencies' } ) {
     737        my $js = JSON->new;
     738        $extra_subs{ '__dependencies__' } = $js->encode( $$json{ 'dependencies' } );
     739        delete $$json{ 'dependencies' };
     740    } else {
     741        delete $extra_subs{ '__dependencies__' };
     742    }
     743       
    734744    $json;
    735745}
     
    11121122        {
    11131123            $menu = $json;
     1124            # check for menu.json issues
     1125            my $ref_menu = {};
     1126            my $rplc_menu = start_json( $menu, $ref_menu );
     1127            my $freq = "menu:id";
     1128            my %used_menu_ids;
     1129            my %used_module_ids;
     1130            do {
     1131                $used_menu_ids{ $$rplc_menu{ $freq } }++;
     1132            } while( $rplc_menu = next_json( $ref_menu, $freq ) );
     1133            my $rplc_menu = start_json( $menu, $ref_menu );
     1134            $freq = "menu:modules:id";
     1135            do {
     1136                $error .= "menu.json error: menu:id \"$$rplc_menu{$freq}\" is duplicated as a module:id\n"
     1137                    if $used_menu_ids{ $$rplc_menu{ $freq } };
     1138                $error .= "menu.json error: menu:module:id \"$$rplc_menu{$freq}\" is duplicated\n"
     1139                    if $used_module_ids{ $$rplc_menu{ $freq } }++;
     1140            } while( $rplc_menu = next_json( $ref_menu, $freq ) );
    11141141        }
    11151142
  • etc/reserved_words

    r1363 r1598  
    8787config
    8888text
     89dependencies
  • languages/html5.json

    r1440 r1598  
    44  "description" : "This is our first try at an html5 based genapp module",
    55  "version"     : 1,
    6   "register"    : "genapp_reg",
     6  "register"    : "__genapp__/bin/genapp_reg",
    77# options are for directives in the inputs (one source base can create tweaked versions)
    88  "options"     : {
     
    1919                   {
    2020                    "frequency"  : "once",
     21                    "output"     : "css/ga.css",
     22                    "inputs"     : [
     23                                    { "css/ga.css" : "once"        }
     24                                   ]
     25                    },
     26                   {
     27                    "frequency"  : "once",
    2128                    "output"     : "ajax/sys_uid.php",
    2229                    "inputs"     : [
     
    129136                   ,{
    130137                    "frequency"  : "once",
     138                    "output"     : "ajax/sys_config/qr_post.php",
     139                    "inputs"     : [
     140                                    { "sys/qr_post.php" : "once" }
     141                                   ]
     142                   }
     143                   ,{
     144                    "frequency"  : "once",
    131145                    "setexecutable" : "true",
    132146                    "output"     : "ajax/sys_config/sys_file_manager_run.php",
     
    203217                                   ]
    204218                   }
     219                   ,{
     220                    "frequency"  : "once",
     221                    "output"     : "util/msg-tcpserver.go",
     222                    "inputs"     : [
     223                                    { "util/msg-tcpserver.go" : "once" }
     224                                   ]
     225                   }
     226                   ,{
     227                    "frequency"  : "once",
     228                    "output"     : "util/build-tcp.sh",
     229                    "setexecutable" :"true",
     230#                    "execute"    : "atend",
     231                    "inputs"     : [
     232                                     { "util/build-tcp.sh" : "once" }
     233                                   ]
     234                   }   
    205235                   ,{
    206236                    "frequency"  : "once",
     
    361391                                   ]
    362392                   }
     393                  ,{
     394                    "frequency"  : "once",
     395                    "output"     : "ajax/sys/uploader.php",
     396                    "inputs"     : [
     397                                    { "sys/uploader.php" : "once" }
     398                                   ]
     399                   }
    363400                   ,{
    364401                    "frequency"  : "once",
     
    412449                    "frequency"  : "once",
    413450                    "output"     : "js/ga.js",
    414 #                   "minify"     : "copy",
     451#                    "minify"     : "copy",
    415452#                    "minify"     : "minify",
    416453#                    "minify"     : "closure",
     
    436473                                    ,{ "js/calc.js"             : "once" }
    437474                                    ,{ "js/bokeh.js"            : "once" }
     475                                    ,{ "js/grid.js"             : "once" }
     476                                    ,{ "js/qr.js"               : "once" }
     477                                    ,{ "js/msg.js"              : "once" }
     478                                    ,{ "js/ws.js"               : "once" }
    438479                                   ]
    439480                   }
     
    462503                        ,{ "add/js/spectrum.min.js"                 : "once" }
    463504                        ,{ "add/js/jq.flot-0.8.3+eb+nav+sel.min.js" : "once" }
     505                        ,{ "add/js/plotly-latest.min.js"            : "once" }
    464506                        ,{ "add/js/uuid.min.js"                     : "once" }
    465507                        ,{ "add/js/autobahn.min.js"                 : "once" }
     
    470512                        ,{ "add/js/jquery.base64.min.js"            : "once" }
    471513                        ,{ "add/js/html2canvas.min.js"              : "once" }
    472                         ,{ "add/js/bokeh-0.12.7.min.js"             : "once" }
    473                         ,{ "add/js/bokeh-widgets-0.12.7.min.js"     : "once" }
     514                        ,{ "add/js/ngl.js"                          : "once" }
    474515                        ,{ "add/js/ga.min.js"                       : "once" }
    475516                    ]
  • languages/html5/add/js/ga.min.js

    r1363 r1598  
    1 var ga={tmp:{},multistage:{},stages:{},stagesdefault:{},currentstage:0,fielderrors:0};
    2 (function(a,b){a.jstree.defaults.conditionalselect=function(){return!0};a.jstree.plugins.conditionalselect=function(a,b){this.activate_node=function(a,c){this.settings.conditionalselect.call(this,this.get_node(a))&&b.activate_node.call(this,a,c)}};a.jstree.plugins.singleselect=function(a,b){this.activate_node=function(a,c){this.is_leaf(a)&&b.activate_node.call(this,a,c)}};a.jstree.plugins.selectonlyleaf=function(a,b){this.activate_node=function(a,c){this.is_leaf(a)&&b.activate_node.call(this,a,c)}};
    3 a.jstree.plugins.singleselectpath=function(a,b){this.activate_node=function(a,c){this.is_leaf(a)||b.activate_node.call(this,a,c)}};a.jstree.plugins.selectnoleaf=function(a,b){this.activate_node=function(a,c){this.is_leaf(a)||b.activate_node.call(this,a,c)}};a.jstree.defaults.sort=function(a,b){return this.get_node(a).data.time<this.get_node(b).data.time?1:-1}})(jQuery);RegExp.quote=function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")};
    4 Object.size=function(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b};ga.set=function(a,b){b&&(ga.set.data[a]=b);return ga.set.data[a]};ga.set.data={};ga.restricted={};ga.restricted.add=function(a,b){ga.restricted.ids[a]=ga.restricted.ids[a]||[];ga.restricted.ids[a].push(b)};ga.restricted.hideall=function(){var a;ga.restricted.data={};for(a in ga.restricted.ids)$(ga.restricted.ids[a].join()).hide()};
    5 ga.restricted.show=function(a){for(var b in a)ga.restricted.data[a[b]]=1,ga.restricted.ids[a[b]]&&$(ga.restricted.ids[a[b]].join()).show()};ga.specproj=function(a,b){var c={};c.id=a;c.value=b;ga.specproj.data.push(c)};ga.specproj.data=[];ga.specproj.clear=function(){ga.specproj.data=[]};
    6 ga.specproj.gname=function(){var a,b,c="";for(a in ga.specproj.data)ga.specproj.data.hasOwnProperty(a)&&(b=$(ga.specproj.data[a].value).val(),b==parseFloat(b)&&(b=parseFloat(b)),b=ga.specproj.data[a].id+b,c+=b.replace(/[^A-z0-9.-]+/g,"_"));return c};ga.urlparams=function(a){for(var b=window.location.search.substring(1).split("&"),c=0;c<b.length;c++){var d=b[c].split("=");if(d[0]==a)return d[1]}};ga.frontpage=function(a){$("html").load(a)};
    7 ga.loader=function(a,b){ga.loader.jqtag=a;ga.loader.delay=b};ga.loader.timeout=null;ga.loader.startshow=function(){ga.loader.timeout?(clearTimeout(ga.loader.timeout),ga.loader.timeout=null,$(ga.loader.jqtag).show()):$(ga.loader.jqtag).hide()};ga.loader.hide=function(){ga.loader.timeout&&(clearTimeout(ga.loader.timeout),ga.loader.timeout=null);$(ga.loader.jqtag).hide()};ga.loader.show=function(){ga.loader.timeout&&clearTimeout(ga.loader.timeout);ga.loader.timeout=setTimeout(ga.loader.startshow(),ga.loader.delay)};
    8 ga.menumodules=[];ga.group={};ga.group.set=function(a){ga.group.all=a};ga.group.setuser=function(a){var b;ga.group.user=a;ga.group.userhas={};for(b in ga.group.user)ga.group.userhas[ga.group.user[b]]=1;ga.group.show()};
    9 ga.group.inputhtml=function(a){var b="",c,d;ga.group.activeids={};if(!ga.group.all)return b;for(c in ga.group.all)ga.group.all[c].userconfig&&(d="_setgroup_"+a+"_"+c,b+='<tr><td><label for="'+d+'" class="highlight">'+(ga.group.all[c].label?ga.group.all[c].label:c)+'</label></td><td><input type="checkbox" name="'+d+'" id="'+d+'"'+(ga.group.userhas[c]?" checked":"")+(ga.group.all[c].help?' class="help_link"><span class="help">'+ga.group.all[c].help+"</span":"")+"></td></tr>",ga.group.activeids[c]=d);
    10 return b};ga.group.addmenu=function(a,b){ga.group.menuids[a]=ga.group.menuids[a]||[];ga.group.menuids[a].push(b)};ga.group.hideall=function(){for(var a in ga.group.menuids)$(ga.group.menuids[a].join()).hide()};ga.group.show=function(){var a;ga.group.hideall();for(a in ga.group.userhas)ga.group.menuids[a]&&$(ga.group.menuids[a].join()).show();ga.group.menuids.login&&$(ga.group.menuids.login.join()).show()};
     1var ga={tmp:{},multistage:{},stages:{},stagesdefault:{},currentstage:0,fielderrors:{},customtooltips:{},showcollapse3d:{},plotted3d:{},showcollapse2d:{},plotted2d:{}};
     2(function(a,c){a.jstree.defaults.conditionalselect=function(){return!0};a.jstree.plugins.conditionalselect=function(a,c){this.activate_node=function(a,b){this.settings.conditionalselect.call(this,this.get_node(a))&&c.activate_node.call(this,a,b)}};a.jstree.plugins.singleselect=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)&&c.activate_node.call(this,a,b)}};a.jstree.plugins.selectonlyleaf=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)&&c.activate_node.call(this,a,b)}};
     3a.jstree.plugins.singleselectpath=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)||c.activate_node.call(this,a,b)}};a.jstree.plugins.selectnoleaf=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)||c.activate_node.call(this,a,b)}};a.jstree.defaults.sort=function(a,c){return this.get_node(a).data.time<this.get_node(c).data.time?1:-1}})(jQuery);RegExp.quote=function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")};
     4Object.size=function(a){var c=0,b;for(b in a)a.hasOwnProperty(b)&&c++;return c};ga.set=function(a,c){c&&(ga.set.data[a]=c);return ga.set.data[a]};ga.set.data={};ga.restricted={};ga.restricted.add=function(a,c){ga.restricted.ids[a]=ga.restricted.ids[a]||[];ga.restricted.ids[a].push(c)};ga.restricted.hideall=function(){var a;ga.restricted.data={};for(a in ga.restricted.ids)$(ga.restricted.ids[a].join()).hide()};
     5ga.restricted.show=function(a){for(var c in a)ga.restricted.data[a[c]]=1,ga.restricted.ids[a[c]]&&$(ga.restricted.ids[a[c]].join()).show()};ga.specproj=function(a,c){var b={};b.id=a;b.value=c;ga.specproj.data.push(b)};ga.specproj.data=[];ga.specproj.clear=function(){ga.specproj.data=[]};
     6ga.specproj.gname=function(){var a,c,b="";for(a in ga.specproj.data)ga.specproj.data.hasOwnProperty(a)&&(c=$(ga.specproj.data[a].value).val(),c==parseFloat(c)&&(c=parseFloat(c)),c=ga.specproj.data[a].id+c,b+=c.replace(/[^A-z0-9.-]+/g,"_"));return b};ga.urlparams=function(a){for(var c=window.location.search.substring(1).split("&"),b=0;b<c.length;b++){var e=c[b].split("=");if(e[0]==a)return e[1]}};ga.frontpage=function(a){$("html").load(a)};
     7ga.loader=function(a,c){ga.loader.jqtag=a;ga.loader.delay=c};ga.loader.timeout=null;ga.loader.startshow=function(){ga.loader.timeout?(clearTimeout(ga.loader.timeout),ga.loader.timeout=null,$(ga.loader.jqtag).show()):$(ga.loader.jqtag).hide()};ga.loader.hide=function(){ga.loader.timeout&&(clearTimeout(ga.loader.timeout),ga.loader.timeout=null);$(ga.loader.jqtag).hide()};ga.loader.show=function(){ga.loader.timeout&&clearTimeout(ga.loader.timeout);ga.loader.timeout=setTimeout(ga.loader.startshow(),ga.loader.delay)};
     8ga.menumodules=[];ga.group={};ga.group.set=function(a){ga.group.all=a};ga.group.setuser=function(a){var c;ga.group.user=a;ga.group.userhas={};for(c in ga.group.user)ga.group.userhas[ga.group.user[c]]=1;ga.group.show()};
     9ga.group.inputhtml=function(a){var c="",b,e;ga.group.activeids={};if(!ga.group.all)return c;for(b in ga.group.all)ga.group.all[b].userconfig&&(e="_setgroup_"+a+"_"+b,c+='<tr><td><label for="'+e+'" class="highlight">'+(ga.group.all[b].label?ga.group.all[b].label:b)+'</label></td><td><input type="checkbox" name="'+e+'" id="'+e+'"'+(ga.group.userhas[b]?" checked":"")+(ga.group.all[b].help?' class="help_link"><span class="help">'+ga.group.all[b].help+"</span":"")+"></td></tr>",ga.group.activeids[b]=e);
     10return c};ga.group.addmenu=function(a,c){ga.group.menuids[a]=ga.group.menuids[a]||[];ga.group.menuids[a].push(c)};ga.group.hideall=function(){for(var a in ga.group.menuids)$(ga.group.menuids[a].join()).hide()};ga.group.show=function(){var a;ga.group.hideall();for(a in ga.group.userhas)ga.group.menuids[a]&&$(ga.group.menuids[a].join()).show();ga.group.menuids.login&&$(ga.group.menuids.login.join()).show()};
    1111ga.browser=function(){var a=navigator.userAgent;ga.browser.type="unknown";ga.browser.prefix="";ga.browser.gradient=!1;ga.browser.clrpkr=!1;-1<a.indexOf("Chrome")?(ga.browser.type="chrome",ga.browser.prefix="-webkit-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("Safari")?(ga.browser.type="safari",ga.browser.prefix="-webkit-",ga.browser.gradient=!0):-1<a.indexOf("Opera")?(ga.browser.type="opera",ga.browser.prefix="-o-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("Firefox")?
    1212(ga.browser.type="mozilla",ga.browser.prefix="-moz-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("MSIE")&&(ga.browser.type="msie",ga.browser.prefix="",ga.browser.gradient=!0)};ga.cssrule={};
    13 ga.cssrule.get=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var c=0;c<document.styleSheets.length;c++){var d=document.styleSheets[c],e=0,f=!1;do{if((f=d.cssRules?d.cssRules[e]:d.rules[e])&&f.selectorText&&f.selectorText.toLowerCase()==a)return"delete"==b?(d.cssRules?d.deleteRule(e):d.removeRule(e),!0):f;e++}while(f)}return!1};ga.cssrule.kill=function(a){return ga.cssrule.get(a,"delete")};
     13ga.cssrule.get=function(a,c){a=a.toLowerCase();if(document.styleSheets)for(var b=0;b<document.styleSheets.length;b++){var e=document.styleSheets[b],f=0,d=!1;do{if((d=e.cssRules?e.cssRules[f]:e.rules[f])&&d.selectorText&&d.selectorText.toLowerCase()==a)return"delete"==c?(e.cssRules?e.deleteRule(f):e.removeRule(f),!0):d;f++}while(d)}return!1};ga.cssrule.kill=function(a){return ga.cssrule.get(a,"delete")};
    1414ga.cssrule.add=function(a){document.styleSheets&&(ga.cssrule.get(a)||(document.styleSheets[0].addRule?document.styleSheets[0].addRule(a,null,0):document.styleSheets[0].insertRule(a+" { }",0)));return ga.cssrule.get(a)};ga.cache={};
    15 ga.cache.msg=function(a,b,c,d,e,f,h){switch(a){case "notify":if(ga.restricted.data[b]){messagebox({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:c,adata:[e,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[e,b]},{id:"cancel",label:"Cancel"}]});return}messagebox({icon:"information.png",text:"Showing previously computed results."});break;case "askrecompute":ga.restricted.data[b]?messagebox({icon:"question.png",
    16 text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:c,adata:[e,0,1,1]},{id:"recompute",label:"Recompute results",cb:d,adata:[f,h,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[e,b]},{id:"cancel",label:"Cancel"}]}):messagebox({icon:"question.png",text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:c,adata:[e,0,1,1]},{id:"recompute",label:"Recompute results",
    17 cb:d,adata:[f,h,1]},{id:"cancel",label:"Cancel"}]});return;default:if(ga.restricted.data[b]){messagebox({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:c,adata:[e,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[e,b]},{id:"cancel",label:"Cancel"}]});return}}c(e,0,1,1)};
    18 ga.cache.clear=function(a,b){messagebox({icon:"admin.png",text:"Are you sure you want to permanently remove this previously computed result?",buttons:[{id:"clear",label:"Clear cached result",cb:ga.cache.doclear,adata:[a,b]},{id:"cancel",label:"Cancel"}]})};
    19 ga.cache.doclear=function(a,b){ga.cache.url_clear?$.getJSON(ga.cache.url_clear,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_uuid:a,_cachedelete:b}).done(function(a,b,e){"true"==a.success?messagebox({icon:"information.png",text:"Previously computed results cleared"}):messagebox({icon:"toast.png",text:a.error})}).fail(function(a,b,e){console.warn("could not clear cache data");messagebox({icon:"toast.png",text:"Error: server failed to clear cached entry"})}):messagebox({icon:"toast.png",
    20 text:"Internal error: no url defined for cache clear"})};ga.trytilltrue=function(a,b,c,d){if(eval(a))return eval(b);c--;if(0>c)console.warn("ga.trytilltrue failed ... to many tries");else return setTimeout(ga.trytilltrue,d,a,b,c,d)};ga.login={};
    21 ga.login.verify=function(a){var b={text:a.text||"You must verify your email address."};a.useroptions&&(a.useroptions.resend&&(b.buttons=b.buttons||[],b.buttons.push({id:"resend",label:"Resend the verification email",cb:ga.login.verify.resend})),a.useroptions.resend&&(b.buttons=b.buttons||[],b.buttons.push({id:"changeaddress",label:"Change your email address and resend the verification",cb:ga.login.verify.change})),a.useroptions.cancel&&(b.buttons=b.buttons||[],b.buttons.push({id:"cancelregistration",
    22 label:"Cancel your registration",cb:ga.login.verify.cancel})));messagebox(b)};ga.login.verify.resend=function(){var a=$("#sys_login");if(!a)return messagebox({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendverify" class="toclear">');do_sys_login_submit(a)};
    23 ga.login.verify.change=function(){return messagebox({icon:"question.png",text:'<center><label  class="header3 ">Change email address</label></center><form id="_changeemail"><table><tr><td><label for="_changeemail1">Email address </label></td><td><input type="email" name="_changeemail1" id="_changeemail1" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail1_msg" class="warning field_msg" > </span></td></tr><tr><td><label for="_changeemail2">Repeat email address </label></td><td><input type="email" name="_changeemail2" id="_changeemail2" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail2_msg" class="warning field_msg" > </span></td></tr></table></form><script>$( "#_changeemail1" ).keypress( function() { $( "#_changeemail1_msg" ).html( "" );});$( "#_changeemail2" ).keypress( function() { $( "#_changeemail2_msg" ).html( "" );});$( "#_changeemail2" ).blur( function() { ga.valid.checkMatch( "#_changeemail2", "#_changeemail1" ); } );setHoverHelp();\x3c/script>',buttons:[{id:"_changeemailbutton",
     15ga.cache.msg=function(a,c,b,e,f,d,g){switch(a){case "notify":if(ga.restricted.data[c]){ga.msg.box({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[f,c]},{id:"cancel",label:"Cancel"}]});return}ga.msg.box({icon:"information.png",text:"Showing previously computed results."});break;case "askrecompute":ga.restricted.data[c]?ga.msg.box({icon:"question.png",
     16text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"recompute",label:"Recompute results",cb:e,adata:[d,g,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[f,c]},{id:"cancel",label:"Cancel"}]}):ga.msg.box({icon:"question.png",text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"recompute",label:"Recompute results",
     17cb:e,adata:[d,g,1]},{id:"cancel",label:"Cancel"}]});return;default:if(ga.restricted.data[c]){ga.msg.box({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[f,c]},{id:"cancel",label:"Cancel"}]});return}}b(f,0,1,1)};
     18ga.cache.clear=function(a,c){ga.msg.box({icon:"admin.png",text:"Are you sure you want to permanently remove this previously computed result?",buttons:[{id:"clear",label:"Clear cached result",cb:ga.cache.doclear,adata:[a,c]},{id:"cancel",label:"Cancel"}]})};
     19ga.cache.doclear=function(a,c){ga.cache.url_clear?$.getJSON(ga.cache.url_clear,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_uuid:a,_cachedelete:c}).done(function(a,c,f){"true"==a.success?ga.msg.box({icon:"information.png",text:"Previously computed results cleared"}):ga.msg.box({icon:"toast.png",text:a.error})}).fail(function(a,c,f){console.warn("could not clear cache data");ga.msg.box({icon:"toast.png",text:"Error: server failed to clear cached entry"})}):ga.msg.box({icon:"toast.png",
     20text:"Internal error: no url defined for cache clear"})};ga.trytilltrue=function(a,c,b,e){if(eval(a))return eval(c);b--;if(0>b)console.warn("ga.trytilltrue failed ... to many tries");else return setTimeout(ga.trytilltrue,e,a,c,b,e)};ga.login={};
     21ga.login.verify=function(a){var c={text:a.text||"You must verify your email address."};a.useroptions&&(a.useroptions.resend&&(c.buttons=c.buttons||[],c.buttons.push({id:"resend",label:"Resend the verification email",cb:ga.login.verify.resend})),a.useroptions.resend&&(c.buttons=c.buttons||[],c.buttons.push({id:"changeaddress",label:"Change your email address and resend the verification",cb:ga.login.verify.change})),a.useroptions.cancel&&(c.buttons=c.buttons||[],c.buttons.push({id:"cancelregistration",
     22label:"Cancel your registration",cb:ga.login.verify.cancel})));ga.msg.box(c)};ga.login.verify.resend=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendverify" class="toclear">');do_sys_login_submit(a)};
     23ga.login.verify.change=function(){return ga.msg.box({icon:"question.png",text:'<center><label  class="header3 ">Change email address</label></center><form id="_changeemail"><table><tr><td><label for="_changeemail1">Email address </label></td><td><input type="email" name="_changeemail1" id="_changeemail1" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail1_msg" class="warning field_msg" > </span></td></tr><tr><td><label for="_changeemail2">Repeat email address </label></td><td><input type="email" name="_changeemail2" id="_changeemail2" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail2_msg" class="warning field_msg" > </span></td></tr></table></form><script>$( "#_changeemail1" ).keypress( function() { $( "#_changeemail1_msg" ).empty();});$( "#_changeemail2" ).keypress( function() { $( "#_changeemail2_msg" ).empty();});$( "#_changeemail2" ).blur( function() { ga.valid.checkMatch( "#_changeemail2", "#_changeemail1" ); } );ga.hhelp.set();\x3c/script>',buttons:[{id:"_changeemailbutton",
    2424label:"Submit",cb:ga.login.verify.change.doit},{id:"_changeemailcancel",label:"Cancel"}]})};
    25 ga.login.verify.change.doit=function(){var a=$("#sys_login");if(!a)return messagebox({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendverify" class="toclear">');a.append('<input type="hidden" name="_changeemail" class="toclear">');a.append('<input type="hidden" name="_changeemail1" value="'+$("#_changeemail1").val()+'" class="toclear">');a.append('<input type="hidden" name="_changeemail2" value="'+$("#_changeemail2").val()+'" class="toclear">');do_sys_login_submit(a)};
    26 ga.login.verify.cancel=function(){var a=$("#sys_login");if(!a)return messagebox({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_cancel" class="toclear">');do_sys_login_submit(a)};
    27 ga.login.approve=function(a){var b={text:a.text||"Your registration is pending approval."};a.useroptions&&(a.useroptions.resend&&(b.buttons=b.buttons||[],b.buttons.push({id:"resend",label:"Resend the approval request",cb:ga.login.approve.resend})),a.useroptions.cancel&&(b.buttons=b.buttons||[],b.buttons.push({id:"cancelregistration",label:"Cancel your registration request",cb:ga.login.approve.cancel})));messagebox(b)};
    28 ga.login.approve.resend=function(){var a=$("#sys_login");if(!a)return messagebox({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendapprove" class="toclear">');do_sys_login_submit(a)};ga.login.approve.cancel=function(){var a=$("#sys_login");if(!a)return messagebox({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_cancel" class="toclear">');do_sys_login_submit(a)};ga.admin={};
    29 ga.admin.ajax=function(a,b,c,d,e){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:b,_id:c,_manageid:d,_jid:e}).done(function(a,b,c){a=JSON.parse(a.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=a.success&&messagebox({icon:"toast.png",text:a.error?a.error:"unknown error"});a._submitid&&$("#"+a._submitid).trigger("click")}).fail(function(a,b,c){messagebox({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
    30 c})})};ga.admin.ajax.remove=function(a,b,c,d){messagebox({icon:"admin.png",text:"Are you sure you want to permanently remove this user, all of their job history and their stored data?",buttons:[{id:"yes",label:"Yes, remove this user",cb:ga.admin.ajax,adata:[a,b,c,d]},{id:"cancel",label:"Cancel"}]})};
    31 ga.admin.ajax.group=function(a,b,c,d,e){messagebox({icon:"admin.png",text:"Enter the group for user "+b+'<form id="sys_musergrp"><input id="sys_musergrp_text" class="help_link" type="text" size="25" value="'+e+'"><span class="help">Enter a group for this user, then press ok or cancel</span></form>',eval:"resetHoverHelp();$('#sys_musergrp').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"ok",label:"Ok",cb:ga.admin.ajax.group.cb,
    32 adata:[a,b,c,d]},{id:"cancel",label:"Cancel"}]})};
    33 ga.admin.ajax.group.cb=function(a,b,c,d,e){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:b,_id:c,_manageid:d,_group:$("#sys_musergrp_text").val()}).done(function(a,b,c){a=JSON.parse(a.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=a.success&&messagebox({icon:"toast.png",text:a.error?a.error:"unknown error"});a._submitid&&$("#"+a._submitid).trigger("click")}).fail(function(a,b,c){messagebox({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
    34 c})})};ga.admin.ajax.jobview=function(a,b,c,d){$("#configbody").load("etc/userjob.html",function(){$("#jobtext_label").html("Jobs for "+b);$.ajax({url:ga.jc.url,data:{_window:window.name,_asuser:b,_id:c,_manageid:d}}).success(function(a){$("#seluserjobs").html(a)}).error(function(a){$("#seluserjobs").html("error:"+data)})});$(".modalDialog").addClass("modalDialog_on")};
    35 ga.admin.ajax.cancel=function(a,b,c,d,e){messagebox({icon:"admin.png",text:"Are you sure you want to cancel this '"+d+"' job belonging to "+a+" ?",buttons:[{id:"yes",label:"Yes, cancel the job",cb:ga.admin.ajax.cancel.cb,adata:[a,b,c,e]},{id:"no",label:"No"}]})};ga.admin.ajax.cancel.cb=function(a,b,c,d){$(".modalDialog").removeClass("modalDialog_on");ga.admin.ajax("jobcancel",a,b,c,d)};
    36 ga.extrahidden=function(a){if(ga.set.data.extrahidden&&ga.set.data.extrahidden[a]){var b=$("#"+a),c,d="";for(c in ga.set.data.extrahidden[a])d+='<input type="hidden" name="'+c+'" value="'+ga.set.data.extrahidden[a][c]+'">';b.append(d);delete ga.set.data.extrahidden[a]}};ga.colors=function(a){ga.colors.background=ga.colors.makeRGB(a.background);ga.colors.text=ga.colors.makeRGB(a.text)};
    37 ga.colors.makeRGB=function(a){if(/\d{1,3},\s*\d{1,3},\s*\d{1,3}$/.test(a))return a;a=ga.color.toRGB(a);return a.r+","+a.g+","+a.b};ga.plot_options=function(){var a="rgb( "+ga.colors.text+" )";return{font:{color:a},grid:{hoverable:!1},xaxis:{color:"gray",lineWidth:.5,font:{color:a}},yaxis:{color:"gray",lineWidth:.5,font:{color:a}},lines:{lineWidth:1},zoom:{interactive:!1},pan:{interactive:!1}}};ga.color=function(a){ga.color.data=a;ga.colors(a.body);ga.color.apply()};
    38 ga.color.defaults=function(a){ga.browser();ga.color.defaults.data=a;ga.color(a)};ga.color.toRGB=function(a){var b,c;if("#"===a.slice(0,1))return c=parseInt(a.slice(1),16),b=parseInt(c/256),c-=256*b,a=parseInt(b/256),{r:a,b:c,g:b-256*a};(bits=/^rgb\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\s*\)$/.exec(a))?(a=parseInt(bits[1]),b=parseInt(bits[2]),c=parseInt(bits[3])):c=b=a=128;return{r:a,b:c,g:b}};
    39 ga.color.apply=function(){var a,b,c,d,e,f,h;if(ga.directives.data&&ga.directives.data.usercolors&&!/^(off|0|false)$/.test(ga.directives.data.usercolors)){for(a in ga.color.data)ga.color.data.hasOwnProperty(a)&&(b=$(a))&&b.css(ga.color.data[a]);$(".sidebar ul li, .title").css("color",ga.color.data.body.color).hover(function(){$(this).css("color",ga.color.defaults.data.hovercolor.color)},function(){$(this).css("color",ga.color.data.body.color)});$(".svgmenu").css({color:ga.color.data.body.color,stroke:ga.color.data.body.color}).hover(function(){$(this).css({color:ga.color.defaults.data.hovercolor.color,
    40 stroke:ga.color.defaults.data.hovercolor.color})},function(){$(this).css({color:ga.color.data.body.color,stroke:ga.color.data.body.color})});"#"===ga.color.data.body.background.slice(0,1)?(c=parseInt(ga.color.data.body.background.slice(1),16),b=parseInt(c/256),c-=256*b,a=parseInt(b/256),b-=256*a,a+=128<a?-20:20,b+=128<b?-20:20,c+=128<c?-20:20,$(".help,.coord").css({background:"rgba("+a+","+b+","+c+",0.8)",color:ga.color.data.body.color})):$(".help,.coord").css({background:ga.color.data[".help"].background,
    41 color:ga.color.data[".help"].color});"#"===ga.color.data.body.color.slice(0,1)?(c=parseInt(ga.color.data.body.color.slice(1),16),b=parseInt(c/256),c-=256*b,a=parseInt(b/256),b-=256*a,d=a,e=b,f=c,a+=128<a?-12:12,b+=128<b?-12:12,c+=128<c?-12:12,$(".header1").css({color:"rgb("+a+","+b+","+c+")"}),a+=128<a?-12:12,b+=128<b?-12:12,c+=128<c?-12:12,$(".header2").css({color:"rgb("+a+","+b+","+c+")"}),a+=128<a?-12:12,b+=128<b?-12:12,c+=128<c?-12:12,$(".header3").css({color:"rgb("+a+","+b+","+c+")"}),a+=128<
    42 a?-12:12,b+=128<b?-12:12,c+=128<c?-12:12,$(".header4").css({color:"rgb("+a+","+b+","+c+")"}),a+=128<a?-12:12,b+=128<b?-12:12,c+=128<c?-12:12,$("hr").css({color:"rgb("+a+","+b+","+c+")"}),a=d,b=e,c=f,b+=128<b?-75:75,ga.cssrule.kill("a:link"),h=ga.cssrule.add("a:link"),h.style.color="rgb("+a+","+b+","+c+")",b=e,c+=128<c?-75:75,a+=128<a?-75:75,ga.cssrule.kill("a:visited"),h=ga.cssrule.add("a:visited"),h.style.color="rgb("+a+","+b+","+c+")",c=f,a=d,a+=128<a?-75:75,ga.cssrule.kill("a:active"),h=ga.cssrule.add("a:active"),
    43 h.style.color="rgb("+a+","+b+","+c+")"):($(".header1").css({color:ga.color.data[".header1"]?ga.color.data[".header1"].color:ga.color.data.body.color}),$(".header2").css({color:ga.color.data[".header2"]?ga.color.data[".header2"].color:ga.color.data.body.color}),$(".header3").css({color:ga.color.data[".header3"]?ga.color.data[".header3"].color:ga.color.data.body.color}),$(".header4").css({color:ga.color.data[".header4"]?ga.color.data[".header4"].color:ga.color.data.body.color}));$(".modalDialog > div, .modalDialog2 > div, .modalDialog3 > div, .modalDialog4 > div").css({background:ga.browser.gradient?
    44 ga.browser.prefix+"linear-gradient("+ga.color.data.body.background+", #222)":ga.color.data.body.background})}};ga.color.reset=function(){ga.color(ga.color.defaults.data)};ga.color.spectrum=function(a){if(!ga.browser.clrpkr)$(a).on("change.spectrum",function(b,c){console.log("hi spectrum"+a);$(a).val(c.toHexString())})};ga.color.spectrum.val=function(a,b){if(!ga.browser.clrpkr)if(b)$(a).spectrum({color:b});else return $(a).spectrum("get").toHexString()};
    45 ga.event=function(a,b,c){ga.event.log.push({menu:a,module:b,action:c,when:new Date})};ga.event.log=[];ga.event.list=function(){for(var a=0,b=ga.event.log.length,c="Client Date/Time is "+(new Date).toUTCString()+"\n";a<b;a++)c+=ga.event.log[a].menu+" "+ga.event.log[a].module+" "+ga.event.log[a].action+" "+ga.event.log[a].when.toUTCString()+"\n";return c};
    46 ga.fc=function(a,b){var c,d;ga.fc.cache[a]?b(ga.fc.cache[a]):ga.fc.waits[a]?ga.fc.waits[a].push(b):(ga.fc.waits[a]=[b],$.ajax(ga.fc.url+a).success(function(b){d=ga.fc.waits[a];delete ga.fc.waits[a];b=$.parseJSON(b);ga.fc.cache[a]=b;for(c=d.length;c--;)d[c](b)}).error(function(b){d=ga.fc.waits[a];delete ga.fc.waits[a];console.log("ajax error");console.dir(b);for(c=d.length;c--;)d[c]("**error**");ga.fc.ajax_error_msg("ajax get error: "+b.statusText)}));return!0};
    47 ga.fc.clear=function(a){var b,c=ga.fc.children(a);for(b in c)ga.fc.cache[b]&&delete ga.fc.cache[b];ga.fc.cache[a]&&delete ga.fc.cache[a];for(b in ga.fc.trees)$(b).length&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};ga.fc.refresh=function(a){for(var b in ga.fc.trees)$(b).length&&ga.fc.cache[a]&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};
    48 ga.fc.delete_node=function(a){a.length&&(ga.fc.url_delete&&0!==ga.fc.url_delete.length?$.ajax({url:ga.fc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(b){console.log("ajax delete done");b.error&&b.error.length?ga.fc.delete_error_msg(a,b.error):ga.fc.clear("#")}).error(function(a){console.log("ajax error");console.dir(a);ga.fc.ajax_error_msg("ajax delete error: "+a.statusText)}):console.log("ga.fc.delete_node, no url_delete "+
    49 a.join(",")))};ga.fc.delete_node_message=function(a){var b="You are about to permanently remove "+a.length+" file";if(!a.length)return"Can not remove a directory from here";b=1<a.length?b+"s and/or directories":b+" or directory";return b+" and the contents, including subdirectories, of any directory listed below<p>"};
    50 ga.fc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(a){return a.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};ga.fc.children=function(a,b){var c,d;b=b||{};if(ga.fc.cache[a])for(c=ga.fc.cache[a].length;c--;)ga.fc.cache[a][c].children&&(d=ga.fc.cache[a][c].id,ga.fc.cache[d]&&(b[d]=!0,b=ga.fc.children(d,b)));return b};ga.fc.cache={};ga.fc.waits={};ga.fc.trees={};
    51 ga.jc=function(a,b){var c,d;ga.jc.cache[a]?b(ga.jc.cache[a]):ga.jc.waits[a]?ga.jc.waits[a].push(b):(ga.jc.waits[a]=[b],$.ajax({url:ga.jc.url,data:{_tree:a,_window:window.name}}).success(function(b){d=ga.jc.waits[a];delete ga.jc.waits[a];b=$.parseJSON(b);ga.jc.cache[a]=b;for(c=d.length;c--;)d[c](b)}).error(function(b){d=ga.jc.waits[a];delete ga.jc.waits[a];console.log("ajax error");console.dir(b);for(c=d.length;c--;)d[c]("**error**");ga.jc.ajax_error_msg("ajax get error: "+b.statusText)}));return!0};
    52 ga.jc.clear_leaf=function(a){var b,c=0,d;for(b in ga.jc.trees)if($(b).length&&(d=$(b).jstree(!0).get_node(a))){c=1;break}c?ga.jc.clear(d.parent):ga.jc.clear("#")};ga.jc.clear=function(a){var b,c=ga.jc.children(a);for(b in c)ga.jc.cache[b]&&delete ga.jc.cache[b];ga.jc.cache[a]&&delete ga.jc.cache[a];for(b in ga.jc.trees)$(b).length&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};
    53 ga.jc.refresh=function(a){for(var b in ga.jc.trees)$(b).length&&ga.jc.cache[a]&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};
    54 ga.jc.delete_node=function(a){a.length&&(ga.jc.url_delete&&0!==ga.jc.url_delete.length?$.ajax({url:ga.jc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(b){console.log("ajax delete done");b.error&&b.error.length?ga.jc.delete_error_msg(a,b.error):ga.jc.clear("#")}).error(function(a){console.log("ajax error");console.dir(a);ga.jc.ajax_error_msg("ajax delete error: "+a.statusText)}):console.log("ga.jc.delete_node, no url_delete "+
    55 a.join(",")))};ga.jc.delete_node_message=function(a){var b="You are about to permanently remove "+a.length+" job";1<a.length&&(b+="s");return b};ga.jc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(a){return a.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};
    56 ga.jc.children=function(a,b){var c,d;b=b||{};if(ga.jc.cache[a])for(c=ga.jc.cache[a].length;c--;)ga.jc.cache[a][c].children&&(d=ga.jc.cache[a][c].id,ga.jc.cache[d]&&(b[d]=!0,b=ga.jc.children(d,b)));return b};ga.jc.cache={};ga.jc.waits={};ga.jc.trees={};ga.altfile=function(a,b,c){ga.altfile.data[a]=ga.altfile.data[a]||{};ga.altfile.data[a][b]=c};ga.altfile.data={};ga.altfile.bdata={};
    57 ga.altfile.list=function(a){var b;if(ga.altfile.data[a])for(b in ga.altfile.data[a])console.log("module:"+a+" idfile:"+b+" idref:"+ga.altfile.data[a][b]);else console.log("module:"+a+" Empty")};ga.altfile.listall=function(){var a;if(ga.altfile.data)for(a in ga.altfile.data)ga.altfile.list(a);else console.log("ga.altfile:no modules")};ga.altfile.test=function(){ga.altfile("module1","field1","ref1");ga.altfile("module1","field2","ref2");ga.altfile("module2","field3","ref3");ga.altfile.listall()};
    58 ga.altfile.add=function(a){var b,c="",d="#"+a;$(d+" ._hidden_altfiles").remove();$(d+" ._hidden_buttonvals").remove();if(ga.altfile.data[a])for(b in ga.altfile.data[a])c+='<input type="hidden" name="_selaltval_'+b+'" value="'+ga.altfile.data[a][b]+'" class="_hidden_altfiles">';if(ga.altfile.bdata[a])for(b in ga.altfile.bdata[a])c+='<input type="hidden" name="'+b+'" value="'+ga.altfile.bdata[a][b].val+'" class="_hidden_buttonvals">';c.length&&$(d).append(c)};
    59 ga.altfile.button=function(a,b,c,d,e,f){ga.altfile.bdata[a]=ga.altfile.bdata[a]||{};ga.altfile.bdata[a][b]={};ga.altfile.bdata[a][b].val={};ga.altfile.bdata[a][b].text=c;ga.altfile.bdata[a][b].call=d;ga.altfile.bdata[a][b].cb=e;ga.altfile.bdata[a][b].req=f||0};ga.altfile.button.value=function(a,b,c){ga.altfile.bdata[a][b].val=c};
    60 ga.altfile.button.call=function(a,b){var c;ga.altfile.bdata[a][b].call.length?(c=$("#_state").data("_logon"))&&c.length?($("#configbody").load("etc/"+ga.altfile.bdata[a][b].call+".html",function(){ga.altfile.bdata[ga.altfile.bdata[a][b].call]={};ga.altfile.bdata[ga.altfile.bdata[a][b].call].cb=ga.altfile.bdata[a][b].cb;$("#"+ga.altfile.bdata[a][b].call+"text_label").text(ga.altfile.bdata[a][b].text)}),ga.repeats.save(),$(".modalDialog").addClass("modalDialog_on")):messagebox({icon:"warning.png",text:"You must login to browse server information",
    61 buttons:[{id:"ok",label:"OK"}]}):ga.altfile.bdata[a][b].cb("cb");return!1};ga.altfile.button.simplecall=function(a,b){$("#configbody").load("ajax/"+a+"/"+b+".html",function(){});ga.repeats.save();$(".modalDialog").addClass("modalDialog_on");return!1};ga.altfile.button.cb=function(){closeModal()};
    62 ga.altfile.button.lrfile=function(a,b,c){var d=[],e="#"+b,f="#"+c,h="",g="_hidden_lrfile_sels_"+c;$(e+" ."+g).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(h+='<input type="hidden" name="'+c+'_altval[]" value="'+this.id+'" class="'+g+'">',d.push($.base64.decode(this.id).substr(2)))});d.length&&($(f+"_altval").html("<i>Server</i>: "+d),$(f+"_msg").html(""),$(f).val(""),$(e).append(h),ga.value.input[b]&&ga.value.input[b][c]&&ga.value.setInputfromRFile(d,ga.value.input[b][c].mode,
    63 ga.value.input[b][c].ids))};ga.altfile.button.rpath=function(a,b,c){var d=[];b="#"+b;var e="#"+c,f="",h="_hidden_rpath_sels_"+c,g=$(a).jstree(!0);$(b+" ."+h).remove();$.each(g.get_top_checked(!0),function(){g.is_leaf(this)||(f+='<input type="hidden" name="'+c+'[]" value="'+this.id+'" class="'+h+'"><input type="hidden" name="_decodepath_'+c+'" class="'+h+'">',d.push($.base64.decode(this.id).substr(2)))});d.length&&($(e+"_altval").html("<i>Server</i>: "+d),$(e+"_msg").html(""),$(e).val(""),$(b).append(f))};
    64 ga.altfile.button.rfile=function(a,b,c){var d=[],e="#"+b,f="#"+c,h="",g="_hidden_rfile_sels_"+c;$(a).jstree(!0);$(e+" ."+g).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(h+='<input type="hidden" name="'+c+'_altval[]" value="'+this.id+'" class="'+g+'">',d.push($.base64.decode(this.id).substr(2)))});d.length&&($(f+"_altval").html("<i>Server</i>: "+d),$(f+"_msg").html(""),$(f).val(""),$(e).append(h),ga.value.input[b]&&ga.value.input[b][c]&&ga.value.setInputfromRFile(d,
    65 ga.value.input[b][c].mode,ga.value.input[b][c].ids))};ga.altfile.button.job=function(a,b,c){var d="";b="#"+b;var e="#"+c,f="",h="_hidden_job_sels_"+c;$(a).jstree(!0);$(b+" ."+h).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(f+='<input type="hidden" name="'+c+'_altval[]" value="'+this.id+'" class="'+h+'">',d+="<tr><td>"+this.parent+":"+this.text+"</td></tr>")});d.length&&($(e+"_altval").html("<table>"+d+"</table>"),$(e+"_msg").html(""),$(e).val(""),$(b).append(f))};
    66 ga.altfile.button.getnames=function(a,b){var c=[];switch(b){case "rpath":c.push(a+"[]");break;case "rfile":c.push(a+"_altval[]");break;case "lrfile":a=a.replace(/_button$/,"");c.push(a+"_altval[]");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+b+" )")}return c};
    67 ga.altfile.button.getnamesinput=function(a,b){var c=[];switch(b){case "rpath":c.push(a);break;case "rfile":c.push(a+"_altval");break;case "lrfile":a=a.replace(/_button$/,"");c.push(a+"_altval");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+b+" )")}return c};
    68 ga.altfile.button.addhtml=function(a,b,c,d){var e="";switch(c){case "rpath":c="_hidden_rpath_sels_"+b;e+='<input type="hidden" name="'+b+'[]" value="'+d[0]+'" class="'+c+'"><input type="hidden" name="_decodepath_'+b+'" class="'+c+'">';break;case "rfile":e+='<input type="hidden" name="'+b+'_altval[]" value="'+d[0]+'" class="'+("_hidden_rfile_sels_"+b)+'">';break;case "lrfile":b=b.replace(/_button$/,"");e+='<input type="hidden" name="'+b+'_altval[]" value="'+d[0]+'" class="'+("_hidden_lrfile_sels_"+
    69 b)+'">';break;default:console.warn("ga.altfile.button.getnames( "+b+" , "+c+" )")}$("#"+a).append(e)};ga.valid={};ga.valid.checkMatch=function(a,b){$(a).val()!=$(b).val()?$(a+"_msg").html(" does not match"):$(a+"_msg").html("")};ga.valid.checkText=function(a){var b=$(a),c=b.val(),d=0,e=b.attr("pattern"),f=new RegExp(e);e?f.test(c)?(d=1,$(a+"_msg").html("")):c.length||b.prop("required")?$(a+"_msg").html(" wrong format"):d=1:!c&&b.prop("required")?$(a+"_msg").html(" missing required field"):d=1;return d};
    70 ga.valid.checkFloat=function(a){var b=$(a),c=b.val(),d=0;c.match(/^-?(([1-9][0-9]*)|(0))?([.][0-9]+)?([eE][-+]?[0-9]+)?$/)?(d=1,c<parseFloat(b.attr("min"))?(b.val(b.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):c>parseFloat(b.attr("max"))?(b.val(b.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):$(a+"_msg").html("")):c.length||b.prop("required")?$(a+"_msg").html(" wrong format"):d=1;return d};
    71 ga.valid.checkInt=function(a){var b=$(a),c=b.val(),d=0;c.match(/^-?((0)|([1-9][0-9]*))$/)?(d=1,c<parseInt(b.attr("min"))?(b.val(b.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):c>parseInt(b.attr("max"))?(b.val(b.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):parseInt(c)!=c?($(a+"_msg").html(" value rounded to nearset integer"),b.val(parseInt(parseFloat(c)+.5))):$(a+"_msg").html("")):c.length||b.prop("required")?$(a+"_msg").html(" wrong format"):d=1;return d};
    72 ga.valid.safeFile=function(a){var b=$(a);b.val().match("^[a-zA-Z0-9]+([a-zA-Z0-9_.-]+|/[a-zA-Z0-9_-])+$")?$(a+"_msg").html(""):(b.val(b.prop("defaultValue")),$(a+"_msg").html("Not an acceptable filename, reset to default"))};ga.valid.checkLrfile=function(a){var b=$(a),c=$(a+"_altval > i");a=$(a+"_msg");var d=0;if(!b||!b.is(":visible"))return 1;b&&b.val()&&b.val().length?d=1:c&&c.html()&&c.html().length&&"Server"===c.html()&&(d=1);d||a.html(" missing required field");return d};
    73 ga.valid.checkRpath=function(a){var b=$(a),c=$(a+"_altval > i");a=$(a+"_msg");var d=0;if(!b||!b.is(":visible"))return 1;c&&c.html()&&c.html().length&&"Server"===c.html()&&(d=1);d||a.html(" missing required field");return d};ga.valid.checkRfile=function(a){var b=$(a),c=$(a+"_altval > i");a=$(a+"_msg");var d=0;if(!b||!b.is(":visible"))return 1;c&&c.html()&&c.html().length&&"Server"===c.html()&&(d=1);d||a.html(" missing required field");return d};
    74 ga.valid.checksubmit=function(a){var b,c=1;if(!ga.altfile.bdata[a]&&!ga.value.types[a])return 1;for(b in ga.altfile.bdata[a])if(ga.altfile.bdata[a][b].req)switch(ga.altfile.bdata[a][b].req){case "lrfile":c=c&&ga.valid.checkLrfile("#"+b);$("#"+b).length&&!ga.valid.checkLrfile("#"+b)&&++ga.fielderrors;break;case "rpath":c=c&&ga.valid.checkRpath("#"+b);$("#"+b).length&&!ga.valid.checkRpath("#"+b)&&++ga.fielderrors;break;case "rfile":c=c&&ga.valid.checkRfile("#"+b);$("#"+b).length&&!ga.valid.checkRfile("#"+
    75 b)&&++ga.fielderrors;break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.altfile.bdata[a][b].req)}for(b in ga.value.types[a])if(ga.value.types[a][b].req)switch(ga.value.types[a][b].req){case "float":$("#"+b).length&&!ga.valid.checkFloat("#"+b)&&++ga.fielderrors;break;case "integer":$("#"+b).length&&!ga.valid.checkInt("#"+b)&&++ga.fielderrors;break;case "text":$("#"+b).length&&!ga.valid.checkText("#"+b)&&++ga.fielderrors;break;case "file":$("#"+b).length&&!ga.valid.checkLrfile("#"+
    76 b)&&++ga.fielderrors;break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.value.types[a][b].req)}0<ga.fielderrors&&(c=0);return c};ga.valid.showerrormessage=function(){messagebox({icon:"warning.png",text:""+ga.fielderrors+" fields are missing or not set correctly!",buttons:[{id:"ok",label:"OK"}]});ga.fielderrors=0};ga.valid.clearerrorcounter=function(){ga.fielderrors=0};ga.airavata={};
    77 ga.airavata.select=function(a,b,c,d){var e=ga.airavata.data,f="",h=[],g,p,k;if("__resource__"==a&&!e.defaultresource||"airavata"!=a&&"__resource__"!=a)return"notused";if(!e.resources||!e.resources.length)return messagebox({icon:"warning.png",text:"No resources currently enabled for Airavata submission"}),"abort";if(1==e.resources.length)return Object.keys(e.resources[k])[0];a="__airavataselect__"!=b?b:e.select.length?e.select:"random";switch(a){case "random":return k=Math.floor(e.resources.length*
    78 Math.random()),Object.keys(e.resources[k])[0];case "choose":h.push({id:"submit_module",label:"Submit",data:[c,d,e.resources],cb:function(a){a[0](a[1],Object.keys(a[2][$("#airavata input[name=selectresource]:checked").val()])[0])}});f='<h3>Select a compute resource and press submit</h3><form id="airavata"><table>';for(g in e.resources)for(p in e.resources[g])f+='<tr><td><input type="radio" name="selectresource" id="airavata_'+g+'" value="'+g+'"'+(0==g?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="airavata_'+
    79 g+'">'+e.resources[g][p]+"</label></td></tr>";messagebox({icon:"question.png",text:f+"</table>",buttons:h});return"deferred";default:return messagebox({icon:"toast.png",text:"ga.airavata.select, unknown selection type '"+a+"'"}),"abort"}};ga.resource={};ga.xsede={};ga.resource.xsedeprojecttokeys=function(){var a;ga.resource.xsedepkeys={};for(a in ga.resource.xsedeproject)ga.resource.xsedepkeys[ga.resource.xsedeproject[a]]=1};
    80 ga.xsede.select=function(a,b,c){var d=ga.xsede.data;a="__resource__"==a?ga.resource.defaultval:a;var e="",f=[],h;delete ga.xsede.useproject;if(!(ga.resource.xsedeproject&&a in ga.resource.xsedepkeys))return b(c);if(!d||!d.length)return messagebox({icon:"warning.png",text:"No XSEDE projects currently defined.  Create one under the user configuration button at the top right."}),"abort";if(1==d.length)return ga.xsede.useproject=d[0],b(c);f.push({id:"submit_xsedeproject",label:"Submit",data:[b,c,d],cb:function(a){ga.xsede.useproject=
    81 a[2][$("#xsedeproject input[name=selectxsedeproject]:checked").val()];a[0](a[1])}});e='<h3>Select an XSEDE project and press submit</h3><form id="xsedeproject"><table>';for(h in d)e+='<tr><td><input type="radio" name="selectxsedeproject" id="xsedeproject_'+h+'" value="'+h+'"'+(0==h?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="xsedeproject_'+h+'">'+d[h]+"</label></td></tr>";messagebox({icon:"question.png",text:e+"</table>",buttons:f});return"deferred"};
     25ga.login.verify.change.doit=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendverify" class="toclear">');a.append('<input type="hidden" name="_changeemail" class="toclear">');a.append('<input type="hidden" name="_changeemail1" value="'+$("#_changeemail1").val()+'" class="toclear">');a.append('<input type="hidden" name="_changeemail2" value="'+$("#_changeemail2").val()+'" class="toclear">');do_sys_login_submit(a)};
     26ga.login.verify.cancel=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_cancel" class="toclear">');do_sys_login_submit(a)};
     27ga.login.approve=function(a){var c={text:a.text||"Your registration is pending approval."};a.useroptions&&(a.useroptions.resend&&(c.buttons=c.buttons||[],c.buttons.push({id:"resend",label:"Resend the approval request",cb:ga.login.approve.resend})),a.useroptions.cancel&&(c.buttons=c.buttons||[],c.buttons.push({id:"cancelregistration",label:"Cancel your registration request",cb:ga.login.approve.cancel})));ga.msg.box(c)};
     28ga.login.approve.resend=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendapprove" class="toclear">');do_sys_login_submit(a)};ga.login.approve.cancel=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_cancel" class="toclear">');do_sys_login_submit(a)};ga.admin={};
     29ga.admin.ajax=function(a,c,b,e,f){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:c,_id:b,_manageid:e,_jid:f}).done(function(a,b,c){a=JSON.parse(a.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=a.success&&ga.msg.box({icon:"toast.png",text:a.error?a.error:"unknown error"});a._submitid&&$("#"+a._submitid).trigger("click")}).fail(function(a,b,c){ga.msg.box({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
     30c})})};ga.admin.ajax.remove=function(a,c,b,e){ga.msg.box({icon:"admin.png",text:"Are you sure you want to permanently remove this user, all of their job history and their stored data?",buttons:[{id:"yes",label:"Yes, remove this user",cb:ga.admin.ajax,adata:[a,c,b,e]},{id:"cancel",label:"Cancel"}]})};
     31ga.admin.ajax.group=function(a,c,b,e,f){ga.msg.box({icon:"admin.png",text:"Enter the group for user "+c+'<form id="sys_musergrp"><input id="sys_musergrp_text" class="help_link" type="text" size="25" value="'+f+'"><span class="help">Enter a group for this user, then press ok or cancel</span></form>',eval:"ga.hhelp.reset();$('#sys_musergrp').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"ok",label:"Ok",cb:ga.admin.ajax.group.cb,
     32adata:[a,c,b,e]},{id:"cancel",label:"Cancel"}]})};
     33ga.admin.ajax.group.cb=function(a,c,b,e,f){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:c,_id:b,_manageid:e,_group:$("#sys_musergrp_text").val()}).done(function(a,b,c){a=JSON.parse(a.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=a.success&&ga.msg.box({icon:"toast.png",text:a.error?a.error:"unknown error"});a._submitid&&$("#"+a._submitid).trigger("click")}).fail(function(a,b,c){ga.msg.box({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
     34c})})};ga.admin.ajax.jobview=function(a,c,b,e){$("#configbody").load("etc/userjob.html",function(){$("#jobtext_label").html("Jobs for "+c);$.ajax({url:ga.jc.url,data:{_window:window.name,_asuser:c,_id:b,_manageid:e}}).success(function(a){$("#seluserjobs").html(a)}).error(function(a){$("#seluserjobs").html("error:"+data)})});$(".modalDialog").addClass("modalDialog_on")};
     35ga.admin.ajax.cancel=function(a,c,b,e,f){ga.msg.box({icon:"admin.png",text:"Are you sure you want to cancel this '"+e+"' job belonging to "+a+" ?",buttons:[{id:"yes",label:"Yes, cancel the job",cb:ga.admin.ajax.cancel.cb,adata:[a,c,b,f]},{id:"no",label:"No"}]})};ga.admin.ajax.cancel.cb=function(a,c,b,e){$(".modalDialog").removeClass("modalDialog_on");ga.admin.ajax("jobcancel",a,c,b,e)};
     36ga.extrahidden=function(a){if(ga.set.data.extrahidden&&ga.set.data.extrahidden[a]){var c=$("#"+a),b,e="";for(b in ga.set.data.extrahidden[a])e+='<input type="hidden" name="'+b+'" value="'+ga.set.data.extrahidden[a][b]+'">';c.append(e);delete ga.set.data.extrahidden[a]}};ga.hhelp={};ga.hhelp.reset=function(){if($("#global_data").data("hoverhelp")||0!=$("#global_data").data("hoverhelp"))$(".help_link").removeClass("help_link_on"),$(".help_link").addClass("help_link_on")};
     37ga.hhelp.set=function(){$("#global_data").data("hoverhelp")&&0!=$("#global_data").data("hoverhelp")?($(".help_link").addClass("help_link_on"),$("#hoverhelp").html("Help on")):($(".help_link").removeClass("help_link_on"),$("#hoverhelp").html("Help off"))};ga.colors=function(a){ga.colors.background=ga.colors.makeRGB(a.background);ga.colors.text=ga.colors.makeRGB(a.text)};ga.colors.makeRGB=function(a){if(/\d{1,3},\s*\d{1,3},\s*\d{1,3}$/.test(a))return a;a=ga.color.toRGB(a);return a.r+","+a.g+","+a.b};
     38ga.plot_options=function(){var a="rgb( "+ga.colors.text+" )";return{font:{color:a},grid:{hoverable:!1},xaxis:{color:"gray",lineWidth:.5,font:{color:a}},yaxis:{color:"gray",lineWidth:.5,font:{color:a}},lines:{lineWidth:1},zoom:{interactive:!1},pan:{interactive:!1}}};ga.color=function(a){ga.color.data=a;ga.colors(a.body);ga.color.apply()};ga.color.defaults=function(a){ga.browser();ga.color.defaults.data=a;ga.color(a)};
     39ga.color.toRGB=function(a){var c,b;if("#"===a.slice(0,1))return b=parseInt(a.slice(1),16),c=parseInt(b/256),b-=256*c,a=parseInt(c/256),{r:a,b:b,g:c-256*a};(bits=/^rgb\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\s*\)$/.exec(a))?(a=parseInt(bits[1]),c=parseInt(bits[2]),b=parseInt(bits[3])):b=c=a=128;return{r:a,b:b,g:c}};
     40ga.color.apply=function(){var a,c,b,e,f,d,g;if(ga.directives.data&&ga.directives.data.usercolors&&!/^(off|0|false)$/.test(ga.directives.data.usercolors)){for(a in ga.color.data)ga.color.data.hasOwnProperty(a)&&(c=$(a))&&c.css(ga.color.data[a]);$(".sidebar ul li, .title").css("color",ga.color.data.body.color).hover(function(){$(this).css("color",ga.color.defaults.data.hovercolor.color)},function(){$(this).css("color",ga.color.data.body.color)});$(".svgmenu").css({color:ga.color.data.body.color,stroke:ga.color.data.body.color}).hover(function(){$(this).css({color:ga.color.defaults.data.hovercolor.color,
     41stroke:ga.color.defaults.data.hovercolor.color})},function(){$(this).css({color:ga.color.data.body.color,stroke:ga.color.data.body.color})});"#"===ga.color.data.body.background.slice(0,1)?(b=parseInt(ga.color.data.body.background.slice(1),16),c=parseInt(b/256),b-=256*c,a=parseInt(c/256),c-=256*a,a+=128<a?-20:20,c+=128<c?-20:20,b+=128<b?-20:20,$(".help,.coord").css({background:"rgba("+a+","+c+","+b+",0.8)",color:ga.color.data.body.color})):$(".help,.coord").css({background:ga.color.data[".help"].background,
     42color:ga.color.data[".help"].color});"#"===ga.color.data.body.color.slice(0,1)?(b=parseInt(ga.color.data.body.color.slice(1),16),c=parseInt(b/256),b-=256*c,a=parseInt(c/256),c-=256*a,e=a,f=c,d=b,a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header1").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header2").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header3").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<
     43a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header4").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$("hr").css({color:"rgb("+a+","+c+","+b+")"}),a=e,c=f,b=d,c+=128<c?-75:75,ga.cssrule.kill("a:link"),g=ga.cssrule.add("a:link"),g.style.color="rgb("+a+","+c+","+b+")",c=f,b+=128<b?-75:75,a+=128<a?-75:75,ga.cssrule.kill("a:visited"),g=ga.cssrule.add("a:visited"),g.style.color="rgb("+a+","+c+","+b+")",b=d,a=e,a+=128<a?-75:75,ga.cssrule.kill("a:active"),g=ga.cssrule.add("a:active"),
     44g.style.color="rgb("+a+","+c+","+b+")"):($(".header1").css({color:ga.color.data[".header1"]?ga.color.data[".header1"].color:ga.color.data.body.color}),$(".header2").css({color:ga.color.data[".header2"]?ga.color.data[".header2"].color:ga.color.data.body.color}),$(".header3").css({color:ga.color.data[".header3"]?ga.color.data[".header3"].color:ga.color.data.body.color}),$(".header4").css({color:ga.color.data[".header4"]?ga.color.data[".header4"].color:ga.color.data.body.color}));$(".modalDialog > div, .modalDialog2 > div, .modalDialog3 > div, .modalDialog4 > div").css({background:ga.browser.gradient?
     45ga.browser.prefix+"linear-gradient("+ga.color.data.body.background+", #222)":ga.color.data.body.background})}};ga.color.reset=function(){ga.color(ga.color.defaults.data)};ga.color.spectrum=function(a){if(!ga.browser.clrpkr)$(a).on("change.spectrum",function(c,b){console.log("hi spectrum"+a);$(a).val(b.toHexString())})};ga.color.spectrum.val=function(a,c){if(!ga.browser.clrpkr)if(c)$(a).spectrum({color:c});else return $(a).spectrum("get").toHexString()};
     46ga.event=function(a,c,b){ga.event.log.push({menu:a,module:c,action:b,when:new Date})};ga.event.log=[];ga.event.list=function(){for(var a=0,c=ga.event.log.length,b="Client Date/Time is "+(new Date).toUTCString()+"\n";a<c;a++)b+=ga.event.log[a].menu+" "+ga.event.log[a].module+" "+ga.event.log[a].action+" "+ga.event.log[a].when.toUTCString()+"\n";return b};
     47ga.fc=function(a,c){var b,e;ga.fc.cache[a]?c(ga.fc.cache[a]):ga.fc.waits[a]?ga.fc.waits[a].push(c):(ga.fc.waits[a]=[c],$.ajax(ga.fc.url+a).success(function(c){e=ga.fc.waits[a];delete ga.fc.waits[a];c=$.parseJSON(c);ga.fc.cache[a]=c;for(b=e.length;b--;)e[b](c)}).error(function(c){e=ga.fc.waits[a];delete ga.fc.waits[a];console.log("ajax error");console.dir(c);for(b=e.length;b--;)e[b]("**error**");ga.fc.ajax_error_msg("ajax get error: "+c.statusText)}));return!0};
     48ga.fc.clear=function(a){var c,b=ga.fc.children(a);for(c in b)ga.fc.cache[c]&&delete ga.fc.cache[c];ga.fc.cache[a]&&delete ga.fc.cache[a];for(c in ga.fc.trees)$(c).length&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};ga.fc.refresh=function(a){for(var c in ga.fc.trees)$(c).length&&ga.fc.cache[a]&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};
     49ga.fc.delete_node=function(a){a.length&&(ga.fc.url_delete&&0!==ga.fc.url_delete.length?$.ajax({url:ga.fc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(c){console.log("ajax delete done");c.error&&c.error.length?ga.fc.delete_error_msg(a,c.error):ga.fc.clear("#")}).error(function(a){console.log("ajax error");console.dir(a);ga.fc.ajax_error_msg("ajax delete error: "+a.statusText)}):console.log("ga.fc.delete_node, no url_delete "+
     50a.join(",")))};ga.fc.delete_node_message=function(a){var c="You are about to permanently remove "+a.length+" file";if(!a.length)return"Can not remove a directory from here";c=1<a.length?c+"s and/or directories":c+" or directory";return c+" and the contents, including subdirectories, of any directory listed below<p>"};
     51ga.fc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(a){return a.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};ga.fc.children=function(a,c){var b,e;c=c||{};if(ga.fc.cache[a])for(b=ga.fc.cache[a].length;b--;)ga.fc.cache[a][b].children&&(e=ga.fc.cache[a][b].id,ga.fc.cache[e]&&(c[e]=!0,c=ga.fc.children(e,c)));return c};ga.fc.cache={};ga.fc.waits={};ga.fc.trees={};
     52ga.jc=function(a,c){var b,e;ga.jc.cache[a]?c(ga.jc.cache[a]):ga.jc.waits[a]?ga.jc.waits[a].push(c):(ga.jc.waits[a]=[c],$.ajax({url:ga.jc.url,data:{_tree:a,_window:window.name}}).success(function(c){e=ga.jc.waits[a];delete ga.jc.waits[a];c=$.parseJSON(c);ga.jc.cache[a]=c;for(b=e.length;b--;)e[b](c)}).error(function(c){e=ga.jc.waits[a];delete ga.jc.waits[a];console.log("ajax error");console.dir(c);for(b=e.length;b--;)e[b]("**error**");ga.jc.ajax_error_msg("ajax get error: "+c.statusText)}));return!0};
     53ga.jc.clear_leaf=function(a){var c,b=0,e;for(c in ga.jc.trees)if($(c).length&&(e=$(c).jstree(!0).get_node(a))){b=1;break}b?ga.jc.clear(e.parent):ga.jc.clear("#")};ga.jc.clear=function(a){var c,b=ga.jc.children(a);for(c in b)ga.jc.cache[c]&&delete ga.jc.cache[c];ga.jc.cache[a]&&delete ga.jc.cache[a];for(c in ga.jc.trees)$(c).length&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};
     54ga.jc.refresh=function(a){for(var c in ga.jc.trees)$(c).length&&ga.jc.cache[a]&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};
     55ga.jc.delete_node=function(a){a.length&&(ga.jc.url_delete&&0!==ga.jc.url_delete.length?$.ajax({url:ga.jc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(c){console.log("ajax delete done");c.error&&c.error.length?ga.jc.delete_error_msg(a,c.error):ga.jc.clear("#")}).error(function(a){console.log("ajax error");console.dir(a);ga.jc.ajax_error_msg("ajax delete error: "+a.statusText)}):console.log("ga.jc.delete_node, no url_delete "+
     56a.join(",")))};ga.jc.delete_node_message=function(a){var c="You are about to permanently remove "+a.length+" job";1<a.length&&(c+="s");return c};ga.jc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(a){return a.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};
     57ga.jc.children=function(a,c){var b,e;c=c||{};if(ga.jc.cache[a])for(b=ga.jc.cache[a].length;b--;)ga.jc.cache[a][b].children&&(e=ga.jc.cache[a][b].id,ga.jc.cache[e]&&(c[e]=!0,c=ga.jc.children(e,c)));return c};ga.jc.cache={};ga.jc.waits={};ga.jc.trees={};ga.altfile=function(a,c,b){ga.altfile.data[a]=ga.altfile.data[a]||{};ga.altfile.data[a][c]=b};ga.altfile.data={};ga.altfile.bdata={};
     58ga.altfile.list=function(a){var c;if(ga.altfile.data[a])for(c in ga.altfile.data[a])console.log("module:"+a+" idfile:"+c+" idref:"+ga.altfile.data[a][c]);else console.log("module:"+a+" Empty")};ga.altfile.listall=function(){var a;if(ga.altfile.data)for(a in ga.altfile.data)ga.altfile.list(a);else console.log("ga.altfile:no modules")};ga.altfile.test=function(){ga.altfile("module1","field1","ref1");ga.altfile("module1","field2","ref2");ga.altfile("module2","field3","ref3");ga.altfile.listall()};
     59ga.altfile.add=function(a){var c,b="",e="#"+a;$(e+" ._hidden_altfiles").remove();$(e+" ._hidden_buttonvals").remove();if(ga.altfile.data[a])for(c in ga.altfile.data[a])b+='<input type="hidden" name="_selaltval_'+c+'" value="'+ga.altfile.data[a][c]+'" class="_hidden_altfiles">';if(ga.altfile.bdata[a])for(c in ga.altfile.bdata[a])b+='<input type="hidden" name="'+c+'" value="'+ga.altfile.bdata[a][c].val+'" class="_hidden_buttonvals">';b.length&&$(e).append(b)};
     60ga.altfile.button=function(a,c,b,e,f,d){ga.altfile.bdata[a]=ga.altfile.bdata[a]||{};ga.altfile.bdata[a][c]={};ga.altfile.bdata[a][c].val={};ga.altfile.bdata[a][c].text=b;ga.altfile.bdata[a][c].call=e;ga.altfile.bdata[a][c].cb=f;ga.altfile.bdata[a][c].req=d||0};ga.altfile.button.value=function(a,c,b){ga.altfile.bdata[a][c].val=b};
     61ga.altfile.button.call=function(a,c){var b;ga.altfile.bdata[a][c].call.length?(b=$("#_state").data("_logon"))&&b.length?($("#configbody").load("etc/"+ga.altfile.bdata[a][c].call+".html",function(){ga.altfile.bdata[ga.altfile.bdata[a][c].call]={};ga.altfile.bdata[ga.altfile.bdata[a][c].call].cb=ga.altfile.bdata[a][c].cb;$("#"+ga.altfile.bdata[a][c].call+"text_label").text(ga.altfile.bdata[a][c].text)}),ga.repeats.save(),$(".modalDialog").addClass("modalDialog_on")):ga.msg.box({icon:"warning.png",text:"You must login to browse server information",
     62buttons:[{id:"ok",label:"OK"}]}):ga.altfile.bdata[a][c].cb("cb");return!1};ga.altfile.button.simplecall=function(a,c){$("#configbody").load("ajax/"+a+"/"+c+".html",function(){});ga.repeats.save();$(".modalDialog").addClass("modalDialog_on");return!1};ga.altfile.button.cb=function(){ga.msg.close(1)};
     63ga.altfile.button.lrfile=function(a,c,b){var e=[],f="#"+c,d="#"+b,g="",h="_hidden_lrfile_sels_"+b;$(f+" ."+h).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(g+='<input type="hidden" name="'+b+'_altval[]" value="'+this.id+'" class="'+h+'" data-type="rfile_val">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(d+"_altval").html("<i>Server</i>: "+e),$(d+"_msg").empty(),$(d).val(""),$(f).append(g),ga.value.input[c]&&ga.value.input[c][b]&&ga.value.setInputfromRFile(e,
     64ga.value.input[c][b].mode,ga.value.input[c][b].ids))};
     65ga.altfile.button.rpath=function(a,c,b){var e=[];c="#"+c;var f="#"+b,d="",g="_hidden_rpath_sels_"+b,h=$(a).jstree(!0);$(c+" ."+g).remove();$.each(h.get_top_checked(!0),function(){h.is_leaf(this)||(d+='<input type="hidden" name="'+b+'[]" value="'+this.id+'" class="'+g+'"><input type="hidden" name="_decodepath_'+b+'" class="'+g+'">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(f+"_altval").html("<i>Server</i>: "+e),$(f+"_msg").empty(),$(f).val(""),$(c).append(d))};
     66ga.altfile.button.rfile=function(a,c,b){var e=[],f="#"+c,d="#"+b,g="",h="_hidden_rfile_sels_"+b;$(a).jstree(!0);$(f+" ."+h).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(g+='<input type="hidden" name="'+b+'_altval[]" value="'+this.id+'" class="'+h+'" data-type="rfile_val">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(d+"_altval").html("<i>Server</i>: "+e),$(d+"_msg").empty(),$(d).val(""),$(f).append(g),ga.value.input[c]&&ga.value.input[c][b]&&ga.value.setInputfromRFile(e,
     67ga.value.input[c][b].mode,ga.value.input[c][b].ids))};ga.altfile.button.job=function(a,c,b){var e="";c="#"+c;var f="#"+b,d="",g="_hidden_job_sels_"+b;$(a).jstree(!0);$(c+" ."+g).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(d+='<input type="hidden" name="'+b+'_altval[]" value="'+this.id+'" class="'+g+'">',e+="<tr><td>"+this.parent+":"+this.text+"</td></tr>")});e.length&&($(f+"_altval").html("<table>"+e+"</table>"),$(f+"_msg").empty(),$(f).val(""),$(c).append(d))};
     68ga.altfile.button.getnames=function(a,c){var b=[];switch(c){case "rpath":b.push(a+"[]");break;case "rfile":b.push(a+"_altval[]");break;case "lrfile":a=a.replace(/_button$/,"");b.push(a+"_altval[]");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+c+" )")}return b};
     69ga.altfile.button.getnamesinput=function(a,c){var b=[];switch(c){case "rpath":b.push(a);break;case "rfile":b.push(a+"_altval");break;case "lrfile":a=a.replace(/_button$/,"");b.push(a+"_altval");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+c+" )")}return b};
     70ga.altfile.button.addhtml=function(a,c,b,e){var f="";switch(b){case "rpath":b="_hidden_rpath_sels_"+c;f+='<input type="hidden" name="'+c+'[]" value="'+e[0]+'" class="'+b+'"><input type="hidden" name="_decodepath_'+c+'" class="'+b+'">';break;case "rfile":f+='<input type="hidden" name="'+c+'_altval[]" value="'+e[0]+'" class="'+("_hidden_rfile_sels_"+c)+'">';break;case "lrfile":c=c.replace(/_button$/,"");f+='<input type="hidden" name="'+c+'_altval[]" value="'+e[0]+'" class="'+("_hidden_lrfile_sels_"+
     71c)+'">';break;default:console.warn("ga.altfile.button.getnames( "+c+" , "+b+" )")}$("#"+a).append(f)};ga.valid={};ga.valid.checkMatch=function(a,c){$(a).val()!=$(c).val()?$(a+"_msg").html(" does not match"):$(a+"_msg").empty()};ga.valid.checkText=function(a){var c=$(a),b=c.val(),e=0,f=c.attr("pattern"),d=new RegExp(f);f?d.test(b)?(e=1,$(a+"_msg").empty()):b.length||c.prop("required")?$(a+"_msg").html(" wrong format"):e=1:!b&&c.prop("required")?$(a+"_msg").html(" missing required field"):e=1;return e};
     72ga.valid.checkFloat=function(a){var c=$(a),b=c.val(),e=0;b.match(/^-?(([1-9][0-9]*)|(0))?([.][0-9]+)?([eE][-+]?[0-9]+)?$/)?(e=1,b<parseFloat(c.attr("min"))?(c.val(c.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):b>parseFloat(c.attr("max"))?(c.val(c.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):$(a+"_msg").empty()):b.length||c.prop("required")?$(a+"_msg").html(" wrong format"):e=1;return e};
     73ga.valid.checkInt=function(a){var c=$(a),b=c.val(),e=0;b.match(/^-?((0)|([1-9][0-9]*))$/)?(e=1,b<parseInt(c.attr("min"))?(c.val(c.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):b>parseInt(c.attr("max"))?(c.val(c.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):parseInt(b)!=b?($(a+"_msg").html(" value rounded to nearset integer"),c.val(parseInt(parseFloat(b)+.5))):$(a+"_msg").empty()):b.length||c.prop("required")?$(a+"_msg").html(" wrong format"):e=1;return e};
     74ga.valid.safeFile=function(a){var c=$(a);c.val().match("^[a-zA-Z0-9]+([a-zA-Z0-9_.-]+|/[a-zA-Z0-9_-])+$")?$(a+"_msg").empty():(c.val(c.prop("defaultValue")),$(a+"_msg").html("Not an acceptable filename, reset to default"))};ga.valid.checkLrfile=function(a){var c=$(a),b=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!c||!c.is(":visible"))return 1;c&&c.val()&&c.val().length?e=1:b&&b.html()&&b.html().length&&"Server"===b.html()&&(e=1);e||a.html(" missing required field");return e};
     75ga.valid.checkRpath=function(a){var c=$(a),b=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!c||!c.is(":visible"))return 1;b&&b.html()&&b.html().length&&"Server"===b.html()&&(e=1);e||a.html(" missing required field");return e};ga.valid.checkRfile=function(a){var c=$(a),b=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!c||!c.is(":visible"))return 1;b&&b.html()&&b.html().length&&"Server"===b.html()&&(e=1);e||a.html(" missing required field");return e};
     76ga.valid.checksubmit=function(a){var c,b=1;if(!ga.altfile.bdata[a]&&!ga.value.types[a])return 1;ga.valid.clearerrorcounter(a);for(c in ga.altfile.bdata[a])if(ga.altfile.bdata[a][c].req)switch(ga.altfile.bdata[a][c].req){case "lrfile":b=b&&ga.valid.checkLrfile("#"+c);$("#"+c).length&&!ga.valid.checkLrfile("#"+c)&&++ga.fielderrors[a];break;case "rpath":b=b&&ga.valid.checkRpath("#"+c);$("#"+c).length&&!ga.valid.checkRpath("#"+c)&&++ga.fielderrors[a];break;case "rfile":b=b&&ga.valid.checkRfile("#"+c);
     77$("#"+c).length&&!ga.valid.checkRfile("#"+c)&&++ga.fielderrors[a];break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.altfile.bdata[a][c].req)}for(c in ga.value.types[a])if(ga.value.types[a][c].req)switch(ga.value.types[a][c].req){case "float":$("#"+c).length&&!ga.valid.checkFloat("#"+c)&&++ga.fielderrors[a];break;case "integer":$("#"+c).length&&!ga.valid.checkInt("#"+c)&&++ga.fielderrors[a];break;case "text":$("#"+c).length&&!ga.valid.checkText("#"+c)&&++ga.fielderrors[a];
     78break;case "file":$("#"+c).length&&!ga.valid.checkLrfile("#"+c)&&++ga.fielderrors[a];break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.value.types[a][c].req)}0<ga.fielderrors[a]&&(b=0);return b};ga.valid.showerrormessage=function(a){ga.msg.box({icon:"warning.png",text:""+ga.fielderrors[a]+" fields are missing or not set correctly!",buttons:[{id:"ok",label:"OK"}]});ga.fielderrors[a]=0};ga.valid.clearerrorcounter=function(a){ga.fielderrors[a]=0};ga.airavata={};
     79ga.airavata.select=function(a,c,b,e){var f=ga.airavata.data,d="",g=[],h,m,k;if("__resource__"==a&&!f.defaultresource||"airavata"!=a&&"__resource__"!=a)return"notused";if(!f.resources||!f.resources.length)return ga.msg.box({icon:"warning.png",text:"No resources currently enabled for Airavata submission"}),"abort";if(1==f.resources.length)return Object.keys(f.resources[k])[0];a="__airavataselect__"!=c?c:f.select.length?f.select:"random";switch(a){case "random":return k=Math.floor(f.resources.length*
     80Math.random()),Object.keys(f.resources[k])[0];case "choose":g.push({id:"submit_module",label:"Submit",data:[b,e,f.resources],cb:function(a){a[0](a[1],Object.keys(a[2][$("#airavata input[name=selectresource]:checked").val()])[0])}});d='<h3>Select a compute resource and press submit</h3><form id="airavata"><table>';for(h in f.resources)for(m in f.resources[h])d+='<tr><td><input type="radio" name="selectresource" id="airavata_'+h+'" value="'+h+'"'+(0==h?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="airavata_'+
     81h+'">'+f.resources[h][m]+"</label></td></tr>";ga.msg.box({icon:"question.png",text:d+"</table>",buttons:g});return"deferred";default:return ga.msg.box({icon:"toast.png",text:"ga.airavata.select, unknown selection type '"+a+"'"}),"abort"}};ga.resource={};ga.xsede={};ga.resource.xsedeprojecttokeys=function(){var a;ga.resource.xsedepkeys={};for(a in ga.resource.xsedeproject)ga.resource.xsedepkeys[ga.resource.xsedeproject[a]]=1};
     82ga.xsede.select=function(a,c,b){var e=ga.xsede.data;a="__resource__"==a?ga.resource.defaultval:a;var f="",d=[],g;delete ga.xsede.useproject;if(!(ga.resource.xsedeproject&&a in ga.resource.xsedepkeys))return c(b);if(!e||!e.length)return ga.msg.box({icon:"warning.png",text:"No XSEDE projects currently defined.  Create one under the user configuration button at the top right."}),"abort";if(1==e.length)return ga.xsede.useproject=e[0],c(b);d.push({id:"submit_xsedeproject",label:"Submit",data:[c,b,e],cb:function(a){ga.xsede.useproject=
     83a[2][$("#xsedeproject input[name=selectxsedeproject]:checked").val()];a[0](a[1])}});f='<h3>Select an XSEDE project and press submit</h3><form id="xsedeproject"><table>';for(g in e)f+='<tr><td><input type="radio" name="selectxsedeproject" id="xsedeproject_'+g+'" value="'+g+'"'+(0==g?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="xsedeproject_'+g+'">'+e[g]+"</label></td></tr>";ga.msg.box({icon:"question.png",text:f+"</table>",buttons:d});return"deferred"};
    8284ga.value={};ga.value.settings={};
    83 ga.value.checkFloatIntOK=function(a,b){var c=$(a);if(isNaN(b[0]))return c.val(c.prop("defaultValue")),!1;"float"==c.data("type")?b[0]<parseFloat(c.attr("min"))?(b.splice(0,b.length),b.push(c.attr("min"))):b[0]>parseFloat(c.attr("max"))?(b.splice(0,b.length),b.push(c.attr("max"))):$(a+"_msg").html(""):"integer"==c.data("type")&&(b[0]<parseInt(c.attr("min"))?(b.splice(0,b.length),b.push(c.attr("min"))):b[0]>parseInt(c.attr("max"))?(b.splice(0,b.length),b.push(c.attr("max"))):parseInt(b[0])!=b[0]?(c=
    84 b[0],b.splice(0,b.length),b.push(parseInt(parseFloat(c)+.5))):$(a+"_msg").html(""));return!0};ga.value.sethiddenfields=function(a,b){var c=[],d;$.each(a[b],function(a,b){$.each(b,function(a,b){c.push(b)})});c=ga.repeat.map.convert(c);for(d=0;d<c.length;d++)$("#"+c[d]).data("repeater")&&$("#"+c[d]+"-repeater").hide(),$("#"+c[d]+", label[for="+c[d]+"]").hide()};
    85 ga.value.showfields=function(a,b,c,d){var e=[];$.each(a[b],function(a,b){console.log(a);a==c[d]&&$.each(b,function(a,b){console.log(b);e.push(b)})});for(a=0;a<e.length;a++)$("#"+e[a]).data("repeater")&&$("#"+e[a]+"-repeater").show(),$("#"+e[a]+", label[for="+e[a]+"]").show()};
    86 ga.value.modifyformdata=function(a,b,c,d,e){var f=[],h,g;console.log(d);$.each(a[b],function(a,b){console.log(a);-1!==jQuery.inArray(a,d)&&$.each(b,function(a,b){f.push(b)})});f=ga.repeat.map.convert(f);for(a=0;a<f.length;a++){if($("#"+f[a]).data("repeater"))for(h in g=ga.repeat.children(b,f[a]),g)g=f[a]+"-"+h,c["delete"](g);c["delete"](f[a])}c.append("currentstage",ga.stages[b][e])};
    87 ga.value.processInputfromFiles=function(a,b,c,d){var e=a.trim().split(/[\r\n]+/g),f=[],h=0;c=ga.repeat.map.convert(c);for(var g=0;g<e.length;g++){var p=e[g].trim().split(/\s+/),h=h+p.length;f.push(h)}var h=[],k=[],q=[],n=[],y=[],r=[],p=[],w=0;switch(b){case "whitespace_formulchcompost":a=[];for(g=0;g<e.length;g++)f=e[g].split("#")[0],f=f.replace(/\s{2,}/g," "),f=f.replace(/\t/g," "),f=f.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(f);for(var e=parseInt(a[1]),m,g=0;g<a.length;g++)if(2<g&&g<
    88 3+e)for(m=a[g].trim().split(/\s+/),f=0;f<m.length;f++)k.push(m[f]);else h.push(a[g]);p.push(k);for(g=0;g<c.length;g++)switch($("#"+c[g]).attr("type")){case "text":k=new RegExp($("#"+c[g]).attr("pattern"));if(!k.test(h[g])){messagebox({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+w+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[h[g]];
    89 if(ga.value.checkFloatIntOK("#"+c[g],k))h[g]=k[0];else{messagebox({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+w+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:messagebox({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}break;case "whitespace_formulchrg":case "whitespace_formulchcontrast":a=
    90 [];for(g=0;g<e.length;g++)f=e[g].split("#")[0],f=f.replace(/\s{2,}/g," "),f=f.replace(/\t/g," "),f=f.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(f);for(var e=parseInt(a[1]),u=parseInt(a[2+e]),x=parseInt(a[5+e+u]),A=parseInt(a[9+e+u+x]),g=0;g<a.length;g++)if(1<g&&g<2+e)for(m=a[g].trim().split(/\s+/),f=0;f<m.length;f++)k.push(m[f]);else g>2+e&&g<3+e+u?(m=a[g].trim().split(/\s+/),q.push(m[1]),q.push(m[2]),q.push(m[0]),q.push(m[3])):g>5+e+u&&g<6+e+u+x?(m=a[g].trim().split(/\s+/),n.push(m[1]),
    91 n.push(m[2]),n.push(m[0]),n.push(m[3])):g>8+e+u+x&&g<9+e+u+x+A?(m=a[g].trim().split(/\s+/),y.push(m[1]),y.push(m[2]),y.push(m[0]),y.push(m[3])):h.push(a[g]);r.push(k);r.push(q);r.push(n);r.push(y);for(g=f=0;g<c.length;g++)if($("#"+c[g]).length)switch($("#"+c[g]).data("repeater")&&(p.push(r[f]),f++),$("#"+c[g]).attr("type")){case "text":k=new RegExp($("#"+c[g]).attr("pattern"));if(!k.test(h[g])){messagebox({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+w+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
    92 buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[h[g]];if(ga.value.checkFloatIntOK("#"+c[g],k))h[g]=k[0];else{messagebox({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+w+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:messagebox({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",
    93 label:"OK"}]});return}else f++;break;case "whitespaceseparated":case "whitespaceseparated_reverselogic":h=a.trim().split(/\s+/);if(h.length==c.length)for(g=0;g<h.length;g++){for(r=0;r<f.length;r++)if(g+1<=f[r]){w=r+1;break}switch($("#"+c[g]).attr("type")){case "checkbox":k=/^(0|1|n|y|true|false|t|f|yes|no)$/;if(!k.test(h[g].toLowerCase())){messagebox({icon:"warning.png",text:"Wrong format of the input file! Checkbox input value on the line #"+w+" is not valid. Options are: [1 | 0 | yes | no | true | false | t | f | T | F | y | n | Y | N ]. Check your input file",
    94 buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[h[g]];if(ga.value.checkFloatIntOK("#"+c[g],k))h[g]=k[0];else{messagebox({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+w+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "text":k=new RegExp($("#"+c[g]).attr("pattern"));if(!k.test(h[g])){messagebox({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+
    95 w+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:messagebox({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}}else{messagebox({icon:"warning.png",text:"Wrong format of the input file! Number of parameters is inconsistent with the model chosen. Check your parameter file",buttons:[{id:"ok",label:"OK"}]});
    96 return}break;default:messagebox({icon:"warning.png",text:"Selected file parsing mode is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}for(g=w=0;g<h.length;g++){switch($("#"+c[g]).attr("type")){case "checkbox":if(0<=b.indexOf("reverselogic"))switch(h[g].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+c[g]).prop("checked",!0);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+c[g]).prop("checked",!1);break}else switch(h[g].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+
    97 c[g]).prop("checked",!1);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+c[g]).prop("checked",!0);break}default:$("#"+c[g]).val(h[g]),$("#"+c[g]).prop("defaultValue",h[g])}if($("#"+c[g]).data("repeater")){ga.repeat.change(d,c[g]);children=ga.repeat.children(d,c[g]);k=$("#"+c[g]).val();n=q=0;for(r=1;r<=k;++r)for(t in n=0,children)if(y=p[w][q],f=c[g]+"-"+t+"-"+(r-1),++n,"whitespace_formulchrg"!=b&&"whitespace_formulchcompost"!=b||1!=n)"whitespace_formulchcompost"==b&&2==n?("r"==
    98 y.toLowerCase()&&$("#"+f).prop("checked",!0),"f"==y.toLowerCase()&&$("#"+f).prop("checked",!1)):"whitespace_formulchcompost"==b&&5==n||$("#"+f).val(y),q++;ga.repeat.change(d,c[g]);w++}}};ga.value.input={};ga.value.setInputForRFile=function(a,b,c,d,e){ga.value.input[a]=ga.value.input[a]||{};ga.value.input[a][c]={};ga.value.input[a][c].id=c;ga.value.input[a][c].tag=b;ga.value.input[a][c].mode=d;ga.value.input[a][c].ids=e};ga.value.types={};
    99 ga.value.registerid=function(a,b,c,d){ga.value.types[a]=ga.value.types[a]||{};ga.value.types[a][b]={};ga.value.types[a][b].id=b;ga.value.types[a][b].label=c;ga.value.types[a][b].req=d||0};ga.value.setInputfromRFile=function(a,b,c,d){var e=c.split(",");a="results/users/"+$("#_state").data("_logon")+"/"+a;$.get(a,function(a){ga.value.processInputfromFiles(a,b,e,d)},"text")};
    100 ga.value.setInputfromFile=function(a,b,c,d){$(a).hide();var e=c.split(",");$(a).change(function(c){c=$(a)[0].files[0];var h=new FileReader;h.onload=function(a){ga.value.processInputfromFiles(a.target.result,b,e,d)};h.readAsText(c)})};
    101 ga.value.setLastValue=function(a,b,c){var d=a+":"+b+":last_value",e=a+":"+b+":default_value",f=$(b);if(!/_output$/.test(a))return!1;if(void 0==$("#global_data").data(d))switch(f.attr("type")){case "checkbox":case "radio":$("#global_data").data(d,f.is(":checked"));$("#global_data").data(e,f.is(":checked"));break;case "div":case "msgs":$("#global_data").data(d,f.html());$("#global_data").data(e,f.html());break;case "plot2d":break;case "bokeh":ga.bokeh.renderdata(a,b.replace(/^#/,""));break;case "filelink":case "filelinkm":$("#global_data").data(d,
    102 $(b+"_filelink").html());break;default:c&&f.val(c),$("#global_data").data(d,f.val()),$("#global_data").data(e,f.val())}else switch(f.attr("type")){case "checkbox":case "radio":f.prop("checked",$("#global_data").data(d));break;case "div":case "msgs":f.html($("#global_data").data(d));break;case "atomicstructure":b=b.replace(/^#/,"");$("#global_data").data(d)?(_jmol_info[b].script=$("#global_data").data(d),f.html(Jmol.getAppletHtml("jmolApplet"+b,_jmol_info[b]))):f.html("");break;case "plot2d":d=gd.data(d);
    103 d.data?(ga.value.set.plot2d(b,d.options),f.plot(d.data,ga.value.get.plot2d.plot_options(b,d.options))):f.plot(d,ga.value.get.plot2d.plot_options(b));break;case "bokeh":break;case "filelink":case "filelinkm":$(b+"_filelink").html($("#global_data").data(d));break;default:f.val($("#global_data").data(d))}};
    104 ga.value.saveLastValue=function(a,b){var c=$(b);switch(c.attr("type")){case "file":break;case "checkbox":case "radio":$("#global_data").data(a+":"+b+":last_value",c.is(":checked"));break;case "div":case "msgs":$("#global_data").data(a+":"+b+":last_value",c.html());break;case "plot2d":break;case "bokeh":break;case "filelink":case "filelinkm":$("#global_data").data(a+":"+b+":last_value",$(b+"_filelink").html());break;case "atomicstructure":c=b.replace(/^#/,"");_jmol_info&&_jmol_info[c]&&_jmol_info[c].length?
    105 $("#global_data").data(a+":"+b+":last_value",_jmol_info[c].script):$("#global_data").data(a+":"+b+":last_value","");break;default:$("#global_data").data(a+":"+b+":last_value",c.val())}};ga.value.saveLastValues=function(a){$("#"+a+" :input").each(function(){ga.value.saveLastValue(a,"#"+$(this).attr("id"))})};
    106 ga.value.resetDefaultValue=function(a,b){var c=$(b);if("SELECT"==c.prop("tagName"))c.val($("#global_data").data(a+":"+b+":default_value"));else switch(c.attr("type")){case "file":return;case "checkbox":$("#global_data").removeData(a+":"+b+":repeat:count");case "radio":c.prop("checked",$("#global_data").data(a+":"+b+":default_value"));break;case "div":case "msgs":c.html($("#global_data").data(a+":"+b+":default_value"));break;case "filelink":case "filelinkm":$(b+"_filelink").html(" ");break;case "plot2d":$("#global_data").data(a+
    107 ":"+b+":last_value",[[]]);ga.value.clear.plot2d(b);c.plot([[]],ga.value.get.plot2d.plot_options(b));break;case "bokeh":ga.bokeh.reset(a,b.replace(/^#/,""));break;case "image":c.html("");break;case "video":c.html("");break;case "atomicstructure":b.replace(/^#/,"");$("#global_data").data(a+":"+b+":last_value","");$(b).html("");break;default:c.val(c.attr("value"))}ga.value.saveLastValue(a,b);$(b+"_msg").html("")};
    108 ga.value.resetDefaultValues=function(a,b){var c;if(!/_output$/.test(a))return!1;$("#"+a+" :input").each(function(){ga.value.resetDefaultValue(a,"#"+$(this).attr("id"))});ga.sync.reset(a);for(c in ga.value.extra_resets.data)ga.value.resetDefaultValue(a,"#"+c);b&&(ga.value.resetDefaultValue(a,"#"+a+"_msgs"),c="#"+a+"_textarea",ga.value.resetDefaultValue(a,c),$(c).hide(),$(c+"_label").hide())};
     85ga.value.checkFloatIntOK=function(a,c){var b=$(a);if(isNaN(c[0]))return b.val(b.prop("defaultValue")),!1;"float"==b.data("type")?c[0]<parseFloat(b.attr("min"))?(c.splice(0,c.length),c.push(b.attr("min"))):c[0]>parseFloat(b.attr("max"))?(c.splice(0,c.length),c.push(b.attr("max"))):$(a+"_msg").empty():"integer"==b.data("type")&&(c[0]<parseInt(b.attr("min"))?(c.splice(0,c.length),c.push(b.attr("min"))):c[0]>parseInt(b.attr("max"))?(c.splice(0,c.length),c.push(b.attr("max"))):parseInt(c[0])!=c[0]?(b=
     86c[0],c.splice(0,c.length),c.push(parseInt(parseFloat(b)+.5))):$(a+"_msg").empty());return!0};ga.value.sethiddenfields=function(a,c){var b=[],e;$.each(a[c],function(a,c){$.each(c,function(a,c){b.push(c)})});b=ga.repeat.map.convert(b);for(e=0;e<b.length;e++)$("#"+b[e]).data("repeater")&&$("#"+b[e]+"-repeater").hide(),$("#"+b[e]+", label[for="+b[e]+"]").hide()};
     87ga.value.showfields=function(a,c,b,e){var f=[];$.each(a[c],function(a,c){console.log(a);a==b[e]&&$.each(c,function(a,b){console.log(b);f.push(b)})});for(a=0;a<f.length;a++)$("#"+f[a]).data("repeater")&&$("#"+f[a]+"-repeater").show(),$("#"+f[a]+", label[for="+f[a]+"]").show()};
     88ga.value.modifyformdata=function(a,c,b,e,f){var d=[],g,h;console.log(e);$.each(a[c],function(a,b){console.log(a);-1!==jQuery.inArray(a,e)&&$.each(b,function(a,b){d.push(b)})});d=ga.repeat.map.convert(d);for(a=0;a<d.length;a++){if($("#"+d[a]).data("repeater"))for(g in h=ga.repeat.children(c,d[a]),h)h=d[a]+"-"+g,b["delete"](h);b["delete"](d[a])}b.append("currentstage",ga.stages[c][f])};
     89ga.value.processInputfromFiles=function(a,c,b,e){var f=a.trim().split(/[\r\n]+/g),d=[],g=0;b=ga.repeat.map.convert(b);for(var h=0;h<f.length;h++){var m=f[h].trim().split(/\s+/),g=g+m.length;d.push(g)}var g=[],k=[],r=[],l=[],u=[],v=[],m=[],y=0;switch(c){case "whitespace_formulchcompost":a=[];for(h=0;h<f.length;h++)d=f[h].split("#")[0],d=d.replace(/\s{2,}/g," "),d=d.replace(/\t/g," "),d=d.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(d);for(var f=parseInt(a[1]),p,h=0;h<a.length;h++)if(2<h&&h<
     903+f)for(p=a[h].trim().split(/\s+/),d=0;d<p.length;d++)k.push(p[d]);else g.push(a[h]);m.push(k);for(h=0;h<b.length;h++)switch($("#"+b[h]).attr("type")){case "text":k=new RegExp($("#"+b[h]).attr("pattern"));if(!k.test(g[h])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[g[h]];
     91if(ga.value.checkFloatIntOK("#"+b[h],k))g[h]=k[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}break;case "whitespace_formulchrg":case "whitespace_formulchcontrast":a=
     92[];for(h=0;h<f.length;h++)d=f[h].split("#")[0],d=d.replace(/\s{2,}/g," "),d=d.replace(/\t/g," "),d=d.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(d);for(var f=parseInt(a[1]),w=parseInt(a[2+f]),z=parseInt(a[5+f+w]),B=parseInt(a[9+f+w+z]),h=0;h<a.length;h++)if(1<h&&h<2+f)for(p=a[h].trim().split(/\s+/),d=0;d<p.length;d++)k.push(p[d]);else h>2+f&&h<3+f+w?(p=a[h].trim().split(/\s+/),r.push(p[1]),r.push(p[2]),r.push(p[0]),r.push(p[3])):h>5+f+w&&h<6+f+w+z?(p=a[h].trim().split(/\s+/),l.push(p[1]),
     93l.push(p[2]),l.push(p[0]),l.push(p[3])):h>8+f+w+z&&h<9+f+w+z+B?(p=a[h].trim().split(/\s+/),u.push(p[1]),u.push(p[2]),u.push(p[0]),u.push(p[3])):g.push(a[h]);v.push(k);v.push(r);v.push(l);v.push(u);for(h=d=0;h<b.length;h++)if($("#"+b[h]).length)switch($("#"+b[h]).data("repeater")&&(m.push(v[d]),d++),$("#"+b[h]).attr("type")){case "text":k=new RegExp($("#"+b[h]).attr("pattern"));if(!k.test(g[h])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     94buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[g[h]];if(ga.value.checkFloatIntOK("#"+b[h],k))g[h]=k[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",
     95label:"OK"}]});return}else d++;break;case "whitespaceseparated":case "whitespaceseparated_reverselogic":g=a.trim().split(/\s+/);if(g.length==b.length)for(h=0;h<g.length;h++){for(v=0;v<d.length;v++)if(h+1<=d[v]){y=v+1;break}switch($("#"+b[h]).attr("type")){case "checkbox":k=/^(0|1|n|y|true|false|t|f|yes|no)$/;if(!k.test(g[h].toLowerCase())){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Checkbox input value on the line #"+y+" is not valid. Options are: [1 | 0 | yes | no | true | false | t | f | T | F | y | n | Y | N ]. Check your input file",
     96buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[g[h]];if(ga.value.checkFloatIntOK("#"+b[h],k))g[h]=k[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "text":k=new RegExp($("#"+b[h]).attr("pattern"));if(!k.test(g[h])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+
     97y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}}else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Number of parameters is inconsistent with the model chosen. Check your parameter file",buttons:[{id:"ok",label:"OK"}]});
     98return}break;default:ga.msg.box({icon:"warning.png",text:"Selected file parsing mode is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}for(h=y=0;h<g.length;h++){switch($("#"+b[h]).attr("type")){case "checkbox":if(0<=c.indexOf("reverselogic"))switch(g[h].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+b[h]).prop("checked",!0);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+b[h]).prop("checked",!1);break}else switch(g[h].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+
     99b[h]).prop("checked",!1);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+b[h]).prop("checked",!0);break}default:$("#"+b[h]).val(g[h]),$("#"+b[h]).prop("defaultValue",g[h])}if($("#"+b[h]).data("repeater")){ga.repeat.change(e,b[h]);children=ga.repeat.children(e,b[h]);k=$("#"+b[h]).val();l=r=0;for(v=1;v<=k;++v)for(t in l=0,children)if(u=m[y][r],d=b[h]+"-"+t+"-"+(v-1),++l,"whitespace_formulchrg"!=c&&"whitespace_formulchcompost"!=c||1!=l)"whitespace_formulchcompost"==c&&2==l?("r"==
     100u.toLowerCase()&&$("#"+d).prop("checked",!0),"f"==u.toLowerCase()&&$("#"+d).prop("checked",!1)):"whitespace_formulchcompost"==c&&5==l||$("#"+d).val(u),r++;ga.repeat.change(e,b[h]);y++}}};ga.value.input={};ga.value.setInputForRFile=function(a,c,b,e,f){ga.value.input[a]=ga.value.input[a]||{};ga.value.input[a][b]={};ga.value.input[a][b].id=b;ga.value.input[a][b].tag=c;ga.value.input[a][b].mode=e;ga.value.input[a][b].ids=f};ga.value.types={};
     101ga.value.registerid=function(a,c,b,e){ga.value.types[a]=ga.value.types[a]||{};ga.value.types[a][c]={};ga.value.types[a][c].id=c;ga.value.types[a][c].label=b;ga.value.types[a][c].req=e||0};ga.value.setInputfromRFile=function(a,c,b,e){var f=b.split(",");a="results/users/"+$("#_state").data("_logon")+"/"+a;$.get(a,function(a){ga.value.processInputfromFiles(a,c,f,e)},"text")};
     102ga.value.setInputfromFile=function(a,c,b,e){$(a).hide();var f=b.split(",");$(a).change(function(b){b=$(a)[0].files[0];var g=new FileReader;g.onload=function(a){ga.value.processInputfromFiles(a.target.result,c,f,e)};g.readAsText(b)})};
     103ga.value.setLastValue=function(a,c,b){var e=a+":"+c+":last_value",f=a+":"+c+":default_value",d=$(c);if(!/_output$/.test(a))return!1;if(void 0==$("#global_data").data(e))switch(d.attr("type")){case "checkbox":case "radio":$("#global_data").data(e,d.is(":checked"));$("#global_data").data(f,d.is(":checked"));break;case "div":case "msgs":$("#global_data").data(e,d.html());$("#global_data").data(f,d.html());break;case "plot3d":case "plotly":c=c.replace(/^#/,"");Plotly.newPlot(c,[],{});Plotly.purge(c);
     104break;case "plot2d":break;case "ngl":ga.ngl.clear(e,c);break;case "bokeh":ga.bokeh.renderdata(a,c.replace(/^#/,""));break;case "filelink":case "filelinkm":$("#global_data").data(e,$(c+"_filelink").html());break;default:b&&d.val(b),$("#global_data").data(e,d.val()),$("#global_data").data(f,d.val())}else switch(d.attr("type")){case "checkbox":case "radio":d.prop("checked",$("#global_data").data(e));break;case "div":case "msgs":d.html($("#global_data").data(e));break;case "atomicstructure":c=c.replace(/^#/,
     105"");$("#global_data").data(e)?(_jmol_info[c].script=$("#global_data").data(e),d.html(Jmol.getAppletHtml("jmolApplet"+c,_jmol_info[c]))):d.empty();break;case "plot2d":a=gd.data(e);a.data?(ga.value.set.plot2d(c,a.options),d.plot(a.data,ga.value.get.plot2d.plot_options(c,a.options))):d.plot(a,ga.value.get.plot2d.plot_options(c));break;case "plot3d":case "plotly":d=gd.data(e);d.data&&Plotly.plot(c.replace(/^#/,""),d.data,d.layout);break;case "bokeh":break;case "ngl":(d=gd.data(e))&&ga.value.nglshow(a,
     106c.replace(/^#/,""),d);break;case "filelink":case "filelinkm":$(c+"_filelink").html($("#global_data").data(e));break;default:d.val($("#global_data").data(e))}};
     107ga.value.saveLastValue=function(a,c){var b=$(c);switch(b.attr("type")){case "file":break;case "checkbox":case "radio":$("#global_data").data(a+":"+c+":last_value",b.is(":checked"));break;case "div":case "msgs":$("#global_data").data(a+":"+c+":last_value",b.html());break;case "plot2d":break;case "bokeh":break;case "filelink":case "filelinkm":$("#global_data").data(a+":"+c+":last_value",$(c+"_filelink").html());break;case "atomicstructure":b=c.replace(/^#/,"");_jmol_info&&_jmol_info[b]&&_jmol_info[b].length?
     108$("#global_data").data(a+":"+c+":last_value",_jmol_info[b].script):$("#global_data").data(a+":"+c+":last_value","");break;default:$("#global_data").data(a+":"+c+":last_value",b.val())}};ga.value.saveLastValues=function(a){$("#"+a+" :input").each(function(){ga.value.saveLastValue(a,"#"+$(this).attr("id"))})};
     109ga.value.resetDefaultValue=function(a,c){var b=$(c);if("SELECT"==b.prop("tagName"))b.val($("#global_data").data(a+":"+c+":default_value"));else switch(b.attr("type")){case "ngl":ga.ngl.clear(a+":"+c+":last_value",c);break;case "file":return;case "checkbox":$("#global_data").removeData(a+":"+c+":repeat:count");case "radio":b.prop("checked",$("#global_data").data(a+":"+c+":default_value"));break;case "div":case "msgs":b.html($("#global_data").data(a+":"+c+":default_value"));break;case "filelink":case "filelinkm":$(c+
     110"_filelink").html(" ");break;case "plot2d":console.log("ga.value.resetDefaultValue() plot2d, t is "+c);$("#global_data").data(a+":"+c+":last_value",[[]]);ga.value.clear.plot2d(c);b.plot([[]],ga.value.get.plot2d.plot_options(c));$(c+"_showcollapse").length&&($(c+"_div").hide(),$(c+"_savetofile").length&&($(c+"_savetofile").hide(),$(c+"_savetofile_link").hide()),$(c+"_changescalex").length&&($(c+"_changescalex").hide(),$(c+"_changescalex_message").hide()),$(c+"_changescaley").length&&($(c+"_changescaley").hide(),
     111$(c+"_changescaley_message").hide()),$(c+"_showcollapse").length&&$(c+"_showcollapse").addClass("hidden"));break;case "bokeh":ga.bokeh.reset(a,c.replace(/^#/,""));break;case "plot3d":case "plotly":console.log("reset default value for plot3d: "+c);Plotly.purge(c.replace(/^#/,""));$(c+"_showcollapse").length&&$(c+"_showcollapse").addClass("hidden");break;case "image":b.empty();break;case "video":b.empty();break;case "atomicstructure":c.replace(/^#/,"");$("#global_data").data(a+":"+c+":last_value","");
     112$(c).empty();break;default:b.val(b.attr("value"))}ga.value.saveLastValue(a,c);$(c+"_msg").empty()};ga.value.resetDefaultValues=function(a,c){var b;if(!/_output$/.test(a))return!1;$("#"+a+" :input").each(function(){ga.value.resetDefaultValue(a,"#"+$(this).attr("id"))});ga.sync.reset(a);for(b in ga.value.extra_resets.data)ga.value.resetDefaultValue(a,"#"+b);c&&(ga.value.resetDefaultValue(a,"#"+a+"_msgs"),b="#"+a+"_textarea",ga.value.resetDefaultValue(a,b),$(b).hide(),$(b+"_label").hide())};
    109113ga.value.extra_resets=function(a){ga.value.extra_resets.data=ga.value.extra_resets.data||{};ga.value.extra_resets.data[a]=1};ga.value.extra_resets.clear=function(){ga.value.extra_resets.data={}};
    110 ga.value.setLastValueOutput=function(a){var b="#"+a,c=b+"_textarea",d=$(c);ga.value.setLastValue(a,b+"_msgs");ga.value.setLastValue(a,c);d.val()?(d.show(),$(c+"_label").show(),d.height(parseFloat(d.prop("scrollHeight"))+parseFloat(d.css("borderTopWidth"))+parseFloat(d.css("borderBottomWidth")))):(d.hide(),$(c+"_label").hide())};ga.value.get={};ga.value.set={};ga.value.clear={};
    111 ga.value.set.plot2d=function(a,b){var c=a+"_xlabel",d=a+"_ylabel";$(a+"_title").html(b.title?b.title:"");$(c).html(b.xlabel?b.xlabel:"");$(d).html(b.ylabel?b.ylabel:"")};ga.value.clear.plot2d=function(a){var b=a+"_xlabel",c=a+"_ylabel";tagxy=a+"_xy";$(a+"_title").html("");$(b).html("");$(c).html("");$(tagxy).html("")};ga.value.set.plot2d.pan=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].pan=b?!0:!1};
    112 ga.value.set.plot2d.zoom=function(a,b,c){tagxy=a+"_xy";ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].zoom=b?!0:!1;b&&(ga.value.settings[a].pkg=c,$(a+"_title,"+a+"_xlabel,"+a+"_ylabel,"+a+"_xy").on("click",ga.value.set.plot2d.zoom.click))};ga.value.set.plot2d.pkg=function(a,b){ga.value.settings[b]=ga.value.settings[b]||{};ga.value.settings[b].pkg=a;$(b+"_title,"+b+"_xlabel,"+b+"_ylabel,"+b+"_xy").on("click",ga.value.set.plot2d.reset)};
    113 ga.value.set.plot2d.reset=function(a){var b="#"+a.target.id.replace(/(_title|_xlabel|_ylabel|_xy)$/,"");a.preventDefault();ga.value.setLastValue(ga.value.settings[b].pkg,b)};ga.value.set.plot2d.hover=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].hover=b?!0:!1};ga.value.set.plot2d.selzoom=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].selzoom=b?!0:!1};
    114 ga.value.set.plot2d.backgroundcolor=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].backgroundcolor=b};ga.value.get.plot2d={};
    115 ga.value.get.plot2d.plot_options=function(a,b){var c=ga.plot_options();ga.value.settings[a].backgroundcolor&&(c.grid={backgroundColor:ga.value.settings[a].backgroundcolor});ga.value.settings[a].selzoom&&(c.selection={mode:"xy"});b&&(b.grid&&(c.grid=$.extend({},c.grid,b.grid)),b.selection&&(c.selection=$.extend({},c.selection,b.selection)));c.pan.interactive=ga.value.settings[a].pan?!0:!1;c.zoom.interactive=ga.value.settings[a].zoom?!0:!1;c.grid.hoverable=ga.value.settings[a].hover?!0:!1;if(b){b.legend&&
    116 (c.legend=b.legend,b.legend.container&&(c.legend.container=$(a+"_legend")));b.xmin&&(c.xaxis.min=b.xmin);b.xmax&&(c.xaxis.max=b.xmax);if(b.xscale)switch(b.xscale){case "log":c.xaxis.transform=function(a){return 0<a?Math.log(a):1E-99};c.xaxis.inverseTransform=function(a){return Math.exp(a)};c.xaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported xscale of "+b.xscale)}b.xtics&&(c.xaxis.ticks=b.xtics);b.ymin&&(c.yaxis.min=
    117 b.ymin);b.ymax&&(c.yaxis.max=b.ymax);if(b.yscale)switch(b.yscale){case "log":c.yaxis.transform=function(a){return 0<a?Math.log(a):1E-99};c.yaxis.inverseTransform=function(a){return Math.exp(a)};c.yaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported yscale of "+b.yscale)}b.ytics&&(c.yaxis.ticks=b.ytics)}return c};ga.value.plot2d={};ga.value.plot2d.zstack={};
     114ga.value.setLastValueOutput=function(a){var c="#"+a,b=c+"_textarea",e=$(b);ga.value.setLastValue(a,c+"_msgs");ga.value.setLastValue(a,b);e.val()?(e.show(),$(b+"_label").show(),e.height(parseFloat(e.prop("scrollHeight"))+parseFloat(e.css("borderTopWidth"))+parseFloat(e.css("borderBottomWidth")))):(e.hide(),$(b+"_label").hide())};ga.value.get={};ga.value.set={};ga.value.clear={};
     115ga.value.set.plot2d=function(a,c){var b=a+"_xlabel",e=a+"_ylabel";$(a+"_title").html(c.title?c.title:"");$(b).html(c.xlabel?c.xlabel:"");$(e).html(c.ylabel?c.ylabel:"")};ga.value.clear.plot2d=function(a){var c=a+"_xlabel",b=a+"_ylabel";tagxy=a+"_xy";$(a+"_title").empty();$(c).empty();$(b).empty();$(tagxy).empty()};ga.value.set.plot2d.pan=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].pan=c?!0:!1};
     116ga.value.set.plot2d.zoom=function(a,c,b){tagxy=a+"_xy";ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].zoom=c?!0:!1;c&&(ga.value.settings[a].pkg=b,$(a+"_title,"+a+"_xlabel,"+a+"_ylabel,"+a+"_xy").on("click",ga.value.set.plot2d.zoom.click))};ga.value.set.plot2d.pkg=function(a,c){ga.value.settings[c]=ga.value.settings[c]||{};ga.value.settings[c].pkg=a;$(c+"_title,"+c+"_xlabel,"+c+"_ylabel,"+c+"_xy").on("click",ga.value.set.plot2d.reset)};
     117ga.value.set.plot2d.reset=function(a){var c="#"+a.target.id.replace(/(_title|_xlabel|_ylabel|_xy)$/,"");a.preventDefault();ga.value.setLastValue(ga.value.settings[c].pkg,c)};ga.value.set.plot2d.hover=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].hover=c?!0:!1};ga.value.set.plot2d.selzoom=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].selzoom=c?!0:!1};
     118ga.value.set.plot2d.backgroundcolor=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].backgroundcolor=c};ga.value.get.plot2d={};
     119ga.value.get.plot2d.plot_options=function(a,c){var b=ga.plot_options();ga.value.settings[a].backgroundcolor&&(b.grid={backgroundColor:ga.value.settings[a].backgroundcolor});ga.value.settings[a].selzoom&&(b.selection={mode:"xy"});c&&(c.grid&&(b.grid=$.extend({},b.grid,c.grid)),c.selection&&(b.selection=$.extend({},b.selection,c.selection)));b.pan.interactive=ga.value.settings[a].pan?!0:!1;b.zoom.interactive=ga.value.settings[a].zoom?!0:!1;b.grid.hoverable=ga.value.settings[a].hover?!0:!1;if(c){c.legend&&
     120(b.legend=c.legend,c.legend.container&&(b.legend.container=$(a+"_legend")));c.xmin&&(b.xaxis.min=c.xmin);c.xmax&&(b.xaxis.max=c.xmax);if(c.xscale)switch(c.xscale){case "log":b.xaxis.transform=function(a){return 0<a?Math.log(a):1E-99};b.xaxis.inverseTransform=function(a){return Math.exp(a)};b.xaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported xscale of "+c.xscale)}c.xtics&&(b.xaxis.ticks=c.xtics);c.ymin&&(b.yaxis.min=
     121c.ymin);c.ymax&&(b.yaxis.max=c.ymax);if(c.yscale)switch(c.yscale){case "log":b.yaxis.transform=function(a){return 0<a?Math.log(a):1E-99};b.yaxis.inverseTransform=function(a){return Math.exp(a)};b.yaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported yscale of "+c.yscale)}c.ytics&&(b.yaxis.ticks=c.ytics)}return b};ga.value.plot2d={};ga.value.plot2d.zstack={};
    118122ga.value.plot2d.zstack.reset=function(a){ga.value.plot2d.stack=ga.value.plot2d.stack||{};ga.value.plot2d.stack[a]=[];ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};ga.value.plot2d.waspush[a]=!1};ga.value.plot2d.zstack.dopop=function(a){ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};return ga.value.plot2d.stack[a]&&ga.value.plot2d.stack[a].length?(ga.value.plot2d.waspush[a]&&ga.value.plot2d.stack[a].pop(),ga.value.plot2d.waspush[a]=!1,ga.value.plot2d.stack[a].pop()):!1};
    119 ga.value.plot2d.zstack.dopush=function(a,b){ga.value.plot2d.stack=ga.value.plot2d.stack||{};ga.value.plot2d.stack[a]=ga.value.plot2d.stack[a]||[];ga.value.plot2d.stack[a].push(b);ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};ga.value.plot2d.waspush[a]=!0};ga.value.plot2d.toFP=function(a,b){return 0<b?a.toFixed(b):6<a.toString().length?a.toExponential(3).replace(/0+e/,"e").replace(/\.e/,"e"):a.toFixed(0)};
    120 ga.value.plot2d.ticformatter=function(a,b){var c;if(!b._ehb||a<=b.min)return b._ehb={},b._ehb.pv=a,b._ehb.min=Math.min(b.min,b.max),b._ehb.max=Math.max(b.min,b.max),b._ehb.tmin=b.options.transform(b._ehb.min),b._ehb.tmax=b.options.transform(b._ehb.max),b._ehb.tmaxr=1/b._ehb.tmax,b._ehb.rnge=b._ehb.max-b._ehb.min,ga.value.plot2d.toFP(a,b.tickDecimals);if(!b._ehb.snd)return b._ehb.snd=!0,b._ehb.sndv=a,b._ehb.ptd=(b.options.transform(a)-b._ehb.tmin)*b._ehb.tmaxr,ga.value.plot2d.toFP(a,b.tickDecimals);
    121 if(!b._ehb.tr)return b._ehb.tr=2*Math.abs(a-b._ehb.sndv)/b._ehb.rnge,b._ehb.ptd=Math.abs(b.options.transform(a)-b._ehb.tmin)*b._ehb.tmaxr,ga.value.plot2d.toFP(a,b.tickDecimals);c=(b.options.transform(a)-b._ehb.tmin)*b._ehb.tmaxr;return Math.min(Math.abs(c-b._ehb.ptd),1-c)>=b._ehb.tr?(b._ehb.ptd=c,ga.value.plot2d.toFP(a,b.tickDecimals)):""};ga.pull={};
    122 ga.pull.clearPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");$("#global_data").data("_pull_json"+a,{});$("#global_data").data("_pull_update"+a,{});$("#global_data").data("_pull_type"+a,{})};
    123 ga.pull.toPull=function(a,b,c,d,e){e&&"string"==typeof e&&0!=e.length&&"#__fields:repeat__"!=e||(e="");a=$("#global_data");var f=a.data("_pull_json"+e)||{},h=a.data("_pull_update"+e)||{};f[d]=0;"object"!=typeof h[d]&&(h[d]={});h[d][b]=c;a.data("_pull_json"+e,f);a.data("_pull_update"+e,h)};
    124 ga.pull.doPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");var b=$("#global_data"),c=$("#_state").data("_logon");if(c&&c.length){var d=b.data("_pull_json"+a);d._window=window.name;d._logon=c;2<Object.size(d)&&$.getJSON("ajax/sys_config/sys_pull.php",d).done(function(c,d,h){var g=b.data("_pull_update"+a);$.each(c,function(a,b){"object"==typeof g[a]&&$.each(g[a],function(a,c){var d=$(a);switch(c){case "checkbox":d.prop("checked","on"==b);break;case "text":"color"==
     123ga.value.plot2d.zstack.dopush=function(a,c){ga.value.plot2d.stack=ga.value.plot2d.stack||{};ga.value.plot2d.stack[a]=ga.value.plot2d.stack[a]||[];ga.value.plot2d.stack[a].push(c);ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};ga.value.plot2d.waspush[a]=!0};ga.value.plot2d.toFP=function(a,c){return 0<c?a.toFixed(c):6<a.toString().length?a.toExponential(3).replace(/0+e/,"e").replace(/\.e/,"e"):a.toFixed(0)};
     124ga.value.plot2d.ticformatter=function(a,c){var b;if(!c._ehb||a<=c.min)return c._ehb={},c._ehb.pv=a,c._ehb.min=Math.min(c.min,c.max),c._ehb.max=Math.max(c.min,c.max),c._ehb.tmin=c.options.transform(c._ehb.min),c._ehb.tmax=c.options.transform(c._ehb.max),c._ehb.tmaxr=1/c._ehb.tmax,c._ehb.rnge=c._ehb.max-c._ehb.min,ga.value.plot2d.toFP(a,c.tickDecimals);if(!c._ehb.snd)return c._ehb.snd=!0,c._ehb.sndv=a,c._ehb.ptd=(c.options.transform(a)-c._ehb.tmin)*c._ehb.tmaxr,ga.value.plot2d.toFP(a,c.tickDecimals);
     125if(!c._ehb.tr)return c._ehb.tr=2*Math.abs(a-c._ehb.sndv)/c._ehb.rnge,c._ehb.ptd=Math.abs(c.options.transform(a)-c._ehb.tmin)*c._ehb.tmaxr,ga.value.plot2d.toFP(a,c.tickDecimals);b=(c.options.transform(a)-c._ehb.tmin)*c._ehb.tmaxr;return Math.min(Math.abs(b-c._ehb.ptd),1-b)>=c._ehb.tr?(c._ehb.ptd=b,ga.value.plot2d.toFP(a,c.tickDecimals)):""};ga.ngl={};ga.ngl.types="backbone ball+stick cartoon contact helixorient hyperball label licorice line point ribbon rocket rope spacefill surface trace tube".split(" ");
     126ga.ngl.clear=function(a,c){ga.ngl[a]&&(ga.ngl[a].stage&&ga.ngl[a].stage.dispose(),delete ga.ngl[a]);$(c+"_plot").empty();$(c+"_buttons").empty();$("#global_data").removeData(a)};
     127ga.value.nglshow=function(a,c,b){var e="#"+c;ga.ngl=ga.ngl||{};var f=a+":"+e+":last_value";ga.ngl.clear(f,e);b.loadname&&(b.loadparams||(b.loadparams={}),b.representation||(b.representation="cartoon"),ga.ngl[f]={},ga.ngl[f].stage=new NGL.Stage(c+"_plot"),ga.ngl[f].stage.loadFile(b.loadname,b.loadparams).then(function(a){ga.ngl[f].component=a;ga.ngl[f].reps={};ga.ngl[f].reps[b.representation]=a.addRepresentation(b.representation);a.autoView();a=ga.ngl.types.length;for(var c="",h="",m=0;m<a;++m)c+=
     128'<button id="'+ga.ngl.types[m].replace("+","")+'">'+ga.ngl.types[m]+"</button>",h+='$("#'+ga.ngl.types[m].replace("+","")+'").on("click", function() { var sk = ga.ngl["'+f+'"]; var comp = sk.component; var crep = sk.reps["'+ga.ngl.types[m]+'"]; if ( comp && crep ) { comp.removeRepresentation( crep ); delete sk.reps["'+ga.ngl.types[m]+'"]; } else { sk.reps["'+ga.ngl.types[m]+'"] = comp.addRepresentation("'+ga.ngl.types[m]+'");} return false; });';$(e+"_buttons").html(c);eval(h)}),$("#global_data").data(f,
     129b));ga.value.extra_resets(c)};ga.pull={};ga.pull.clearPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");$("#global_data").data("_pull_json"+a,{});$("#global_data").data("_pull_update"+a,{});$("#global_data").data("_pull_type"+a,{})};
     130ga.pull.toPull=function(a,c,b,e,f){f&&"string"==typeof f&&0!=f.length&&"#__fields:repeat__"!=f||(f="");a=$("#global_data");var d=a.data("_pull_json"+f)||{},g=a.data("_pull_update"+f)||{};d[e]=0;"object"!=typeof g[e]&&(g[e]={});g[e][c]=b;a.data("_pull_json"+f,d);a.data("_pull_update"+f,g)};
     131ga.pull.doPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");var c=$("#global_data"),b=$("#_state").data("_logon");if(b&&b.length){var e=c.data("_pull_json"+a);e._window=window.name;e._logon=b;2<Object.size(e)&&$.getJSON("ajax/sys_config/sys_pull.php",e).done(function(b,d,e){var h=c.data("_pull_update"+a);$.each(b,function(a,b){"object"==typeof h[a]&&$.each(h[a],function(a,c){var d=$(a);switch(c){case "checkbox":d.prop("checked","on"==b);break;case "text":"color"==
    125132d.attr("data-type")&&ga.color.spectrum.val(a,b);case "email":case "text":case "integer":case "float":d.val(b);break;case "listbox":d.empty();$.each(b,function(a,b){d.append($("<option></option>").attr("value",b).text(b))});break;case "label":d.html(b);break;default:console.log("ga.pull.doPull(): not yet")}})})}).fail(function(a,b,c){})}};ga.repeats={};ga.repeats.cache={};ga.repeats.cache._jmol_info={};ga.repeats.cache.specproj=[];
    126133ga.repeats.save=function(){ga.repeats.cache._jmol_info=_jmol_info||{};ga.repeats.cache.specproj=ga.specproj.data||[]};ga.repeats.restore=function(){_jmol_info=ga.repeats.cache._jmol_info;ga.specproj.data=ga.repeats.cache.specproj};ga.repeat={};ga.repeat.data={};ga.repeat.map={};
    127 ga.repeat.repeat=function(a,b,c,d){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeat=ga.repeat.data[a].repeat||{};ga.repeat.data[a].repeat[b]={};ga.repeat.data[a].repeat[b].html=c;ga.repeat.data[a].repeat[b].eval=d;ga.repeat.map[b]=b;ga.repeat.data[a].repeat[b].htmlr=c.replace(/<\/label>/,"%%label%%</label>").replace(RegExp('id="'+b+'"'),'id="%%id%%"').replace(RegExp('name="'+b),'name="%%id%%').replace(RegExp('for="'+b+'"'),'for="%%id%%"').replace(RegExp('id="'+b+'_msg"'),'id="%%id%%_msg"').replace(RegExp('id="'+
    128 b+'_tr"'),'id="%%id%%_tr"').replace(RegExp('id="'+b+'_button"'),'id="%%id%%_button"').replace(RegExp('="'+b+'_altval"',"g"),'="%%id%%_altval"').replace(RegExp('name="_selaltval_'+b+'"'),'name="_selaltval_%%id%%"').replace(RegExp('id="'+b+'-repeater"'),'id="%%id%%-repeater"');ga.repeat.data[a].repeat[b].htmls=c.replace(/<td><label.*?>(.*?)<\/label>\s*<\/td>/,"%%td%%$1%%etd%%").replace(/(<td[^>]*>).*?<\/td>/g,"$1</td>").replace(/<input[^>]*>/g,"").replace(/<span[^>]*>.*?<\/span>/g,"").replace(/\s*id=".*?"\s*/g,
    129 "").replace("%%td%%","<td>").replace("%%etd%%","</td>").replace("<td></td>","");ga.repeat.data[a].repeat[b].evalr=d.replace(RegExp('"#'+b+'"',"g"),'"#%%id%%"').replace(RegExp('"#'+b+" option","g"),'"#%%id%% option').replace(RegExp(":"+b+":","g"),":%%id%%:").replace(RegExp('"#'+b+'_msg"',"g"),'"#%%id%%_msg"').replace(RegExp('"'+b+'"',"g"),'"%%id%%"').replace(RegExp('"#'+b+'_button"',"g"),'"#%%id%%_button"').replace(RegExp('"'+b+'_altval"',"g"),'"%%id%%_altval"').replace(RegExp('"#'+b+'_altval"',"g"),
    130 '"#%%id%%_altval"');return'<tr><td></td><td><span id="'+b+'-span"></span></td></tr>'};
    131 ga.repeat.repeatOn=function(a,b,c){var d=/^(.*):(.*)$/.exec(c);c=c.replace(":","-");ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[c]=ga.repeat.data[a].repeater[c]||{};ga.repeat.data[a].repeater[c].child=ga.repeat.data[a].repeater[c].child||[];ga.repeat.data[a].repeater[c].child.push(b);ga.repeat.data[a].repeat[b].refid=c;d&&(c=d[1],d=d[2],ga.repeat.data[a].repeater[c]=ga.repeat.data[a].repeater[c]||{},ga.repeat.data[a].repeater[c].child=ga.repeat.data[a].repeater[c].child||
    132 [],ga.repeat.data[a].repeater[c].choice=ga.repeat.data[a].repeater[c].choice||[],ga.repeat.data[a].repeater[c].child.push(b),ga.repeat.data[a].repeater[c].choice.push(d))};
    133 ga.repeat.repeater=function(a,b,c,d){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[b]=ga.repeat.data[a].repeater[b]||{};ga.repeat.data[a].repeater[b].type=c;d&&"__fields:tableize__"!=d&&!/^(off|false)$/i.test(d)&&(ga.repeat.data[a].repeater[b].tableize=1)};
    134 ga.repeat.children=function(a,b,c){var d;c=c||{};if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[b]&&ga.repeat.data[a].repeater[b].child))return c;for(d=0;d<ga.repeat.data[a].repeater[b].child.length;++d)c[ga.repeat.data[a].repeater[b].child[d]]=!0,ga.repeat.data[a].repeater[d]&&(c=ga.repeat.children(a,d,c));return c};
    135 ga.repeat.change=function(a,b,c){var d,e=[],f="#"+b;d=$(f);var h,g="",p="",k,q,n;if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[b]&&d.length))return!1;switch(ga.repeat.data[a].repeater[b].type){case "checkbox":d=d.prop("checked")?1:0;break;case "integer":case "listbox":d=d.val();break;default:return console.warn("ga.repeat.change( "+a+" , "+b+" ) type "+ga.repeat.data[a].repeater[b].type+" not supported"),!1}if(!c&&ga.repeat.data[a].repeater[b].value===d)return!1;h=
    136 ga.repeat.children(a,b);switch(ga.repeat.data[a].repeater[b].type){case "checkbox":if(d)for(k in h)n=b+"-"+k,ga.repeat.map[k]=n,g+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,n).replace("%%label%%",""),p+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,n),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[n]||(ga.repeat.data[a].repeater[n]=jQuery.extend({},ga.repeat.data[a].repeater[k])),e.push(n),ga.repeat.data[a].repeater[n].value&&delete ga.repeat.data[a].repeater[n].value);
    137 break;case "integer":if(ga.repeat.data[a].repeater[b].tableize&&0<d)for(k in h)g+=ga.repeat.data[a].repeat[k].htmls;for(q=1;q<=d;++q)for(k in h)n=b+"-"+k+"-"+(q-1),ga.repeat.map[k]=n,g+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,n).replace("%%label%%","["+q+"]").replace(ga.repeat.data[a].repeater[b].tableize?/<td.*?><label.*?>.*?<\/label><\/td>/:"",""),p+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,n),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[n]||(ga.repeat.data[a].repeater[n]=
    138 jQuery.extend({},ga.repeat.data[a].repeater[k])),e.push(n),ga.repeat.data[a].repeater[n].value&&delete ga.repeat.data[a].repeater[n].value);break;case "listbox":h=b.replace(/-[0-9]+$/,"").replace(/^(.*)-([A-ZA-z0-9_]*)$/,"$2")+"-"+d;q=b+"-"+d;h=ga.repeat.children(a,h);for(k in h)n=q+"-"+k,ga.repeat.map[k]=n,g+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,n).replace("%%label%%",""),p+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,n),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[n]||
    139 (ga.repeat.data[a].repeater[n]=jQuery.extend({},ga.repeat.data[a].repeater[k])),e.push(n),ga.repeat.data[a].repeater[n].value&&delete ga.repeat.data[a].repeater[n].value);break;default:return console.warn("ga.repeat.change( "+a+" , "+b+" ) type "+ga.repeat.data[a].repeater[b].type+" not supported"),!1}!/^<tr>/.test(g)&&/<\/tr>$/.test(g)&&(g="<tr>"+g);$(f+"-repeater").html(g);eval(p);ga.repeat.data[a].repeater[b].value=d;for(k=0;k<e.length;++k)ga.repeat.change(a,e[k],c);$("#global_data").data("_pull_json#"+
    140 b)&&ga.pull.doPull("#"+b);resetHoverHelp()};ga.repeat.map.convert=function(a){var b,c=[];for(b=0;b<a.length;++b)c[b]=ga.repeat.map[a[b]]||a[b];return c};ga.hide=function(a,b){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][b]=ga.hide.data[a][b]||{};ga.hide.data[a][b].active=1};ga.hide.data={};
    141 ga.hide.update=function(a,b){var c;if(ga.hide.data[a]&&ga.hide.data[a][b])if(ga.hide.data[a][b].hides){if($(b).prop("checked"))for(c in ga.hide.data[a][b].hides)$(c+"-itd").html(" "),$(c).hide();else for(c in ga.hide.data[a][b].hides)$(c+"-itd").html(ga.hide.data[a][b].hides[c]),$(c).show();setHoverHelp()}else console.log("ga.hide.update( "+a+" , "+b+" ) error, no hides attached to this hider");else console.log("ga.hide.update( "+a+" , "+b+" ) error, hider has not been defined")};
    142 ga.hide.add=function(a,b,c){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][c]=ga.hide.data[a][c]||{};ga.hide.data[a][c].hides=ga.hide.data[a][c].hides||{};ga.hide.data[a][c].hides[b]=$(b+"-itd").html()};ga.directives=function(a,b){ga.directives.data=ga.directives.data||{};ga.directives.data[a]=b};ga.hideifnot=function(a,b){ga.directives.data&&ga.directives.data[b]&&!/^(off|false|0$)/.test(ga.directives.data[b].toLowerCase())||$(a).hide()};ga.data={};
    143 ga.data.nofcrefresh={};ga.data.dataURLtoFile=function(a,b){for(var c=a.split(","),d=c[0].match(/:(.*?);/)[1],c=atob(c[1]),e=c.length,f=new Uint8Array(e);e--;)f[e]=c.charCodeAt(e);return new File([f],b,{type:d})};
    144 ga.data.create_image_htmltocanvas=function(a){if($("#"+a+"_savetofile").length){var b=$("#"+a+"_div");html2canvas(b.get(0),{background:"#ffffff",onrendered:function(b){b='<a href="'+b.toDataURL("image/png").replace("image/png","image/octet-stream")+'" target="_blank" download="plot.png">plot.png</a>';$("#"+a+"_savetofile_link").html(b)}})}};
    145 ga.data.create_image=function(a,b){if($("#"+a+"_savetofile").length){var c=document.getElementById(a+"_savetofile"),d=b.getCanvas().toDataURL("image/png").replace("image/png","image/octet-stream"),d=ga.data.dataURLtoFile(d,"plot.png");c.href=URL.createObjectURL(d);$("#"+a+"_savetofile").removeClass("hidden")}};
    146 ga.data.update=function(a,b,c,d){var e=0,f=0,h=0,g=0,p=0,k=a+"_output",q="#"+k,n=$(q),y={},r=q+"_msgs",w=$(r),m,u,x,A,v,B,z;c&&($("#"+a+"_progress").html(""),w.text(""));$.each(b,function(b,l){z=n.find("#"+b);if(z.length)switch(e||(w.text(""),e=1),z.attr("type")){case "plot2d":m="#"+b;ga.value.plot2d.zstack.reset(m);l.data?(ga.value.set.plot2d(m,l.options),ga.plotglobal=l.options,ga.dataplotglobal=l.data,$.plot(m,l.data,ga.value.get.plot2d.plot_options(m,l.options))):$.plot(m,l,ga.value.get.plot2d.plot_options(m));
    147 $(m+"_savetofile").length&&$(m+"_savetofile").removeClass("hidden");$(m+"_changescalex").length&&($(m+"_changescalex").removeClass("hidden"),"log"==l.options.xscale?$(m+"_changescalex_message").html("X-log"):$(m+"_changescalex_message").html("X-lin"));$(m+"_changescaley").length&&($(m+"_changescaley").removeClass("hidden"),"log"==l.options.yscale?$(m+"_changescaley_message").html("Y-log"):$(m+"_changescaley_message").html("Y-lin"));if(ga.value.settings[m].selzoom||l.options&&l.options.selection&&
    148 l.options.selection.mode&&"xy"==l.options.selection.mode)$(m).on("plotselected",{htag:m,data:l.data?l.data:l,options:l.data?ga.value.get.plot2d.plot_options(m,l.options):ga.value.get.plot2d.plot_options(m)},function(a,b){1E-5>b.xaxis.to-b.xaxis.from&&(b.xaxis.to=b.xaxis.from+1E-5);1E-5>b.yaxis.to-b.yaxis.from&&(b.yaxis.to=b.yaxis.from+1E-5);ga.value.plot2d.zstack.dopush(a.data.htag,b);$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,
    149 max:b.yaxis.to}}))}).on("contextmenu",{htag:m,data:l.data?l.data:l,options:l.data?ga.value.get.plot2d.plot_options(m,l.options):ga.value.get.plot2d.plot_options(m)},function(a){a.preventDefault();var b=ga.value.plot2d.zstack.dopop(a.data.htag);b?$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}})):$.plot(a.data.htag,a.data.data,a.data.options)});x=k+":#"+b+":last_value";$("#global_data").data(x,l);break;case "bokeh":ga.bokeh.render(a,
    150 b,l);break;case "atomicstructure":x=k+":#"+b+":last_value";B=l.file?l.file:l;_jmol_info[b].script="set background ["+ga.colors.background+"]; set zoomlarge false;set echo top center;echo loading "+B.split("/").pop()+';refresh;load "'+B+'";';ga.set(a+":jsmoladd")&&(_jmol_info[b].script+=ga.set(a+":jsmoladd"));l.script&&(_jmol_info[b].script+=";"+l.script);$("#global_data").data(x,_jmol_info[b].script);$("#"+b).html(Jmol.getAppletHtml("jmolApplet"+b,_jmol_info[b]));break;case "checkbox":case "radio":z.prop("checked",
    151 !0);break;case "div":z.html(l);break;case "video":u=$("#"+b);v="<video ";u.attr("data-width")&&(v+=' width="'+u.attr("data-width")+'"');u.attr("data-height")&&(v+=' height="'+u.attr("data-height")+'"');v+=" controls>";v+='<source src="'+l+'.mp4" type="video/mp4" /><source src="'+l+'.webm" type="video/webm" />';v+="</video>";u.html(v);break;case "image":u=$("#"+b);v="<img ";u.attr("data-width")&&(v+=' width="'+u.attr("data-width")+'"');u.attr("data-height")&&(v+=' height="'+u.attr("data-height")+'"');
    152 v+=' src="'+l+'">';u.html(v);break;case "filelink":A='<a href="'+l+'" target="_blank">'+l.split("/").pop()+"</a>";x=k+":#"+b+":last_value";$("#global_data").data(x,A);$("#"+b+"_filelink").html(A);break;case "filelinkm":x=k+":#"+b+":last_value";A="";$.each(l,function(a,b){A+='<a href="'+b+'" target="_blank">'+b.split("/").pop()+"</a> "});$("#global_data").data(x,A);$("#"+b+"_filelink").html(A);break;default:$("#global_data").data("_append:"+k+"_"+b)?(z.val(z.val()+"\n"+l),z.height(parseFloat(z.prop("scrollHeight")+
    153 parseFloat(z.css("borderTopWidth"))+parseFloat(z.css("borderBottomWidth"))))):z.val(l)}else c?"_"==b.charAt(0)?/^_fs_/.test(b)&&ga.data.nofcrefresh[a]||("_message"==b&&messagebox(l),/^_getinput/.test(b)&&"_getinput"==b&&ga.valuen.input(a,l),"_textarea"==b&&ga.data.textarea(q,l),"_airavata"==b&&ga.data.airavata(q,l),"_status"==b&&"complete"==l&&c(d,0,0)):(f||(w.append("<p>Unexpected results:</p>"),f=1),w.append("<p>"+b+" => "+l+"</p>")):"_"==b.charAt(0)?/^_fs_/.test(b)&&ga.data.nofcrefresh[a]||($("#_state").data(b,
    154 l),h=1,"_status"==b&&(y.job_status=l),/^_getinput/.test(b)&&"_getinput"==b&&ga.valuen.input(a,l),"_textarea"==b&&ga.data.textarea(q,l),"_airavata"==b&&ga.data.airavata(q,l),"_loginverify"==b&&ga.login.verify(l),"_loginapprove"==b&&ga.login.approve(l)):"-close"==b?g=1:"-close2"==b?p=1:(f||(w.text(""),w.append("<p>Unexpected results:</p>"),e=f=1),w.append("<p>"+b+" => "+l+"</p>"))});ga.value.saveLastValues(k);ga.value.saveLastValue(k,r);$(q+"_progress").html("");h&&syncState();g&&closeModal();p&&closeModal2();
    155 return y};
    156 ga.data.textarea=function(a,b){var c=a+"_textarea",d=$(c);isatend=d[0].scrollHeight-d[0].scrollTop===d[0].clientHeight;b||(b="");d.is(":hidden")&&(d.show(),$(c+"_label").show());"__reset__\n"==b.substr(0,10)?d.val(b.substr(10)):d.val(d.val()+b);ga.set("textarea:rows")?ga.data.textarea.h[a]?d.height(ga.data.textarea.h[a]):ga.data.textarea.h[a]=parseFloat(d.prop("clientHeight"))+parseFloat(d.css("borderTopWidth"))+parseFloat(d.css("borderBottomWidth")):d.height(parseFloat(d.prop("scrollHeight"))+parseFloat(d.css("borderTopWidth"))+
    157 parseFloat(d.css("borderBottomWidth")));isatend&&d.scrollTop(d[0].scrollHeight)};ga.data.textarea.h={};ga.data.airavata=function(a,b){var c=$(a+"_airavata");c.is(":hidden")&&c.show();c.html(b)};
    158 ga.sync=function(a,b,c){var d,e=$("#"+b),f;if(e&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][c]){ga.sync.data[a][c][b]=!0;for(d in ga.sync.data[a][c])if(d!=b&&(f=$("#"+d))&&$.isNumeric(f.val())){e.val(f.val());e.change();return}ga.sync.data[a][c]._lastval&&$.isNumeric(ga.sync.data[a][c]._lastval)&&(e.val(ga.sync.data[a][c]._lastval),e.change())}else ga.sync.data=ga.sync.data||{},ga.sync.data[a]=ga.sync.data[a]||{},ga.sync.data[a][c]=ga.sync.data[a][c]||{},ga.sync.data[a][c][b]=!0};
    159 ga.sync.change=function(a,b,c){var d,e=$("#"+b);if(e&&$.isNumeric(e.val())&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][c])for(d in ga.sync.data[a][c]._lastval=e.val(),ga.sync.data[a][c])d!=b&&(a=$("#"+d))&&a.val()!=e.val()&&(a.val(e.val()),a.change())};ga.sync.reset=function(a){var b;if(ga.sync.data&&ga.sync.data[a])for(b in ga.sync.data[a])ga.sync.data[a][b]._lastval&&delete ga.sync.data[a][b]._lastval};ga.valuen={};ga.valuen.data={};ga.valuen.html={};ga.valuen.dflt={};ga.valuen.dflt.data={};
     134ga.repeat.repeat=function(a,c,b,e){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeat=ga.repeat.data[a].repeat||{};ga.repeat.data[a].repeat[c]={};ga.repeat.data[a].repeat[c].html=b;ga.repeat.data[a].repeat[c].eval=e;ga.repeat.map[c]=c;ga.repeat.data[a].repeat[c].htmlr=b.replace(/<\/label>/,"%%label%%</label>").replace(RegExp('id="'+c+'"'),'id="%%id%%"').replace(RegExp('name="'+c),'name="%%id%%').replace(RegExp('for="'+c+'"'),'for="%%id%%"').replace(RegExp('id="'+c+'_msg"'),'id="%%id%%_msg"').replace(RegExp('id="'+
     135c+'_tr"'),'id="%%id%%_tr"').replace(RegExp('id="'+c+'_button"'),'id="%%id%%_button"').replace(RegExp('="'+c+'_altval"',"g"),'="%%id%%_altval"').replace(RegExp('name="_selaltval_'+c+'"'),'name="_selaltval_%%id%%"').replace(RegExp('id="'+c+'-repeater"'),'id="%%id%%-repeater"');ga.repeat.data[a].repeat[c].htmls=b.replace(/<td><label.*?>(.*?)<\/label>\s*<\/td>/,"%%td%%$1%%etd%%").replace(/(<td[^>]*>).*?<\/td>/g,"$1</td>").replace(/<input[^>]*>/g,"").replace(/<span[^>]*>.*?<\/span>/g,"").replace(/\s*id=".*?"\s*/g,
     136"").replace("%%td%%","<td>").replace("%%etd%%","</td>").replace("<td></td>","");ga.repeat.data[a].repeat[c].evalr=e.replace(RegExp('"#'+c+'"',"g"),'"#%%id%%"').replace(RegExp('"#'+c+" option","g"),'"#%%id%% option').replace(RegExp(":"+c+":","g"),":%%id%%:").replace(RegExp('"#'+c+'_msg"',"g"),'"#%%id%%_msg"').replace(RegExp('"'+c+'"',"g"),'"%%id%%"').replace(RegExp('"#'+c+'_button"',"g"),'"#%%id%%_button"').replace(RegExp('"'+c+'_altval"',"g"),'"%%id%%_altval"').replace(RegExp('"#'+c+'_altval"',"g"),
     137'"#%%id%%_altval"');return'<tr><td></td><td><span id="'+c+'-span"></span></td></tr>'};
     138ga.repeat.repeatOn=function(a,c,b){var e=/^(.*):(.*)$/.exec(b);b=b.replace(":","-");ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[b]=ga.repeat.data[a].repeater[b]||{};ga.repeat.data[a].repeater[b].child=ga.repeat.data[a].repeater[b].child||[];ga.repeat.data[a].repeater[b].child.push(c);ga.repeat.data[a].repeat[c].refid=b;e&&(b=e[1],e=e[2],ga.repeat.data[a].repeater[b]=ga.repeat.data[a].repeater[b]||{},ga.repeat.data[a].repeater[b].child=ga.repeat.data[a].repeater[b].child||
     139[],ga.repeat.data[a].repeater[b].choice=ga.repeat.data[a].repeater[b].choice||[],ga.repeat.data[a].repeater[b].child.push(c),ga.repeat.data[a].repeater[b].choice.push(e))};
     140ga.repeat.repeater=function(a,c,b,e){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[c]=ga.repeat.data[a].repeater[c]||{};ga.repeat.data[a].repeater[c].type=b;e&&"__fields:tableize__"!=e&&!/^(off|false)$/i.test(e)&&(ga.repeat.data[a].repeater[c].tableize=1)};
     141ga.repeat.children=function(a,c,b){var e;b=b||{};if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[c]&&ga.repeat.data[a].repeater[c].child))return b;for(e=0;e<ga.repeat.data[a].repeater[c].child.length;++e)b[ga.repeat.data[a].repeater[c].child[e]]=!0,ga.repeat.data[a].repeater[e]&&(b=ga.repeat.children(a,e,b));return b};
     142ga.repeat.change=function(a,c,b){var e,f=[],d="#"+c;e=$(d);var g,h="",m="",k,r,l;if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[c]&&e.length))return!1;switch(ga.repeat.data[a].repeater[c].type){case "checkbox":e=e.prop("checked")?1:0;break;case "integer":case "listbox":e=e.val();break;default:return console.warn("ga.repeat.change( "+a+" , "+c+" ) type "+ga.repeat.data[a].repeater[c].type+" not supported"),!1}if(!b&&ga.repeat.data[a].repeater[c].value===e)return!1;g=
     143ga.repeat.children(a,c);switch(ga.repeat.data[a].repeater[c].type){case "checkbox":if(e)for(k in g)l=c+"-"+k,ga.repeat.map[k]=l,h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%",""),m+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,l),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[l]||(ga.repeat.data[a].repeater[l]=jQuery.extend({},ga.repeat.data[a].repeater[k])),f.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);
     144break;case "integer":if(ga.repeat.data[a].repeater[c].tableize&&0<e)for(k in g)h+=ga.repeat.data[a].repeat[k].htmls;for(r=1;r<=e;++r)for(k in g)l=c+"-"+k+"-"+(r-1),ga.repeat.map[k]=l,h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%","["+r+"]").replace(ga.repeat.data[a].repeater[c].tableize?/<td.*?><label.*?>.*?<\/label><\/td>/:"",""),m+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,l),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[l]||(ga.repeat.data[a].repeater[l]=
     145jQuery.extend({},ga.repeat.data[a].repeater[k])),f.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);break;case "listbox":g=c.replace(/-[0-9]+$/,"").replace(/^(.*)-([A-ZA-z0-9_]*)$/,"$2")+"-"+e;r=c+"-"+e;g=ga.repeat.children(a,g);for(k in g)l=r+"-"+k,ga.repeat.map[k]=l,h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%",""),m+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,l),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[l]||
     146(ga.repeat.data[a].repeater[l]=jQuery.extend({},ga.repeat.data[a].repeater[k])),f.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);break;default:return console.warn("ga.repeat.change( "+a+" , "+c+" ) type "+ga.repeat.data[a].repeater[c].type+" not supported"),!1}!/^<tr>/.test(h)&&/<\/tr>$/.test(h)&&(h="<tr>"+h);$(d+"-repeater").html(h);eval(m);ga.repeat.data[a].repeater[c].value=e;for(k=0;k<f.length;++k)ga.repeat.change(a,f[k],b);$("#global_data").data("_pull_json#"+
     147c)&&ga.pull.doPull("#"+c);ga.hhelp.reset()};ga.repeat.map.convert=function(a){var c,b=[];for(c=0;c<a.length;++c)b[c]=ga.repeat.map[a[c]]||a[c];return b};ga.hide=function(a,c){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][c]=ga.hide.data[a][c]||{};ga.hide.data[a][c].active=1};ga.hide.data={};
     148ga.hide.update=function(a,c){var b;if(ga.hide.data[a]&&ga.hide.data[a][c])if(ga.hide.data[a][c].hides){if($(c).prop("checked"))for(b in ga.hide.data[a][c].hides)$(b+"-itd").html(" "),$(b).hide();else for(b in ga.hide.data[a][c].hides)$(b+"-itd").html(ga.hide.data[a][c].hides[b]),$(b).show();ga.hhelp.set()}else console.log("ga.hide.update( "+a+" , "+c+" ) error, no hides attached to this hider");else console.log("ga.hide.update( "+a+" , "+c+" ) error, hider has not been defined")};
     149ga.hide.add=function(a,c,b){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][b]=ga.hide.data[a][b]||{};ga.hide.data[a][b].hides=ga.hide.data[a][b].hides||{};ga.hide.data[a][b].hides[c]=$(c+"-itd").html()};ga.directives=function(a,c){ga.directives.data=ga.directives.data||{};ga.directives.data[a]=c};ga.hideifnot=function(a,c){ga.directives.data&&ga.directives.data[c]&&!/^(off|false|0$)/.test(ga.directives.data[c].toLowerCase())||$(a).hide()};ga.data={};
     150ga.data.nofcrefresh={};function showTooltip(a,c,b,e){$('<div id="rtooltip">'+b+"</div>").css({position:"absolute",top:c+5,left:a+5,border:"1px solid #181616",padding:"2px","background-color":e,color:"white"}).appendTo("body")}ga.data.dataURLtoFile=function(a,c){for(var b=a.split(","),e=b[0].match(/:(.*?);/)[1],b=atob(b[1]),f=b.length,d=new Uint8Array(f);f--;)d[f]=b.charCodeAt(f);return new File([d],c,{type:e})};
     151ga.data.create_image_htmltocanvas=function(a){if($("#"+a+"_savetofile").length){var c=$("#"+a+"_div");html2canvas(c.get(0),{background:"#ffffff",onrendered:function(b){b='<a href="'+b.toDataURL("image/png").replace("image/png","image/octet-stream")+'" target="_blank" download="plot.png">plot.png</a>';$("#"+a+"_savetofile_link").html(b)}})}};
     152ga.data.create_image=function(a,c){if($("#"+a+"_savetofile").length){var b=document.getElementById(a+"_savetofile"),e=c.getCanvas().toDataURL("image/png").replace("image/png","image/octet-stream"),e=ga.data.dataURLtoFile(e,"plot.png");b.href=URL.createObjectURL(e);$("#"+a+"_savetofile").removeClass("hidden")}};
     153ga.data.update=function(a,c,b,e){var f=0,d=0,g=0,h=0,m=0,k=a+"_output",r="#"+k,l=$(r),u={},v=r+"_msgs",y=$(v),p,w,z,B,x,C,A;b&&($("#"+a+"_progress").empty(),y.text(""));$.each(c,function(q,n){A=l.find("#"+q);if(A.length)switch(f||(y.text(""),f=1),A.attr("type")){case "plot3d":case "plotly":p="#"+q;ga.plot3dglobal=n.layout;ga.dataplot3dglobal=n.data;ga.plotted3d[a]=0;$(p+"_showcollapse").length&&$(p+"_showcollapse").removeClass("hidden");Plotly.plot(q,n.data,n.layout);ga.showcollapse3d[a]&&(ga.plotted3d[a]=
     1541,$(p+"_showcollapse").trigger("click"));z=k+":#"+q+":last_value";$("#global_data").data(z,n);break;case "plot2d":p="#"+q;ga.value.plot2d.zstack.reset(p);if(n.data){if(ga.value.set.plot2d(p,n.options),ga.plotglobal=n.options,ga.dataplotglobal=n.data,$.plot(p,n.data,ga.value.get.plot2d.plot_options(p,n.options)),ga.customtooltips[a]){var v=null;$(p).bind("plothover",function(a,b,c){c?v!=c.dataIndex&&(v=c.dataIndex,$("#rtooltip").remove(),c.datapoint[0].toFixed(2),c.datapoint[1].toFixed(2),c.series.tooltips.length&&
     155showTooltip(c.pageX,c.pageY,c.series.tooltips[c.dataIndex],c.series.color)):($("#rtooltip").remove(),v=null)})}}else $.plot(p,n,ga.value.get.plot2d.plot_options(p));$(p+"_savetofile").length&&$(p+"_savetofile").removeClass("hidden");$(p+"_changescalex").length&&($(p+"_changescalex").removeClass("hidden"),"log"==n.options.xscale?$(p+"_changescalex_message").html("X-log"):$(p+"_changescalex_message").html("X-lin"));$(p+"_changescaley").length&&($(p+"_changescaley").removeClass("hidden"),"log"==n.options.yscale?
     156$(p+"_changescaley_message").html("Y-log"):$(p+"_changescaley_message").html("Y-lin"));$(p+"_showcollapse").length&&($(p+"_showcollapse").removeClass("hidden"),$(p).show(),ga.plotted2d[a]=1,$(p+"_showcollapse").trigger("click"));if(ga.value.settings[p].selzoom||n.options&&n.options.selection&&n.options.selection.mode&&"xy"==n.options.selection.mode)$(p).on("plotselected",{htag:p,data:n.data?n.data:n,options:n.data?ga.value.get.plot2d.plot_options(p,n.options):ga.value.get.plot2d.plot_options(p)},
     157function(a,b){1E-5>b.xaxis.to-b.xaxis.from&&(b.xaxis.to=b.xaxis.from+1E-5);1E-5>b.yaxis.to-b.yaxis.from&&(b.yaxis.to=b.yaxis.from+1E-5);ga.value.plot2d.zstack.dopush(a.data.htag,b);$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}}))}).on("contextmenu",{htag:p,data:n.data?n.data:n,options:n.data?ga.value.get.plot2d.plot_options(p,n.options):ga.value.get.plot2d.plot_options(p)},function(a){a.preventDefault();
     158var b=ga.value.plot2d.zstack.dopop(a.data.htag);b?$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}})):$.plot(a.data.htag,a.data.data,a.data.options)});z=k+":#"+q+":last_value";$("#global_data").data(z,n);break;case "bokeh":ga.bokeh.render(a,q,n);break;case "ngl":ga.value.nglshow(k,q,n);break;case "atomicstructure":z=k+":#"+q+":last_value";C=n.file?n.file:n;_jmol_info[q].script="set background ["+ga.colors.background+
     159"]; set zoomlarge false;set echo top center;echo loading "+C.split("/").pop()+';refresh;load "'+C+'";';ga.set(a+":jsmoladd")&&(_jmol_info[q].script+=ga.set(a+":jsmoladd"));n.script&&(_jmol_info[q].script+=";"+n.script);$("#global_data").data(z,_jmol_info[q].script);$("#"+q).html(Jmol.getAppletHtml("jmolApplet"+q,_jmol_info[q]));break;case "checkbox":case "radio":A.prop("checked",!0);break;case "div":A.html(n);break;case "video":w=$("#"+q);x="<video ";w.attr("data-width")&&(x+=' width="'+w.attr("data-width")+
     160'"');w.attr("data-height")&&(x+=' height="'+w.attr("data-height")+'"');x+=" controls>";x+='<source src="'+n+'.mp4" type="video/mp4" /><source src="'+n+'.webm" type="video/webm" />';x+="</video>";w.html(x);break;case "image":w=$("#"+q);x="<img ";w.attr("data-width")&&(x+=' width="'+w.attr("data-width")+'"');w.attr("data-height")&&(x+=' height="'+w.attr("data-height")+'"');x+=' src="'+n+'">';w.html(x);break;case "filelink":B='<a href="'+n+'" target="_blank">'+n.split("/").pop()+"</a>";z=k+":#"+q+":last_value";
     161$("#global_data").data(z,B);$("#"+q+"_filelink").html(B);break;case "filelinkm":z=k+":#"+q+":last_value";B="";$.each(n,function(a,b){B+='<a href="'+b+'" target="_blank">'+b.split("/").pop()+"</a> "});$("#global_data").data(z,B);$("#"+q+"_filelink").html(B);break;default:$("#global_data").data("_append:"+k+"_"+q)?(A.val(A.val()+"\n"+n),A.height(parseFloat(A.prop("scrollHeight")+parseFloat(A.css("borderTopWidth"))+parseFloat(A.css("borderBottomWidth"))))):A.val(n)}else b?"_"==q.charAt(0)?/^_fs_/.test(q)&&
     162ga.data.nofcrefresh[a]||("_message"==q&&ga.msg.box(n),"_question"==q&&ga.qr.question(a,c),"_question_answered"==q&&ga.qr.answered(a,c),"_question_timeout"==q&&ga.qr.timeout(a,c),/^_getinput/.test(q)&&"_getinput"==q&&ga.valuen.input(a,n),"_textarea"==q&&ga.data.textarea(r,n),"_airavata"==q&&ga.data.airavata(r,n),"_status"==q&&"complete"==n&&b(e,0,0)):(d||(y.append("<p>Unexpected results:</p>"),d=1),y.append("<p>"+q+" => "+n+"</p>")):"_"==q.charAt(0)?/^_fs_/.test(q)&&ga.data.nofcrefresh[a]||($("#_state").data(q,
     163n),g=1,"_status"==q&&(u.job_status=n),/^_getinput/.test(q)&&"_getinput"==q&&ga.valuen.input(a,n),"_textarea"==q&&ga.data.textarea(r,n),"_airavata"==q&&ga.data.airavata(r,n),"_loginverify"==q&&ga.login.verify(n),"_loginapprove"==q&&ga.login.approve(n)):"-close"==q?h=1:"-close2"==q?m=1:(d||(y.text(""),y.append("<p>Unexpected results:</p>"),f=d=1),y.append("<p>"+q+" => "+n+"</p>"))});ga.value.saveLastValues(k);ga.value.saveLastValue(k,v);$(r+"_progress").empty();g&&syncState();h&&ga.msg.close(1);m&&
     164ga.msg.close(2);return u};
     165ga.data.textarea=function(a,c){var b=a+"_textarea",e=$(b);isatend=e[0].scrollHeight-e[0].scrollTop===e[0].clientHeight;c||(c="");e.is(":hidden")&&(e.show(),$(b+"_label").show());"__reset__\n"==c.substr(0,10)?e.val(c.substr(10)):e.val(e.val()+c);ga.set("textarea:rows")?ga.data.textarea.h[a]?e.height(ga.data.textarea.h[a]):ga.data.textarea.h[a]=parseFloat(e.prop("clientHeight"))+parseFloat(e.css("borderTopWidth"))+parseFloat(e.css("borderBottomWidth")):e.height(parseFloat(e.prop("scrollHeight"))+parseFloat(e.css("borderTopWidth"))+
     166parseFloat(e.css("borderBottomWidth")));isatend&&e.scrollTop(e[0].scrollHeight)};ga.data.textarea.h={};ga.data.airavata=function(a,c){var b=$(a+"_airavata");b.is(":hidden")&&b.show();b.html(c)};
     167ga.sync=function(a,c,b){var e,f=$("#"+c),d;if(f&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][b]){ga.sync.data[a][b][c]=!0;for(e in ga.sync.data[a][b])if(e!=c&&(d=$("#"+e))&&$.isNumeric(d.val())){f.val(d.val());f.change();return}ga.sync.data[a][b]._lastval&&$.isNumeric(ga.sync.data[a][b]._lastval)&&(f.val(ga.sync.data[a][b]._lastval),f.change())}else ga.sync.data=ga.sync.data||{},ga.sync.data[a]=ga.sync.data[a]||{},ga.sync.data[a][b]=ga.sync.data[a][b]||{},ga.sync.data[a][b][c]=!0};
     168ga.sync.change=function(a,c,b){var e,f=$("#"+c);if(f&&$.isNumeric(f.val())&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][b])for(e in ga.sync.data[a][b]._lastval=f.val(),ga.sync.data[a][b])e!=c&&(a=$("#"+e))&&a.val()!=f.val()&&(a.val(f.val()),a.change())};ga.sync.reset=function(a){var c;if(ga.sync.data&&ga.sync.data[a])for(c in ga.sync.data[a])ga.sync.data[a][c]._lastval&&delete ga.sync.data[a][c]._lastval};ga.valuen={};ga.valuen.data={};ga.valuen.html={};ga.valuen.dflt={};ga.valuen.dflt.data={};
    160169ga.valuen.dflt.html={};ga.valuen.lastload="";
    161 ga.valuen.restore=function(a,b,c){var d="#"+a,e=$(d),f=e.find(":input").get(),h={},g,p;b=b||ga.valuen.data[a];c=c||ga.valuen.html[a];if(b){$(d+" .field_msg").html("");do g=!1,$.each(f,function(){var c,d,n=$(this),p,r;if(n.attr("data-repeater")&&!h[this.name]){h[this.name]=!0;if(this.name&&(b[this.name]||/checkbox|radio/i.test(this.type))){d=b[this.name];if(/checkbox|radio/i.test(this.type)){p=n.val();r=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==p){r=!0;break}n.prop("checked",r)}else n.val(d[0]);g=!0;
    162 ga.repeat.change(a,this.name,!0);f=e.find(":input").get();return!1}b[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.restore() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+d[0])}});while(g);$.each(f,function(){var c,d,e,g,f;if(this.name&&!h[this.name])if(e=$(this),(b[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName))if(d=b[this.name],/checkbox|radio/i.test(this.type)){g=e.val();f=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==
    163 g){f=!0;break}e.prop("checked",f)}else"file"===this.type?d[0]?$("#"+this.id+"_msg").html(" "+d[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):e.val(""):e.val(d[0]);else if(/button/i.test(this.nodeName)&&(d=e.attr("data-type"))&&(e=ga.altfile.button.getnames(this.id,d)))for(c=0;c<e.length;++c)b[e[c]]&&ga.altfile.button.addhtml(a,this.id,d,b[e[c]])});for(p in c)$("#"+p).html(c[p])}};
     170ga.valuen.restore=function(a,c,b){var e="#"+a,f=$(e),d=f.find(":input").get(),g={},h,m;c=c||ga.valuen.data[a];b=b||ga.valuen.html[a];if(c){$(e+" .field_msg").empty();do h=!1,$.each(d,function(){var b,e,l=$(this),m,v;if(l.attr("data-repeater")&&!g[this.name]){g[this.name]=!0;if(this.name&&(c[this.name]||/checkbox|radio/i.test(this.type))){e=c[this.name];if(/checkbox|radio/i.test(this.type)){m=l.val();v=!1;if(e)for(b=0;b<e.length;b++)if(e[b]==m){v=!0;break}l.prop("checked",v)}else l.val(e[0]);h=!0;
     171ga.repeat.change(a,this.name,!0);d=f.find(":input").get();return!1}c[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.restore() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+e[0])}});while(h);$.each(d,function(){var b,d,e,f,h;if(this.name&&!g[this.name])if(e=$(this),(c[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName))if(d=c[this.name],/checkbox|radio/i.test(this.type)){f=e.val();h=!1;if(d)for(b=0;b<d.length;b++)if(d[b]==
     172f){h=!0;break}e.prop("checked",h)}else"file"===this.type?d[0]?$("#"+this.id+"_msg").html(" "+d[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):e.val(""):e.val(d[0]);else if(/button/i.test(this.nodeName)&&(d=e.attr("data-type"))&&(e=ga.altfile.button.getnames(this.id,d)))for(b=0;b<e.length;++b)c[e[b]]&&ga.altfile.button.addhtml(a,this.id,d,c[e[b]])});for(m in b)$("#"+m).html(b[m])}};
    164173ga.valuen.restore.dflt=function(a){return ga.valuen.restore(a,ga.valuen.dflt.data[a],ga.valuen.dflt.html[a])};
    165 ga.valuen.save=function(a,b){var c=$("#"+a).find(":input").get();data={};html={};$.each(c,function(){var a=$(this),b=this.name&&!this.disabled,c=a.attr("data-add");if(b){if(this.checked||/select|textarea/i.test(this.nodeName)||/file|email|number|text|hidden|password/i.test(this.type))void 0==data[this.name]&&(data[this.name]=[]),data[this.name].push(a.val());c&&(void 0==html[c]&&(html[c]=[]),html[c].push($("#"+c).html()))}});b?(ga.valuen.dflt.data[a]=data,ga.valuen.dflt.html[a]=html):(ga.valuen.data[a]=
     174ga.valuen.save=function(a,c){var b=$("#"+a).find(":input").get();data={};html={};$.each(b,function(){var a=$(this),b=this.name&&!this.disabled,c=a.attr("data-add");if(b){if(this.checked||/select|textarea/i.test(this.nodeName)||/file|email|number|text|hidden|password/i.test(this.type))void 0==data[this.name]&&(data[this.name]=[]),data[this.name].push(a.val());c&&(void 0==html[c]&&(html[c]=[]),html[c].push($("#"+c).html()))}});c?(ga.valuen.dflt.data[a]=data,ga.valuen.dflt.html[a]=html):(ga.valuen.data[a]=
    166175data,ga.valuen.html[a]=html)};
    167 ga.valuen.input=function(a,b){var c=$("#"+a),d=c.find(":input").get(),e={},f;if(b){do f=!1,$.each(d,function(){var h,g,p=$(this),k,q;if(p.attr("data-repeater")&&!e[this.name]){e[this.name]=!0;if(this.name&&(b[this.name]||/checkbox|radio/i.test(this.type))){g=b[this.name];"[object Array]"!==Object.prototype.toString.call(g)&&(g=[g]);if(/checkbox|radio/i.test(this.type)){k=p.val();q=!1;if(g)for(h=0;h<g.length;h++)if(g[h]==k){q=!0;break}p.prop("checked",q)}else p.val(g[0]);f=!0;ga.repeat.change(a,this.name,
    168 !0);d=c.find(":input").get();return!1}b[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.input() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+g[0])}});while(f);$.each(d,function(){var c,d,f,k,q;if(this.name&&!e[this.name])if(f=$(this),(b[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName))if(d=b[this.name],"[object Array]"!==Object.prototype.toString.call(d)&&(d=[d]),/checkbox|radio/i.test(this.type)){k=f.val();
    169 q=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==k){q=!0;break}f.prop("checked",q)}else"file"===this.type?d[0]&&$("#"+this.id+"_msg").html(" "+d[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):f.val(d[0]);else if(/button/i.test(this.nodeName)&&(d=f.attr("data-type"))&&(f=ga.altfile.button.getnames(this.id,d),typenamesinput=ga.altfile.button.getnamesinput(this.id,d),f))for(c=0;c<f.length;++c)b[typenamesinput[c]]&&ga.altfile.button.addhtml(a,this.id,d,b[typenamesinput[c]])});
    170 $.each(b,function(a,b){var c;/^_html_/.test(a)&&(a=a.replace(/^_html_/,""),(c=$("#"+a))&&c.html(b))})}else console.warn("ga.valuen.input( "+a+" ) no data")};ga.valuen.addhtml=function(a){a=$("#"+a);var b=a.find(":input").get(),c="";$.each(b,function(){var a=$(this),b=this.name&&!this.disabled,a=a.attr("data-add");b&&a&&(c+='<input type="hidden" name="_html_'+a+'" value="'+$("#"+a).html()+'">')});a.append(c)};
     176ga.valuen.input=function(a,c){var b=$("#"+a),e=b.find(":input").get(),f={},d;if(c){do d=!1,$.each(e,function(){var g,h,m=$(this),k,r;if(m.attr("data-repeater")&&!f[this.name]){f[this.name]=!0;if(this.name&&(c[this.name]||/checkbox|radio/i.test(this.type))){h=c[this.name];"[object Array]"!==Object.prototype.toString.call(h)&&(h=[h]);if(/checkbox|radio/i.test(this.type)){k=m.val();r=!1;if(h)for(g=0;g<h.length;g++)if(h[g]==k){r=!0;break}m.prop("checked",r)}else m.val(h[0]);d=!0;ga.repeat.change(a,this.name,
     177!0);e=b.find(":input").get();return!1}c[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.input() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+h[0])}});while(d);$.each(e,function(){var b,d,e,k,r;if(this.name&&!f[this.name])if(e=$(this),(c[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName))if(d=c[this.name],"[object Array]"!==Object.prototype.toString.call(d)&&(d=[d]),/checkbox|radio/i.test(this.type)){k=e.val();
     178r=!1;if(d)for(b=0;b<d.length;b++)if(d[b]==k){r=!0;break}e.prop("checked",r)}else"file"===this.type?d[0]&&$("#"+this.id+"_msg").html(" "+d[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):e.val(d[0]);else if(/button/i.test(this.nodeName)&&(d=e.attr("data-type"))&&(e=ga.altfile.button.getnames(this.id,d),typenamesinput=ga.altfile.button.getnamesinput(this.id,d),e))for(b=0;b<e.length;++b)c[typenamesinput[b]]&&ga.altfile.button.addhtml(a,this.id,d,c[typenamesinput[b]])});
     179$.each(c,function(a,b){var c;/^_html_/.test(a)&&(a=a.replace(/^_html_/,""),(c=$("#"+a))&&c.html(b))})}else console.warn("ga.valuen.input( "+a+" ) no data")};ga.valuen.addhtml=function(a){a=$("#"+a);var c=a.find(":input").get(),b="";$.each(c,function(){var a=$(this),c=this.name&&!this.disabled,a=a.attr("data-add");c&&a&&(b+='<input type="hidden" name="_html_'+a+'" value="'+$("#"+a).html()+'">')});a.append(b)};
    171180ga.valuen.reset=function(){ga.valuen.data={};ga.valuen.html={};ga.valuen.dflt={};ga.valuen.dflt.data={};ga.valuen.dflt.html={};ga.valuen.lastload=""};
    172 ga.license=function(a){a=a.split(",");var b=[],c,d=[],e;a.length&&(c="<p>Submitting to this module requires "+(1<a.length?"approved licenses":"an approved license")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(e in a)if(d.push({id:a[e],label:a[e]+" Management",data:a[e],cb:function(a){return ga.altfile.button.simplecall("license",a)}}),ga.license.data[a[e]]&&ga.license.data[a[e]].status)switch(ga.license.data[a[e]].status){case "approved":break;case "denied":c+="<p>Your license request for <em>"+
    173 a[e]+"</em> has been <strong>denied</strong>.</p>";b.push(a[e]);break;case "pending":c+="<p>Your license request for <em>"+a[e]+"</em> is pending approval.</p>";b.push(a[e]);break;default:console.warn("ga.license() "+a[e]+" unknown status "+ga.license.data[a[e]].status),b.push(a[e])}else b.push(a[e]);return b.length?(messagebox({icon:"warning.png",text:c,buttons:d}),!1):!0};ga.license.data={};
    174 ga.license.get=function(){ga.license.data={};ga.license.url&&$.getJSON(ga.license.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,b,c){a.license&&(ga.license.data=a.license);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,b,c){console.warn("could not get license data")})};
    175 ga.captcha=function(a,b){var c="";$.ajax({url:ga.captcha.url,data:{_window:window.name}}).success(function(d){d=$.parseJSON(d);d.error?messagebox({icon:"toast.png",text:d.error}):(c='<img src="data:image/png;base64,'+d.captcha+'"><form id="sys_captcha"><label for="sys_captcha_text">Verify </label><input id="sys_captcha_text" class="help_link" type="text" maxlength="6" size="6" required><span class="help">Enter the 6 character alphanumeric code shown in the image and then press submit</span><input id="sys_captcha_id" type="hidden" value="'+
    176 d.id+'"></form>',messagebox({text:c,eval:"resetHoverHelp();$('#sys_captcha').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"submit",label:"Submit",cb:ga.captcha.verify,data:{cb:a,data:b}}]}))}).error(function(a){messagebox({icon:"toast.png",text:"Error contacting server"})})};
    177 ga.captcha.verify=function(a){$.ajax({url:ga.captcha.url_verify,data:{_window:window.name,captcha:$("#sys_captcha_text").val(),id:$("#sys_captcha_id").val()}}).success(function(b){b=$.parseJSON(b);if(b.error)messagebox({icon:"toast.png",text:b.error});else if(b.success)a.cb(a.data);else return ga.captcha(a.cb,a.data)}).error(function(a){messagebox({icon:"toast.png",text:"Error contacting server"})})};
    178 ga.register=function(a){a=a.split(",");var b=[],c,d=[],e;a.length&&(c="<p>Submitting to this module requires "+(1<a.length?"approved registers":"an approved register")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(e in a)if(d.push({id:a[e],label:a[e]+" Management",data:a[e],cb:function(a){return ga.altfile.button.simplecall("register",a)}}),ga.register.data[a[e]]&&ga.register.data[a[e]].status)switch(ga.register.data[a[e]].status){case "approved":break;case "denied":c+="<p>Your register request for <em>"+
    179 a[e]+"</em> has been <strong>denied</strong>.</p>";b.push(a[e]);break;case "pending":c+="<p>Your register request for <em>"+a[e]+"</em> is pending approval.</p>";b.push(a[e]);break;default:console.warn("ga.register() "+a[e]+" unknown status "+ga.register.data[a[e]].status),b.push(a[e])}else b.push(a[e]);return b.length?(messagebox({icon:"warning.png",text:c,buttons:d}),!1):!0};ga.register.data={};
    180 ga.register.get=function(){ga.register.data={};ga.register.url&&$.getJSON(ga.register.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,b,c){a.register&&(ga.register.data=a.register);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,b,c){console.warn("could not get register data")})};ga.calc={};ga.calc.data={};ga.calc.str_atom_numeric="(?:(?:-?[1-9][0-9]*)|(?:-?0))?(?:[.][0-9]+)?(?:[eE][-+]?[0-9]+)?";
     181ga.license=function(a){a=a.split(",");var c=[],b,e=[],f;a.length&&(b="<p>Submitting to this module requires "+(1<a.length?"approved licenses":"an approved license")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(f in a)if(e.push({id:a[f],label:a[f]+" Management",data:a[f],cb:function(a){return ga.altfile.button.simplecall("license",a)}}),ga.license.data[a[f]]&&ga.license.data[a[f]].status)switch(ga.license.data[a[f]].status){case "approved":break;case "denied":b+="<p>Your license request for <em>"+
     182a[f]+"</em> has been <strong>denied</strong>.</p>";c.push(a[f]);break;case "pending":b+="<p>Your license request for <em>"+a[f]+"</em> is pending approval.</p>";c.push(a[f]);break;default:console.warn("ga.license() "+a[f]+" unknown status "+ga.license.data[a[f]].status),c.push(a[f])}else c.push(a[f]);return c.length?(ga.msg.box({icon:"warning.png",text:b,buttons:e}),!1):!0};ga.license.data={};
     183ga.license.get=function(){ga.license.data={};ga.license.url&&$.getJSON(ga.license.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,c,b){a.license&&(ga.license.data=a.license);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,c,b){console.warn("could not get license data")})};
     184ga.captcha=function(a,c){var b="";$.ajax({url:ga.captcha.url,data:{_window:window.name}}).success(function(e){e=$.parseJSON(e);e.error?ga.msg.box({icon:"toast.png",text:e.error}):(b='<img src="data:image/png;base64,'+e.captcha+'"><form id="sys_captcha"><label for="sys_captcha_text">Verify </label><input id="sys_captcha_text" class="help_link" type="text" maxlength="6" size="6" required><span class="help">Enter the 6 character alphanumeric code shown in the image and then press submit</span><input id="sys_captcha_id" type="hidden" value="'+
     185e.id+'"></form>',ga.msg.box({text:b,eval:"ga.hhelp.reset();$('#sys_captcha').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"submit",label:"Submit",cb:ga.captcha.verify,data:{cb:a,data:c}}]}))}).error(function(a){ga.msg.box({icon:"toast.png",text:"Error contacting server"})})};
     186ga.captcha.verify=function(a){$.ajax({url:ga.captcha.url_verify,data:{_window:window.name,captcha:$("#sys_captcha_text").val(),id:$("#sys_captcha_id").val()}}).success(function(c){c=$.parseJSON(c);if(c.error)ga.msg.box({icon:"toast.png",text:c.error});else if(c.success)a.cb(a.data);else return ga.captcha(a.cb,a.data)}).error(function(a){ga.msg.box({icon:"toast.png",text:"Error contacting server"})})};
     187ga.register=function(a){a=a.split(",");var c=[],b,e=[],f;a.length&&(b="<p>Submitting to this module requires "+(1<a.length?"approved registers":"an approved register")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(f in a)if(e.push({id:a[f],label:a[f]+" Management",data:a[f],cb:function(a){return ga.altfile.button.simplecall("register",a)}}),ga.register.data[a[f]]&&ga.register.data[a[f]].status)switch(ga.register.data[a[f]].status){case "approved":break;case "denied":b+="<p>Your register request for <em>"+
     188a[f]+"</em> has been <strong>denied</strong>.</p>";c.push(a[f]);break;case "pending":b+="<p>Your register request for <em>"+a[f]+"</em> is pending approval.</p>";c.push(a[f]);break;default:console.warn("ga.register() "+a[f]+" unknown status "+ga.register.data[a[f]].status),c.push(a[f])}else c.push(a[f]);return c.length?(ga.msg.box({icon:"warning.png",text:b,buttons:e}),!1):!0};ga.register.data={};
     189ga.register.get=function(){ga.register.data={};ga.register.url&&$.getJSON(ga.register.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,c,b){a.register&&(ga.register.data=a.register);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,c,b){console.warn("could not get register data")})};ga.calc={};ga.calc.data={};ga.calc.str_atom_numeric="(?:(?:-?[1-9][0-9]*)|(?:-?0))?(?:[.][0-9]+)?(?:[eE][-+]?[0-9]+)?";
    181190ga.calc.str_atom_id="[A-Za-z][A-Za-z0-9_:]*";ga.calc.str_function="(?:abs\\(|acos\\(|asin\\(|atan\\(|atan2\\(|ceil\\(|cos\\(|exp\\(|floor\\(|log\\(|max\\(|min\\(|pow\\(|random\\(|round\\(|sin\\(|sqrt\\(|tan\\(|-)";ga.calc.str_function_paren="(?:abs\\(|acos\\(|asin\\(|atan\\(|atan2\\(|ceil\\(|cos\\(|exp\\(|floor\\(|log\\(|max\\(|min\\(|pow\\(|random\\(|round\\(|sin\\(|sqrt\\(|tan\\()";ga.calc.str_function_no_paren="-";ga.calc.str_binary="[-,+*/^]";ga.calc.str_open_paren="\\(";
    182191ga.calc.str_close_paren="\\)";ga.calc.str_paren="[()]";ga.calc.is_atom_numeric=RegExp("^"+ga.calc.str_atom_numeric+"$");ga.calc.is_atom_id=RegExp("^"+ga.calc.str_atom_id+"$");ga.calc.is_function=RegExp("^"+ga.calc.str_function+"$");ga.calc.is_function_paren=RegExp("^"+ga.calc.str_function_paren+"$");ga.calc.is_function_no_paren=RegExp("^"+ga.calc.str_function_no_paren+"$");ga.calc.is_binary=RegExp("^"+ga.calc.str_binary+"$");ga.calc.is_open_paren=RegExp("^"+ga.calc.str_open_paren+"$");
    183192ga.calc.is_close_paren=RegExp("^"+ga.calc.str_close_paren+"$");ga.calc.is_paren=RegExp("^"+ga.calc.str_paren+"$");ga.calc.is_atom=RegExp("^("+ga.calc.str_atom_id+"|"+ga.calc.str_atom_numeric+")$");ga.calc.inc_paren=RegExp("^("+ga.calc.str_paren+"|"+ga.calc.str_function_paren+")$");ga.calc.precedence={"^":4,"*":5,"/":5,"+":6,"-":6,",":8};
    184 ga.calc.register=function(a,b,c){ga.calc.data[a]=ga.calc.data[a]||{};ga.calc.data[a].calc=ga.calc.data[a].calc||{};ga.calc.data[a].calc[b]={};ga.calc.data[a].calc[b].calc=c;ga.calc.data[a].calc[b].tokens=ga.calc.tokens(c);ga.calc.data[a].calc[b].tokens._error?messagebox({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[b].tokens._error+" in calc field id "+b}):(ga.calc.repeatertokens(a,b),ga.calc.data[a].calc[b].dependents=ga.calc.dependents(a,b),99<ga.calc.depthofdeps(a,
    185 b)?messagebox({icon:"toast.png",text:"Module field calc internal error: maximum recursion depth found in calc field id "+b}):(ga.calc.data[a].calc[b].tree=ga.calc.mktree(ga.calc.data[a].calc[b].tokens),ga.calc.data[a].calc[b].tree._error?messagebox({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[b].tree._error+" in calc field id "+b}):ga.calc.install(a,b)))};
    186 ga.calc.repeatertokens=function(a,b){var c,d;if(/-/.test(b))for(i in c=b.split("-"),/\d+/.test(c[c.length-1])?(d=c.slice(0,c.length-2).join(":")+":",c=":"+c[c.length-1]):(d=c.slice(0,c.length-1).join(":")+":",c=""),ga.calc.data[a].calc[b].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[b].tokens[i])&&!$("#"+ga.calc.data[a].calc[b].tokens[i]).length&&(ga.calc.data[a].calc[b].tokens[i]=d+ga.calc.data[a].calc[b].tokens[i]+c)};
    187 ga.calc.depthofdeps=function(a,b,c){var d,e,f=0;c=c||0;ga.calc.data[a].calc[b].dependents&&c++;if(99<c)return c;for(d=0;d<ga.calc.data[a].calc[b].dependents.length;++d)ga.calc.data[a].calc[ga.calc.data[a].calc[b].dependents[d]]&&(e=ga.calc.depthofdeps(a,ga.calc.data[a].calc[b].dependents[d],c),f<e&&(f=e));return c+f};
    188 ga.calc.dependents=function(a,b){var c,d=[];for(c in ga.calc.data[a].calc[b].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[b].tokens[c])&&d.push(ga.calc.data[a].calc[b].tokens[c]);return d};ga.calc.install=function(a,b){for(var c in ga.calc.data[a].calc[b].dependents)$("#"+ga.calc.data[a].calc[b].dependents[c].replace(/:/g,"-")).on("change",function(){ga.calc.process(a,b)})};
    189 ga.calc.process=function(a,b){var c=ga.calc.evaltree(jQuery.extend(!0,{},ga.calc.data[a].calc[b].tree));c._error?messagebox({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[b].tokens._error+" in calc field id "+b}):$("#"+b).val(c).trigger("change")};
    190 ga.calc.tokens=function(a){var b=[],c,d=[],e=RegExp("^("+ga.calc.str_function_paren+"|"+ga.calc.str_atom_id+"|"+ga.calc.str_paren+"|"+ga.calc.str_atom_numeric+"|"+ga.calc.str_function_no_paren+")"),f=RegExp("^("+ga.calc.str_binary+"|"+ga.calc.str_close_paren+")"),h=500;a=a.replace(/\s+/g,"");d.push(0);do{if(0<d.length&&d[d.length-1]){c=f.exec(a);if(!c)return{_error:"Invalid token found "+a};if(ga.calc.is_close_paren.test(c[0])){if(!d.length)return{_error:"Invalid closing parenthesis "+a};d.pop()}else d[d.length-
    191 1]=0}else{c=e.exec(a);if(!c)return{_error:"Invalid token found "+a};if(ga.calc.is_atom.test(c[0]))d[d.length-1]=1;else if(ga.calc.is_open_paren.test(c[0]))d.push(0);else if(ga.calc.is_close_paren.test(c[0])){if(!d.length)return{_error:"Invalid closing parenthesis "+a};d.pop()}else ga.calc.is_function_paren.test(c[0])&&d.push(0)}a=a.substring(c[0].length);b.push(c[0])}while(c&&c.length&&a.length&&0<--h);return 0>=h?{_error:"maximum token limit of 500 reached"}:b};
    192 ga.calc.parensub=function(a){for(var b=1,c={a:[]},d=1;d<a.length;++d){if(")"==a[d]&&(b--,0==b))return c.newofs=d,c;c.a.push(a[d]);/\($/.test(a[d])&&b++}return{_error:"Closing parenthesis error"}};
    193 ga.calc.mktree=function(a,b){for(var c=[],d=null,e,f,h=0;h<a.length;++h){token=a[h];if(ga.calc.is_function_paren.test(token)){e=ga.calc.parensub(a.slice(h));if(e._error)return e;h+=e.newofs;token={op:token,args:[e=ga.calc.mktree(e.a)]};f=1;if(e._error)return e}else if(ga.calc.is_open_paren.test(token)){e=ga.calc.parensub(a.slice(h));if(e._error)return e;h+=e.newofs;token=ga.calc.mktree(e.a);if(token._error)return token;f=1}else f=0;f||ga.calc.is_atom.test(token)?(c.push(token),d&&(b?ga.calc.precedence[d]<
    194 ga.calc.precedence[b.op]?(console.log("replace 2nd arg"),b.args[1]={op:d,args:[b.args[1],token]}):(console.log("replace parent object"),b={op:d,args:[b,token]}):(b={op:d,args:c},d=null,c=[]))):ga.calc.is_binary.test(token)&&(d=token)}!b&&c.length&&(b={op:"()",args:c});return b};
    195 ga.calc.arraytovals=function(a){var b;if(a.constructor===Array)for(b=0;b<a.length;++b)a[b]=Number(ga.calc.is_atom_id.test(a[b])?$("#"+a[b].replace(/:/g,"-")).val():a[b]);else a=Number(ga.calc.is_atom_id.test(a)?$("#"+a.replace(/:/g,"-")).val():a);return a};
    196 ga.calc.evaltree=function(a){var b,c,d,e,f,h,g,p,k;d=1;if(!a)return{_error:"no object in ga.calc.evaltree"};if(a._error)return a;if(!a.op)return{_error:"no op in object in ga.calc.evaltree"};if(!a.args)return{_error:"no args in object in ga.calc.evaltree"};if(1>a.args.length||2<a.args.length)return{_error:"args incorrect length in object in ga.calc.evaltree"};(c=2==a.args.length)&&"undefined"==typeof a.args[1]&&(c=0);"undefined"==typeof a.args[0]&&(d=0);d&&a.args[0].op&&(a.args[0]=ga.calc.evaltree(a.args[0]));
    197 c&&a.args[1].op&&(a.args[1]=ga.calc.evaltree(a.args[1]));d&&(a.args[0]=ga.calc.arraytovals(a.args[0]),c&&(a.args[1]=ga.calc.arraytovals(a.args[1])));d=d&&a.args[0].constructor===Array;c&&(e=a.args[1].constructor===Array,b=d||e,(f=d&&e)?a.args[0].length<a.args[1].length?(h=a.args[0],g=a.args[1],p=1):(h=a.args[1],g=a.args[0],p=0):b&&(g=a.args[d?0:1],k=a.args[d?1:0]));switch(a.op){case ",":b=d?a.args[0]:[a.args[0]];c&&"undefined"!=typeof a.args[1]&&(b=b.concat(e?a.args[1]:[a.args[1]]));break;case "()":c?
    198 (b=d?a.args[0]:[a.args[0]],c&&a.args[1]&&(b=b.concat(e?a.args[1]:[a.args[1]]))):b=a.args[0];break;case "+":if(!c)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(b)if(b=g,f)for(c=0;c<h.length;++c)b[c]+=h[c];else for(c=0;c<g.length;++c)b[c]+=k;else b=a.args[0]+a.args[1];break;case "*":if(!c)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(b)if(b=g,f)for(c=0;c<h.length;++c)b[c]*=h[c];else for(c=0;c<g.length;++c)b[c]*=k;else b=a.args[0]*a.args[1];
    199 break;case "-":if(!c)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(b)if(f){b=a.args[0];for(c=0;c<h.length;++c)b[c]-=a.args[1][c];if(p)for(c=a.args[0].length;c<a.args[1].length;++c)b.push(-a.args[1][c]);else for(c=a.args[1].length;c<a.args[0].length;++c)b.push(a.args[0][c])}else if(d)for(b=a.args[0],c=0;c<a.args[0].length;++c)b[c]-=a.args[1];else for(b=[],c=0;c<a.args[1].length;++c)b.push(a.args[0]-a.args[1][c]);else b=a.args[0]-a.args[1];break;case "/":if(!c)return{_error:"operator : "+
    200 a.op+" is binary and only has one argument"};if(b)if(f){b=a.args[0];for(c=0;c<h.length;++c)b[c]/=a.args[1][c];if(p)for(c=a.args[0].length;c<a.args[1].length;++c)b.push(0);else for(c=a.args[1].length;c<a.args[0].length;++c)b.push(a.args[0][c]/0)}else if(d)for(b=a.args[0],c=0;c<a.args[0].length;++c)b[c]/=a.args[1];else for(b=[],c=0;c<a.args[1].length;++c)b.push(a.args[0]/a.args[1][c]);else b=a.args[0]/a.args[1];break;case "^":if(!c)return{_error:"operator : "+a.op+" is binary and only has one argument"};
    201 if(b)if(f){b=a.args[0];for(c=0;c<h.length;++c)b[c]=Math.pow(b[c],a.args[1][c]);if(p)for(c=a.args[0].length;c<a.args[1].length;++c)b.push(0);else for(c=a.args[1].length;c<a.args[0].length;++c)b.push(1)}else if(d)for(b=a.args[0],c=0;c<a.args[0].length;++c)b[c]=pow(b[c],a.args[1]);else for(b=[],c=0;c<a.args[1].length;++c)b.push(pow(a.args[0],a.args[1][c]));else b=Math.pow(a.args[0],a.args[1]);break;case "abs(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];
    202 if(d)for(c=0;c<b.length;++c)b[c]=Math.abs(b[c]);else b=Math.abs(a.args[0]);break;case "acos(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.acos(b[c]);else b=Math.acos(a.args[0]);break;case "asin(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.asin(b[c]);else b=Math.asin(a.args[0]);break;case "atan(":if(c)return{_error:"operator : "+
    203 a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.atan(b[c]);else b=Math.atan(a.args[0]);break;case "ceil(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.ceil(b[c]);else b=Math.ceil(a.args[0]);break;case "cos(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.cos(b[c]);else b=Math.cos(a.args[0]);
    204 break;case "exp(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.exp(b[c]);else b=Math.exp(a.args[0]);break;case "floor(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.floor(b[c]);else b=Math.floor(a.args[0]);break;case "log(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=
    205 Math.log(b[c]);else b=Math.log(a.args[0]);break;case "random(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.random();else b=Math.random();break;case "round(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.round(b[c]);else b=Math.round(a.args[0]);break;case "sin(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};
    206 b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.sin(b[c]);else b=Math.sin(a.args[0]);break;case "sqrt(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.sqrt(b[c]);else b=Math.sqrt(a.args[0]);break;case "tan(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=a.args[0];if(d)for(c=0;c<b.length;++c)b[c]=Math.tan(b[c]);else b=Math.tan(a.args[0]);break;case "max(":if(c)return{_error:"operator : "+
    207 a.op+" has 2 arguments but only accepts one"};b=d?Math.max.apply(null,a.args[0]):a.args[0];break;case "min(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};b=d?Math.min.apply(null,a.args[0]):a.args[0];break;case "atan2(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!d)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};b=[];for(c=0;c<a.args[0].length;c+=2)b.push(Math.atan2(a.args[0][c],a.args[0][c+
    208 1]));break;case "pow(":if(c)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!d)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};b=[];for(c=0;c<a.args[0].length;c+=2)b.push(Math.pow(a.args[0][c],a.args[0][c+1]));1==b.length&&(b=b[0]);break;default:return{_error:"operator : "+a.op+" unknown or unsupported"}}return b};ga.bokeh={};ga.bokeh.data={};
    209 ga.bokeh.getdata=function(a,b){var c={},d=b.split(/\r?\n/),e=d.length,f,h=0;for(f=0;f<e;++f)if(h||-1!==d[f].indexOf("var docs_json ="))if(!h)h=1,c.docs_json=$.parseJSON(d[f].replace(/^\s*var\s+docs_json\s+=\s+/,"").replace(/;$/,""));else if(1==h&&-1!==d[f].indexOf("var render_items =")){c.render_items=$.parseJSON(d[f].replace(/^\s*var\s+render_items\s+=\s+/,"").replace(/;$/,""));break}return c};
    210 ga.bokeh.render=function(a,b,c){c=ga.bokeh.getdata(b,c);a+="_output";ga.bokeh.savedata(a,b,c);ga.bokeh.renderdata(a,b)};
    211 ga.bokeh.renderdata=function(a,b){var c,d,e="";if(ga.bokeh.data[a]&&ga.bokeh.data[a][b]&&ga.bokeh.data[a][b].docs_json&&ga.bokeh.data[a][b].render_items){d=ga.bokeh.data[a][b].render_items.length;for(c=0;c<d;++c)e+='<div class="bk-root"><div class="bk-plotdiv" id="'+ga.bokeh.data[a][b].render_items[c].elementid+'"></div></div>';$("#"+b).html(e);Bokeh.embed.embed_items(ga.bokeh.data[a][b].docs_json,ga.bokeh.data[a][b].render_items)}};
    212 ga.bokeh.savedata=function(a,b,c){ga.bokeh.data[a]=ga.bokeh.data[a]||{};ga.bokeh.data[a][b]=c};ga.bokeh.reset=function(a,b){ga.bokeh.data[a]&&ga.bokeh.data[a][b]&&(ga.bokeh.data[a][b]={},$("#"+b).html(""))};
     193ga.calc.register=function(a,c,b){ga.calc.data[a]=ga.calc.data[a]||{};ga.calc.data[a].calc=ga.calc.data[a].calc||{};ga.calc.data[a].calc[c]={};ga.calc.data[a].calc[c].calc=b;ga.calc.data[a].calc[c].tokens=ga.calc.tokens(b);ga.calc.data[a].calc[c].tokens._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[c].tokens._error+" in calc field id "+c}):(ga.calc.repeatertokens(a,c),ga.calc.data[a].calc[c].dependents=ga.calc.dependents(a,c),99<ga.calc.depthofdeps(a,
     194c)?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: maximum recursion depth found in calc field id "+c}):(ga.calc.data[a].calc[c].tree=ga.calc.mktree(ga.calc.data[a].calc[c].tokens),ga.calc.data[a].calc[c].tree._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[c].tree._error+" in calc field id "+c}):ga.calc.install(a,c)))};
     195ga.calc.repeatertokens=function(a,c){var b,e;if(/-/.test(c))for(i in b=c.split("-"),/\d+/.test(b[b.length-1])?(e=b.slice(0,b.length-2).join(":")+":",b=":"+b[b.length-1]):(e=b.slice(0,b.length-1).join(":")+":",b=""),ga.calc.data[a].calc[c].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[c].tokens[i])&&!$("#"+ga.calc.data[a].calc[c].tokens[i]).length&&(ga.calc.data[a].calc[c].tokens[i]=e+ga.calc.data[a].calc[c].tokens[i]+b)};
     196ga.calc.depthofdeps=function(a,c,b){var e,f,d=0;b=b||0;ga.calc.data[a].calc[c].dependents&&b++;if(99<b)return b;for(e=0;e<ga.calc.data[a].calc[c].dependents.length;++e)ga.calc.data[a].calc[ga.calc.data[a].calc[c].dependents[e]]&&(f=ga.calc.depthofdeps(a,ga.calc.data[a].calc[c].dependents[e],b),d<f&&(d=f));return b+d};
     197ga.calc.dependents=function(a,c){var b,e=[];for(b in ga.calc.data[a].calc[c].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[c].tokens[b])&&e.push(ga.calc.data[a].calc[c].tokens[b]);return e};ga.calc.install=function(a,c){for(var b in ga.calc.data[a].calc[c].dependents)$("#"+ga.calc.data[a].calc[c].dependents[b].replace(/:/g,"-")).on("change",function(){ga.calc.process(a,c)})};
     198ga.calc.process=function(a,c){var b=ga.calc.evaltree(jQuery.extend(!0,{},ga.calc.data[a].calc[c].tree));b._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[c].tokens._error+" in calc field id "+c}):$("#"+c).val(b).trigger("change")};
     199ga.calc.tokens=function(a){var c=[],b,e=[],f=RegExp("^("+ga.calc.str_function_paren+"|"+ga.calc.str_atom_id+"|"+ga.calc.str_paren+"|"+ga.calc.str_atom_numeric+"|"+ga.calc.str_function_no_paren+")"),d=RegExp("^("+ga.calc.str_binary+"|"+ga.calc.str_close_paren+")"),g=500;a=a.replace(/\s+/g,"");e.push(0);do{if(0<e.length&&e[e.length-1]){b=d.exec(a);if(!b)return{_error:"Invalid token found "+a};if(ga.calc.is_close_paren.test(b[0])){if(!e.length)return{_error:"Invalid closing parenthesis "+a};e.pop()}else e[e.length-
     2001]=0}else{b=f.exec(a);if(!b)return{_error:"Invalid token found "+a};if(ga.calc.is_atom.test(b[0]))e[e.length-1]=1;else if(ga.calc.is_open_paren.test(b[0]))e.push(0);else if(ga.calc.is_close_paren.test(b[0])){if(!e.length)return{_error:"Invalid closing parenthesis "+a};e.pop()}else ga.calc.is_function_paren.test(b[0])&&e.push(0)}a=a.substring(b[0].length);c.push(b[0])}while(b&&b.length&&a.length&&0<--g);return 0>=g?{_error:"maximum token limit of 500 reached"}:c};
     201ga.calc.parensub=function(a){for(var c=1,b={a:[]},e=1;e<a.length;++e){if(")"==a[e]&&(c--,0==c))return b.newofs=e,b;b.a.push(a[e]);/\($/.test(a[e])&&c++}return{_error:"Closing parenthesis error"}};
     202ga.calc.mktree=function(a,c){for(var b=[],e=null,f,d,g=0;g<a.length;++g){token=a[g];if(ga.calc.is_function_paren.test(token)){f=ga.calc.parensub(a.slice(g));if(f._error)return f;g+=f.newofs;token={op:token,args:[f=ga.calc.mktree(f.a)]};d=1;if(f._error)return f}else if(ga.calc.is_open_paren.test(token)){f=ga.calc.parensub(a.slice(g));if(f._error)return f;g+=f.newofs;token=ga.calc.mktree(f.a);if(token._error)return token;d=1}else d=0;d||ga.calc.is_atom.test(token)?(b.push(token),e&&(c?ga.calc.precedence[e]<
     203ga.calc.precedence[c.op]?(console.log("replace 2nd arg"),c.args[1]={op:e,args:[c.args[1],token]}):(console.log("replace parent object"),c={op:e,args:[c,token]}):(c={op:e,args:b},e=null,b=[]))):ga.calc.is_binary.test(token)&&(e=token)}!c&&b.length&&(c={op:"()",args:b});return c};
     204ga.calc.arraytovals=function(a){var c;if(a.constructor===Array)for(c=0;c<a.length;++c)a[c]=Number(ga.calc.is_atom_id.test(a[c])?$("#"+a[c].replace(/:/g,"-")).val():a[c]);else a=Number(ga.calc.is_atom_id.test(a)?$("#"+a.replace(/:/g,"-")).val():a);return a};
     205ga.calc.evaltree=function(a){var c,b,e,f,d,g,h,m,k;e=1;if(!a)return{_error:"no object in ga.calc.evaltree"};if(a._error)return a;if(!a.op)return{_error:"no op in object in ga.calc.evaltree"};if(!a.args)return{_error:"no args in object in ga.calc.evaltree"};if(1>a.args.length||2<a.args.length)return{_error:"args incorrect length in object in ga.calc.evaltree"};(b=2==a.args.length)&&"undefined"==typeof a.args[1]&&(b=0);"undefined"==typeof a.args[0]&&(e=0);e&&a.args[0].op&&(a.args[0]=ga.calc.evaltree(a.args[0]));
     206b&&a.args[1].op&&(a.args[1]=ga.calc.evaltree(a.args[1]));e&&(a.args[0]=ga.calc.arraytovals(a.args[0]),b&&(a.args[1]=ga.calc.arraytovals(a.args[1])));e=e&&a.args[0].constructor===Array;b&&(f=a.args[1].constructor===Array,c=e||f,(d=e&&f)?a.args[0].length<a.args[1].length?(g=a.args[0],h=a.args[1],m=1):(g=a.args[1],h=a.args[0],m=0):c&&(h=a.args[e?0:1],k=a.args[e?1:0]));switch(a.op){case ",":c=e?a.args[0]:[a.args[0]];b&&"undefined"!=typeof a.args[1]&&(c=c.concat(f?a.args[1]:[a.args[1]]));break;case "()":b?
     207(c=e?a.args[0]:[a.args[0]],b&&a.args[1]&&(c=c.concat(f?a.args[1]:[a.args[1]]))):c=a.args[0];break;case "+":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(c)if(c=h,d)for(b=0;b<g.length;++b)c[b]+=g[b];else for(b=0;b<h.length;++b)c[b]+=k;else c=a.args[0]+a.args[1];break;case "*":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(c)if(c=h,d)for(b=0;b<g.length;++b)c[b]*=g[b];else for(b=0;b<h.length;++b)c[b]*=k;else c=a.args[0]*a.args[1];
     208break;case "-":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(c)if(d){c=a.args[0];for(b=0;b<g.length;++b)c[b]-=a.args[1][b];if(m)for(b=a.args[0].length;b<a.args[1].length;++b)c.push(-a.args[1][b]);else for(b=a.args[1].length;b<a.args[0].length;++b)c.push(a.args[0][b])}else if(e)for(c=a.args[0],b=0;b<a.args[0].length;++b)c[b]-=a.args[1];else for(c=[],b=0;b<a.args[1].length;++b)c.push(a.args[0]-a.args[1][b]);else c=a.args[0]-a.args[1];break;case "/":if(!b)return{_error:"operator : "+
     209a.op+" is binary and only has one argument"};if(c)if(d){c=a.args[0];for(b=0;b<g.length;++b)c[b]/=a.args[1][b];if(m)for(b=a.args[0].length;b<a.args[1].length;++b)c.push(0);else for(b=a.args[1].length;b<a.args[0].length;++b)c.push(a.args[0][b]/0)}else if(e)for(c=a.args[0],b=0;b<a.args[0].length;++b)c[b]/=a.args[1];else for(c=[],b=0;b<a.args[1].length;++b)c.push(a.args[0]/a.args[1][b]);else c=a.args[0]/a.args[1];break;case "^":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};
     210if(c)if(d){c=a.args[0];for(b=0;b<g.length;++b)c[b]=Math.pow(c[b],a.args[1][b]);if(m)for(b=a.args[0].length;b<a.args[1].length;++b)c.push(0);else for(b=a.args[1].length;b<a.args[0].length;++b)c.push(1)}else if(e)for(c=a.args[0],b=0;b<a.args[0].length;++b)c[b]=pow(c[b],a.args[1]);else for(c=[],b=0;b<a.args[1].length;++b)c.push(pow(a.args[0],a.args[1][b]));else c=Math.pow(a.args[0],a.args[1]);break;case "abs(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];
     211if(e)for(b=0;b<c.length;++b)c[b]=Math.abs(c[b]);else c=Math.abs(a.args[0]);break;case "acos(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.acos(c[b]);else c=Math.acos(a.args[0]);break;case "asin(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.asin(c[b]);else c=Math.asin(a.args[0]);break;case "atan(":if(b)return{_error:"operator : "+
     212a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.atan(c[b]);else c=Math.atan(a.args[0]);break;case "ceil(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.ceil(c[b]);else c=Math.ceil(a.args[0]);break;case "cos(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.cos(c[b]);else c=Math.cos(a.args[0]);
     213break;case "exp(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.exp(c[b]);else c=Math.exp(a.args[0]);break;case "floor(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.floor(c[b]);else c=Math.floor(a.args[0]);break;case "log(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=
     214Math.log(c[b]);else c=Math.log(a.args[0]);break;case "random(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.random();else c=Math.random();break;case "round(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.round(c[b]);else c=Math.round(a.args[0]);break;case "sin(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};
     215c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.sin(c[b]);else c=Math.sin(a.args[0]);break;case "sqrt(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.sqrt(c[b]);else c=Math.sqrt(a.args[0]);break;case "tan(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.tan(c[b]);else c=Math.tan(a.args[0]);break;case "max(":if(b)return{_error:"operator : "+
     216a.op+" has 2 arguments but only accepts one"};c=e?Math.max.apply(null,a.args[0]):a.args[0];break;case "min(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=e?Math.min.apply(null,a.args[0]):a.args[0];break;case "atan2(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!e)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};c=[];for(b=0;b<a.args[0].length;b+=2)c.push(Math.atan2(a.args[0][b],a.args[0][b+
     2171]));break;case "pow(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!e)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};c=[];for(b=0;b<a.args[0].length;b+=2)c.push(Math.pow(a.args[0][b],a.args[0][b+1]));1==c.length&&(c=c[0]);break;default:return{_error:"operator : "+a.op+" unknown or unsupported"}}return c};ga.bokeh={};ga.bokeh.data={};
     218ga.bokeh.getdata=function(a,c){var b={},e=c.split(/\r?\n/),f=e.length,d,g=0;for(d=0;d<f;++d)if(g||-1!==e[d].indexOf("var docs_json ="))if(!g)g=1,b.docs_json=$.parseJSON(e[d].replace(/^\s*var\s+docs_json\s+=\s+/,"").replace(/(^'|('|);$)/g,""));else if(1==g&&-1!==e[d].indexOf("var render_items =")){b.render_items=$.parseJSON(e[d].replace(/^\s*var\s+render_items\s+=\s+/,"").replace(/;$/,""));break}return b};
     219ga.bokeh.render=function(a,c,b){b=ga.bokeh.getdata(c,b);a+="_output";ga.bokeh.savedata(a,c,b);ga.bokeh.renderdata(a,c)};
     220ga.bokeh.renderdata=function(a,c){var b,e,f="";if(ga.bokeh.data[a]&&ga.bokeh.data[a][c]&&ga.bokeh.data[a][c].docs_json&&ga.bokeh.data[a][c].render_items){e=ga.bokeh.data[a][c].render_items.length;for(b=0;b<e;++b)f+='<div class="bk-root"><div class="bk-plotdiv" id="'+ga.bokeh.data[a][c].render_items[b].elementid+'"></div></div>';$("#"+c).html(f);Bokeh.embed.embed_items(ga.bokeh.data[a][c].docs_json,ga.bokeh.data[a][c].render_items)}};
     221ga.bokeh.savedata=function(a,c,b){ga.bokeh.data[a]=ga.bokeh.data[a]||{};ga.bokeh.data[a][c]=b};ga.bokeh.reset=function(a,c){ga.bokeh.data[a]&&ga.bokeh.data[a][c]&&(ga.bokeh.data[a][c]={},$("#"+c).empty())};ga.grid={};ga.grid.rc=function(a,c,b,e){var f="";a&&b&&a<b-1?f+="grid-row-start:"+a+";grid-row-end:"+b+";":a&&(f+="grid-row:"+a+";");c&&e&&c<e-1?f+="grid-column-start:"+c+";grid-column-end:"+e+";":c&&(f+="grid-column:"+c+";");return f};
     222ga.grid.rcs=function(a,c,b,e){return'style="'+ga.grid.rc(a,c,b,e)+'"'};ga.grid.drcs=function(a,c,b,e,f,d){f=(f||"")+ga.grid.rc(a,c,b,e);return d?'<div class="'+d+'" style="'+f+'">':'<div style="'+f+'">'};ga.grid.init=function(){return{row:0,col:1}};ga.grid.newrow=function(a){a.row++;a.col=1};
     223ga.grid.next=function(a,c,b,e){var f,d;a=a||{row:1,col:1};c?(a.col=c[0]?c[0]:a.col,f=c[1]?c[1]+a.col:a.col,a.row=c[2]?c[2]:a.row,d=c[3]?c[3]+a.row:a.row):(f=a.col,d=a.row);c=a.col;a.col=f+1;return ga.grid.drcs(a.row,c,d,f,b,e)};ga.grid.nextstyle=function(a,c,b){var e,f;b=b||"";a=a||{row:1,col:1};c?(a.col=c[0]?c[0]:a.col,e=c[1]?c[1]+a.col:a.col,a.row=c[2]?c[2]:a.row,f=c[3]?c[3]+a.row:a.row):(e=a.col,f=a.row);c=a.col;a.col=e+1;return ga.grid.rc(a.row,c,f,e,b)+b};ga.qr={};ga.qr.openq={};
     224ga.qr.question=function(a,c){var b="",e,f,d,g="",h="",m,k=[],r={},l,u;c._uuid||(g+="no _uuid in received data. ");c._msgid||(g+="no _msgid in received data. ");c._question||(g+="no _question in received data. ");c._question.fields||(g+="no _question:fields in received data. ");if(g.length)return ga.qr.rerror(c,g);c._question.title&&(b+="<h3>"+c._question.title+"</h3>");c._question.text&&(b+=c._question.text);m=c._uuid+"-"+c._msgid;if(c._question.grid){ga.grid.align=ga.grid.align||"left";d="display:grid;grid-gap:";
     225l=ga.grid.init();if("object"===typeof c._question.grid){c._question.grid.colwidths?"object"!==typeof c._question.grid.colwidths&&(g+=" _question:grid:colwidths specified, but it is not an array."):g+=" _question:grid specified, but it is not a number and colwidths not defined.";if(g.length)return ga.qr.rerror(c,g);d=c._question.grid.gap?d+c._question.grid.gap:d+"10px";d+=";grid-template-columns:";for(e=0;e<c._question.grid.colwidths.length;++e)d+=c._question.grid.colwidths[e]+"fr "}else for(d+="10px;grid-template-columns:auto ",
     2262>c._question.grid&&(c._question.grid=2),e=1;e<c._question.grid;++e)d+=" auto";b+='<form id="'+m+'" style="'+(d+";")+'">';for(e=row_start=0;e<c._question.fields.length;++e)if(d=c._question.fields[e],d.id||(g+="No id in field "+e+". "),/^[A-Za-z][A-Za-z0-9_]*$/.test(d.id)||(g+="Invalid id for field "+e+' with id value "'+d.id+'". Only alpha in first character and alphanumeric and underscores subsequently allowed.'),d.type||(g+="No type in field "+e+". "),d.id&&d.type)switch(u="text-align:"+(d.grid&&
     227d.grid.align?d.grid.align:ga.grid.align)+";",r[d.id]&&(g+="Duplicate id in _question fields:"+d.id+". "),r[d.id]=1,d.help?(f=' class="help_link"',help_span='<span class="help">'+d.help+"</span>"):help_span=f="",d.type){case "label":ga.grid.newrow(l);b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+"<label"+f+">";d.label&&(b+=d.label);b+="</label>"+help_span+"</div>";break;case "file":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");
     228b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="file" id="'+d.id+'" name="'+d.id+'[]"'+f;d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');b+=">"+help_span+"</div>";break;case "lrfile":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="file" id="'+d.id+'" name="'+d.id+'[]" data-add="'+d.id+'_altval"'+f;
     229d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');b+=">"+help_span+' or <button id="'+d.id+'_button" name="'+d.id+'_button" data-type="lrfile"'+f+'><span class="buttontext">Browse server</span></button>'+help_span+'<span id="'+d.id+'_altval"></span><input type="hidden" name="_selaltval_'+d.id+'" value="'+d.id+'_altval"</input></div>';h+='ga.altfile("'+m+'","'+d.id+'","'+d.id+'_altval" );$( "#'+m+'" ).change( function(){ $( "#'+d.id+'_altval" ).html( "<i>Local</i>: " + $( "#'+
     230d.id+'" ).val().replace(/^C:.fakepath./,""));});ga.altfile.button( "'+m+'","'+d.id+'","'+d.label+'","rfile",function(v){ga.altfile.button.lrfile(v,"'+m+'","'+d.id+'")}';d.required&&(h+=',"lrfile"');h+=");";h+='$("#'+d.id+'_button").on("click",function(){return ga.altfile.button.call("'+m+'","'+d.id+'");});';break;case "text":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+
     231'<input type="text" id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.maxlength&&(b+=' maxlength="'+d.maxlength+'"');d.size&&(b+=' size="'+d.size+'"');b+=">"+help_span+"</div>";break;case "integer":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,
     232u)+'<input type="number" id="'+d.id+'" step="1" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</div>";break;case "float":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="number" id="'+
     233d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d.required&&(b+=" required");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.step&&(b+=' step="'+d.step+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</div>";break;case "textarea":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?
     234d.grid.data:null,u)+'<textarea id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");b+=" readonly";d.fontfamily&&(b+=' style="font-family: '+d.fontfamily+';"');d.cols&&(b+=" cols="+d.cols);d.rows&&(b+=" rows="+d.rows);b+=">";d["default"]&&(b+=d["default"]);b+="</textarea>"+help_span+"</div>";break;case "checkbox":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="checkbox" id="'+
     235d.id+'" name="'+d.id+'"'+f;d.checked&&(b+=" checked");d.readonly&&(b+=" readonly");b+=">"+help_span+"</div>";break;case "listbox":ga.grid.newrow(l);if(d.header){d.label&&ga.grid.next(l,d.grid?d.grid.label:null);b+='<div style="';if(d.fontfamily||d.fontsize)d.fontfamily&&(b+="font-family:"+d.fontfamily+";"),d.fontsize&&(b+="font-size:"+d.fontsize+";");b+=ga.grid.nextstyle(l,d.grid?d.grid.data:null,u);b+='"';d.width&&(d.header=d.header.padEnd(d.width));d.header=d.header.replace(/ /g,"&nbsp;");b+=">"+
     236d.header+"</div>";ga.grid.newrow(l)}d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<select id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.fontfamily&&(b+=' style="font-family: '+d.fontfamily+';"');d.size&&(b+=" size="+d.size);d.multiple&&(b+=" multiple");b+=">";if(!d.values){g+="No values for listbox "+d.id+". ";break}if(d.returns){if(d.returns&&d.returns.length!=d.values.length){g+=
     237"Listbox values length ("+d.values.length+") does not equal return length ("+d.returns.length+") for listbox "+d.id+". ";break}for(f=0;f<d.values.length;++f)b+='<option value="'+d.returns[f]+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>"}else for(f=0;f<d.values.length;++f)b+='<option value="'+f+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>";d["default"]&&(h+='$("#'+d.id+" option[value='"+d["default"]+'\']").attr("selected", "true");');b+="</select>"+help_span+"</div>";break;default:g+="Unknown or currently unsupported field:type "+
     238d.type+". "}b+="</form>"}else{b+='<form id="'+m+'"><table>';for(e=0;e<c._question.fields.length;++e)if(d=c._question.fields[e],d.id||(g+="No id in field "+e+". "),/^[A-Za-z][A-Za-z0-9_]*$/.test(d.id)||(g+="Invalid id for field "+e+' with id value "'+d.id+'". Only alpha in first character and alphanumeric and underscores subsequently allowed.'),d.type||(g+="No type in field "+e+". "),d.id&&d.type)switch(r[d.id]&&(g+="Duplicate id in _question fields:"+d.id+". "),r[d.id]=1,d.help?(f=' class="help_link"',
     239l=' class="highlight help_link"',help_span='<span class="help">'+d.help+"</span>"):(f="",l=' class="highlight"',help_span=""),d.type){case "label":b+="<tr><td colspan=2><label"+f+">";d.label&&(b+=d.label);b+="</label>"+help_span+"</td></tr>";break;case "file":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="file" id="'+d.id+'" name="'+d.id+'[]"'+f;d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');
     240b+=">"+help_span+"</td></tr>";break;case "lrfile":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="file" id="'+d.id+'" name="'+d.id+'[]" data-add="'+d.id+'_altval"'+f;d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');b+=">"+help_span+' or <button id="'+d.id+'_button" name="'+d.id+'_button" data-type="lrfile"'+f+'><span class="buttontext">Browse server</span></button>'+help_span+'</td><td><span id="'+
     241d.id+'_altval"></td></span><input type="hidden" name="_selaltval_'+d.id+'" value="'+d.id+'_altval"</input></td></tr>';h+='ga.altfile("'+m+'","'+d.id+'","'+d.id+'_altval" );$( "#'+m+'" ).change( function(){ $( "#'+d.id+'_altval" ).html( "<i>Local</i>: " + $( "#'+d.id+'" ).val().replace(/^C:.fakepath./,""));});ga.altfile.button( "'+m+'","'+d.id+'","'+d.label+'","rfile",function(v){ga.altfile.button.lrfile(v,"'+m+'","'+d.id+'")}';d.required&&(h+=',"lrfile"');h+=");";h+='$("#'+d.id+'_button").on("click",function(){return ga.altfile.button.call("'+
     242m+'","'+d.id+'");});';break;case "text":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="text" id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.maxlength&&(b+=' maxlength="'+d.maxlength+'"');d.size&&(b+=' size="'+d.size+'"');b+=">"+help_span+"</td></tr>";break;case "integer":b+="<tr><td>";d.label&&(b+='<label for="'+
     243d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="number" id="'+d.id+'" step="1" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</td></tr>";break;case "float":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="number" id="'+d.id+'" name="'+
     244d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d.required&&(b+=" required");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.step&&(b+=' step="'+d.step+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</td></tr>";break;case "textarea":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><textarea id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");b+=
     245" readonly";d.fontfamily&&(b+=' style="font-family: '+d.fontfamily+';"');d.cols&&(b+=" cols="+d.cols);d.rows&&(b+=" rows="+d.rows);b+=">";d["default"]&&(b+=d["default"]);b+="</textarea>"+help_span+"</td></tr>";break;case "checkbox":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+l+">"+d.label+"</label>");b+='</td><td><input type="checkbox" id="'+d.id+'" name="'+d.id+'"'+f;d.checked&&(b+=" checked");d.readonly&&(b+=" readonly");b+=">"+help_span+"</td></tr>";break;case "listbox":if(d.header){b+=
     246"<tr><td colspan=2";if(d.fontfamily||d.fontsize)b+=' style="',d.fontfamily&&(b+="font-family:"+d.fontfamily+";"),d.fontsize&&(b+="font-size:"+d.fontsize+";"),b+='"';d.width&&(d.header=d.header.padEnd(d.width));d.header=d.header.replace(/ /g,"&nbsp;");b+=">"+d.header+"</td></tr>"}b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+l+">"+d.label+"</label>");b+="</td>";b=d.size&&1<d.size?b+"</tr><tr><td colspan=2>":b+"<td>";b+='<select id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.fontfamily&&
     247(b+=' style="font-family: '+d.fontfamily+';"');d.size&&(b+=" size="+d.size);d.multiple&&(b+=" multiple");b+=">";if(!d.values){g+="No values for listbox "+d.id+". ";break}if(d.returns){if(d.returns&&d.returns.length!=d.values.length){g+="Listbox values length ("+d.values.length+") does not equal return length ("+d.returns.length+") for listbox "+d.id+". ";break}for(f=0;f<d.values.length;++f)b+='<option value="'+d.returns[f]+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>"}else for(f=0;f<d.values.length;++f)b+=
     248'<option value="'+f+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>";d["default"]&&(h+='$("#'+d.id+" option[value='"+d["default"]+'\']").attr("selected", "true");');b+="</select>"+help_span+"</td></tr>";break;default:g+="Unknown or currently unsupported field:type "+d.type+". "}b+="</table></form>"}if(c._question.buttons&&c._question.buttons.length)for(e=0;e<c._question.buttons.length;++e)switch(d=c._question.buttons[e],typeof d){case "string":bid=d.replace(/\W/g,"").toLowerCase();r[bid]&&(g+="Duplicate id in _question fields & buttons:"+
     249bid+". ");r[bid]=1;k.push({id:bid,label:d,cb:ga.qr.cb,adata:[c,bid,d.skiprequired?0:1]});break;case "object":!d.id&&d.label&&(d.id=d.label.replace(/\W/g,"").toLowerCase());d.id?(r[d.id]&&(g+="Duplicate id in _question fields & buttons:"+d.id+". "),r[d.id]=1,d.id!=d.id.replace(/\W/g,"")&&(g+="Buttons array object entry "+(e+1)+" id is not pure alphanumeric. ")):g+="Buttons array object entry "+(e+1)+" does not have an id. ";d.label||(g+="Buttons array object entry "+(e+1)+" does not have a label. ");
     250if(!g.length){k.push({id:d.id,label:d.label,cb:ga.qr.cb,adata:[c,d.id,d.skiprequired?0:1]});d.help&&(k[k.length-1].help=d.help);break}break;default:g+="Buttons array entry "+(e+1)+" unknown type: "+typeof d+". "}else bid="ok",r[bid]&&(g+="Duplicate id in _question fields & buttons:"+bid+". "),r[bid]=1,bid="cancel",r[bid]&&(g+="Duplicate id in _question fields & buttons:"+bid+". "),r[bid]=1,k=[{id:"ok",label:"OK",cb:ga.qr.cb,adata:[c,"ok",1]},{id:"cancel",label:"Cancel",cb:ga.qr.cb,adata:[c,"cancel",
     2510]}];if(g.length)return ga.qr.rerror(c,g);ga.qr.openq[m]="open";ga.msg.box({icon:c._question.icon?c._question.icon:"question.png",noclose:1,closeif:1,text:b+"<p></p>",eval:'$("#'+m+'").on("keyup keypress", function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});'+h,buttons:k,ptext:"<p></p>"},0,2)};
     252ga.qr.cb=function(a,c,b){var e=a._uuid+"-"+a._msgid;if(ga.qr.openq[e])switch(ga.qr.openq[e]){case "open":break;case "answered":return ga.msg.box({icon:"information.png",text:"Question has already been answered in another session"}),delete ga.qr.openq[e],!0;case "timeout":return ga.msg.box({icon:"information.png",text:"The time for answering a question has expired"}),delete ga.qr.openq[e],!0;default:return ga.msg.box({icon:"toast.png",text:"Internal error, unknown message state"}),delete ga.qr.openq[e],
     253!0}else return ga.msg.box({icon:"warning.png",text:a._question.requiredmsg?a._question.requiredmsg:"Not all required fields have been entered."}),!0;if(b){var f=!1;$("#"+e+" *").filter(":input").each(function(){if(this.required){var a=!0;this.dataset&&"rfile_val"==this.dataset.type&&this.value.length&&(a=!1);if(a)switch(this.type){case "text":case "number":case "select-one":this.value.length||(f=!0);break;case "select-multiple":($("#"+this.id).val()||[]).length()||(f=!0);break;case "file":0==this.files.length&&
     254(f=!0)}}});if(f)return ga.msg.box({icon:"warning.png",text:a._question.requiredmsg?a._question.requiredmsg:"Not all required fields have been entered."}),!1}delete ga.qr.openq[e];var d={};d._uuid=a._uuid;d._msgid=parseFloat(a._msgid);d._response={};d._response.button=c;a._question&&a._question.id&&(d._response.id=a._question.id);var g=!1;$("#"+e+" *").filter(":input").each(function(){this.dataset&&"rfile_val"==this.dataset.type&&this.value.length&&(g=!0);switch(this.type){case "text":case "number":case "select-one":d._response[this.id]=
     255this.value;break;case "select-multiple":d._response[this.id]=$("#"+this.id).val()||[];break;case "checkbox":this.checked&&(d._response[this.id]=!0);break;case "file":0==this.files.length?this.remove():g=!0}});g?ga.qr.postfiles(e,d):ga.qr.post(d);return!0};ga.qr.answered=function(a,c){var b;c._uuid&&c._msgid&&(b=c._uuid+"-"+c._msgid,ga.qr.openq[b]&&(ga.qr.openq[b]="answered"))};ga.qr.timeout=function(a,c){var b;c._uuid&&c._msgid&&(b=c._uuid+"-"+c._msgid,ga.qr.openq[b]&&(ga.qr.openq[b]="timeout"))};
     256ga.qr.rerror=function(a,c){var b={};b._uuid=a._uuid;b._msgid=parseFloat(a._msgid);b._response={};b._response.error=c;a._question&&a._question.id&&(b._response.id=a._question.id);ga.qr.post(b);ga.msg.box({icon:"toast.png",text:c})};
     257ga.qr.post=function(a){$.ajax({url:ga.qr.url,data:{_window:window.name,_data:a},dataType:"json",method:"POST"}).success(function(a){a.error&&a.error.length&&ga.msg.box({icon:"toast.png",text:"ajax data error: "+a.error,buttons:[{id:"ok",label:"OK"}]})}).error(function(a){console.log("ajax error");console.dir(a);ga.msg.box({icon:"toast.png",text:"ajax error: "+a.statusText,buttons:[{id:"ok",label:"OK"}]})})};
     258ga.qr.postfiles=function(a,c){var b="#"+a+"_progress";ga.msg.box({icon:"information.png",noclose:1,text:'Uploading files:<progress id="'+a+'_progress"></progress>'});var e=new FormData($("#"+a)[0]);e.append("_window",window.name);e.append("_logon",$("#_state").data("_logon"));e.append("_uuid",c._uuid);$.ajax({dataType:"json",cache:!1,type:"POST",url:"ajax/sys/uploader.php",data:e,xhr:function(){var a=$.ajaxSettings.xhr();a.upload&&a.upload.addEventListener("progress",function(a){a.lengthComputable&&
     259$(b).attr({value:a.loaded,max:a.total})},!1);return a},contentType:!1,processData:!1}).success(function(b){ga.msg.close(3);if(b.error&&b.error.length)delete ga.qr.openq[a],ga.qr.rerror(c,"ajax data error: "+b.error);else{if(b.files)for(var d in b.files)b.files.hasOwnProperty(d)&&(c[d]=b.files[d]);ga.qr.post(c)}}).error(function(b){ga.msg.close(3);console.log("ajax error");console.dir(b);delete ga.qr.openq[a];ga.qr.rerror(c,"ajax error: "+b.statusText)})};ga.msg={};
     260ga.msg.box=function(a,c,b){b=b||3;if(!c&&$(".modalDialog"+b).hasClass("modalDialog"+b+"_on")){c=$("#_state").data("__msgs");if(!c||c&&"[object Array]"!=Object.prototype.toString.call(c))c=[];c.push(a);$("#_state").data("__msgs",c)}else{a.icon?$("#configbody"+b).html("<table style='width:95%;vertical-align:middle'><tr><td style='width:10%'><img src='pngs/"+a.icon+"' width=40px></td><td style='text-align:center'>"+a.text+"</td></tr></table>"):$("#configbody"+b).html("<center>"+a.text+"</center>");a.noclose?
     261$("#closeModal"+b).hasClass("close"+b)&&$("#closeModal"+b).removeClass("close"+b).empty():4>b&&!$("#closeModal"+b).hasClass("close"+b)&&$("#closeModal"+b).addClass("close"+b).html("X");if(a.buttons){tmp="<center><table><tr>";for(i=0;i<a.buttons.length;i++)tmp=a.buttons[i].help?tmp+'<td><button id="_mbb_'+a.buttons[i].id+'" class="help_link">'+a.buttons[i].label+'</button><span class="help">'+a.buttons[i].help+"</span></td>":tmp+'<td><button id="_mbb_'+a.buttons[i].id+'">'+a.buttons[i].label+"</button></td>";
     262tmp+="</tr></table><center>";$("#configbody"+b).append(tmp);for(i=0;i<a.buttons.length;i++)if(a.buttons[i].cb)if(a.buttons[i].adata)switch(a.buttons[i].adata.length){case 2:if(a.closeif)$("#_mbb_"+a.buttons[i].id).off().on("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1])&&ga.msg.close(b)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1]);ga.msg.close(b)});break;case 3:if(a.closeif)$("#_mbb_"+a.buttons[i].id).off().on("click",
     263a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2])&&ga.msg.close(b)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2]);ga.msg.close(b)});break;case 4:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2],a.data.adata[3]);ga.msg.close(b)});break;case 5:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],
     264function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2],a.data.adata[3],a.data.adata[4]);ga.msg.close(b)});break;case 6:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2],a.data.adata[3],a.data.adata[4],a.data.adata[5]);ga.msg.close(b)});break;default:console.warn("in ga.msg.box unsupported number of adata arguments "+a.buttons[i].adata.length)}else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],
     265function(a){a.data.cb(a.data.data);ga.msg.close(b)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){ga.msg.close(b)})}a.ptext&&$("#configbody"+b).append(a.ptext);a.eval&&eval(a.eval);ga.repeats.save();ga.hhelp.reset();$(".modalDialog"+b).addClass("modalDialog"+b+"_on")}};ga.msg.close1=function(){ga.repeats.restore();$(".modalDialog").removeClass("modalDialog_on");setTimeout(function(){$("#configbody").empty()},400);ga.usesplash&&setTimeout(function(){splashlogin()},500)};
     266ga.msg.close2=function(){ga.repeats.restore();$(".modalDialog2").removeClass("modalDialog2_on");$("#configbody2").empty();ga.usesplash&&setTimeout(function(){splashlogin()},500)};ga.msg.close3=function(){ga.repeats.restore();$(".modalDialog3").removeClass("modalDialog3_on");$("#configbody3").empty();var a=$("#_state").data("__msgs");if(a&&a.length){var c=a.shift();$("#_state").data("__msgs",a);ga.msg.box(c,1)}ga.usesplash&&setTimeout(function(){splashlogin()},500)};
     267ga.msg.close4=function(){ga.repeats.restore();$(".modalDialog4").removeClass("modalDialog4_on");$("#configbody4").empty();ga.frontpageurl&&!ga.apprun?ga.frontpage(ga.frontpageurl):(ga.apprun=0,ga.usesplash&&setTimeout(function(){splashlogin()},500))};ga.msg.close=function(a){switch(a){case 1:ga.msg.close1();break;case 2:ga.msg.close2();break;case 3:ga.msg.close3();break;case 4:ga.msg.close4();break;default:console_warn("ga.msg.close called with unknown modal number "+a)}};
     268ga.msg.clicks=function(){$("#closeModal").click(function(){ga.msg.close(1)});$("#closeModal2").click(function(){ga.msg.close(2)});$("#closeModal3").click(function(){ga.msg.close(3)});$("#closeModal4").click(function(){ga.msg.close(4)})};ga.ws={};ga.ws.subd=[];
     269ga.ws.set=function(){var a=$("#_state").data("_ws");if(a){var c=$("#_state").data("_wssession");c&&c.isOpen?console.log("ga.ws.set: connection is already open"):c=new ab.Session(a,function(){$(".wsstatus").css("color","green");ga.event("global","ws messaging","connection established");$("#_state").data("_wssession",c);ga.ws.sub("keepalive",ga.ws.alive,"keepalive")},function(){$(".wsstatus").css("color","red");if(0==gd.data("_unload"))return ga.ws.set();console.log("ws connection closed on unload of page")},
     270{skipSubprotocolCheck:!0,maxRetries:60,retryDelay:2E3})}else console.log("ga.ws.set: ws not defined")};ga.ws.alive=function(){};ga.ws.sub=function(a,c,b){b in ga.ws.subd&&ga.ws.unsub(ga.ws.subd[b],b);ga.ws.subd[b]=a;$("#_state").data("_ws")?(b=$("#_state").data("_wssession"))?b.subscribe(a,c):console.log("ga.ws.sub: connection is not open"):console.log("ga.ws.sub: ws not defined")};
     271ga.ws.unsub=function(a,c){if(c in ga.ws.subd)if(delete ga.ws.subd[c],$("#_state").data("_ws")){var b=$("#_state").data("_wssession");b?(b.unsubscribe(a),$("#_state").data("_wssub:"+a,null)):console.log("ga.ws.sub: connection is not open")}else console.log("ga.ws.sub: ws not defined")};ga.ws.generic=function(a,c){console.log("ga.ws.generic "+a+" : "+c.json)};
  • languages/html5/approvedeny-base.php

    r1363 r1598  
    4343    // check mongo
    4444    try {
    45         $m = new MongoClient();
     45        $m = new MongoClient(
     46             __~mongo:url{"__mongo:url__"}
     47             __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     48        );
    4649    } catch ( Exception $e ) {
    4750        $db_error = "Error connecting to the database. " . $e->getMessage();
  • languages/html5/base.php

    r1561 r1598  
    214214session_write_close();
    215215
     216if ( isset( $app_json->messaging->tcphostip ) &&
     217     isset( $app_json->messaging->tcpport ) ) {
     218    $_REQUEST[ '_tcphost' ] = $app_json->messaging->tcphostip;
     219    $_REQUEST[ '_tcpport' ] = $app_json->messaging->tcpport;
     220}
     221
    216222$_REQUEST[ '_udphost' ] =  $_SESSION[ $window ][ 'udphost' ];
    217223$_REQUEST[ '_udpport' ] =  $_SESSION[ $window ][ 'udpport' ];
     
    331337   if ( strlen( $cmdprefix ) > 1 ) {
    332338      $fileargs = 1;
     339      $cmdprefix = str_replace( "_" . "_application__", "__application__", $cmdprefix );
     340      $cmdprefix = str_replace( "_" . "_menu:id__", "__menu:id__", $cmdprefix );
     341      $cmdprefix = str_replace( "_" . "_menu:modules:id__", "__menu:modules:id__", $cmdprefix );
     342      $cmdprefix = str_replace( "_" . "_rundir__", $dir, $cmdprefix );
    333343   }
    334344}
     
    845855         $cmd .= " '$json'";
    846856      } else {
    847           if ( strlen( $cmdprefix ) ) {
    848               $register = "perl $adir/util/ga_regpid_udp.pl __application__ " .
    849                   $GLOBALS['resource'] . " " .
    850                   $_REQUEST[ '_udphost' ] . " " .
    851                   $_REQUEST[ '_udpport' ] . " " .
    852                   $_REQUEST[ '_uuid' ] . " " .
    853                   '$$';
    854 
    855               if ( isset( $bigargs ) ) {
    856                   $cmd = "$cmdprefix '$register;cd $dir;$cmd @$logdir/_args_" . $_REQUEST[ '_uuid' ] . "'";
     857          if ( substr( $cmdprefix, 0, 6 ) == "docker" ) {
     858              $cmd = "$cmdprefix '$json'";
     859          } else {
     860              if ( strlen( $cmdprefix ) ) {
     861                  $register = "perl $adir/util/ga_regpid_udp.pl __application__ " .
     862                      $GLOBALS['resource'] . " " .
     863                      $_REQUEST[ '_udphost' ] . " " .
     864                      $_REQUEST[ '_udpport' ] . " " .
     865                      $_REQUEST[ '_uuid' ] . " " .
     866                      '$$';
     867
     868                  if ( isset( $bigargs ) ) {
     869                      $cmd = "$cmdprefix '$register;cd $dir;$cmd @$logdir/_args_" . $_REQUEST[ '_uuid' ] . "'";
     870                  } else {
     871                      $cmd = "$cmdprefix '$register;cd $dir;$cmd \"\$(< $logdir/_args_" . $_REQUEST[ '_uuid' ] . ")\"'";
     872                  }                 
    857873              } else {
    858                   $cmd = "$cmdprefix '$register;cd $dir;$cmd \"\$(< $logdir/_args_" . $_REQUEST[ '_uuid' ] . ")\"'";
    859               }                 
    860           } else {
    861               if ( isset( $bigargs ) ) {
    862                   $cmd = "$cmd @$logdir/_args_" . $_REQUEST[ '_uuid' ];
    863               } else {
    864                   $cmd = "$cmd \"\$(< $logdir/_args_" . $_REQUEST[ '_uuid' ] . ")\"";
     874                  if ( isset( $bigargs ) ) {
     875                      $cmd = "$cmd @$logdir/_args_" . $_REQUEST[ '_uuid' ];
     876                  } else {
     877                      $cmd = "$cmd \"\$(< $logdir/_args_" . $_REQUEST[ '_uuid' ] . ")\"";
     878                  }
    865879              }
    866           }             
     880          }
    867881      }
    868882    } else {
  • languages/html5/base_footer.html

    r1363 r1598  
    3939        if ( ga.valuen.lastload && $( "#" + ga.valuen.lastload ).is( ":visible" ) ) { ga.valuen.save( ga.valuen.lastload ); }
    4040        ga.loader.show();
    41         $( "#panelmain" ).load( "ajax/" + myTag + ".html", function(){ resetHoverHelp(); ga.loader.hide(); } );
     41        $( "#panelmain" ).load( "ajax/" + myTag + ".html", function(){ ga.hhelp.reset(); ga.loader.hide(); } );
    4242__~docsbaseurl{        $( "#tab_docs > a" ).attr( "href", "__docsbaseurl__/" + myTag + "/" + myTag + ".html" );}
    4343        if ( !ga.set.data[ "nohidemenu:" + myTag ] ) { $( "#menuspan" ).trigger( "click" ); };
     
    9090       $( "#global_data" ).data( "hoverhelp", 0 );
    9191   }
    92    setHoverHelp();
     92   ga.hhelp.set();
    9393});
    9494$( "#global_data" ).data( "hoverhelp", 1 );
    95 setHoverHelp();
     95ga.hhelp.set();
    9696
    9797$( "#config" ).click( function() {
     
    110110});
    111111
    112 function closeModal()
    113 {
    114    ga.repeats.restore();
    115    $( ".modalDialog" ).removeClass( "modalDialog_on" );
    116    setTimeout(function(){
    117        $( "#configbody" ).html( "" );
    118    }, 400);
    119    __~usesplash{setTimeout(function() { splashlogin() }, 500 );}
    120 }
    121 
    122 $( "#closeModal" ).click( function() {
    123    closeModal();
    124 });
    125 
    126 function closeModal2()
    127 {
    128    ga.repeats.restore();
    129    $( ".modalDialog2" ).removeClass( "modalDialog2_on" );
    130    setTimeout(function(){
    131        $( "#configbody2" ).html( "" );
    132    }, 400);
    133    __~usesplash{setTimeout(function() { splashlogin() }, 500 );}
    134 }
    135 
    136 $( "#closeModal2" ).click( function() {
    137    closeModal2();
    138 });
    139 
    140 function closeModal3()
    141 {
    142    ga.repeats.restore();
    143    $( ".modalDialog3" ).removeClass( "modalDialog3_on" );
    144    $( "#configbody3" ).html( "" );
    145    var ws = $( "#_state" ).data( "__msgs" );
    146    if ( ws && ws.length )
    147    {
    148 __~debug:msg{       console.log( "popping message" );}
    149        var m = ws.shift();
    150        $( "#_state" ).data( "__msgs", ws );
    151        messagebox( m, 1 );
    152    }
    153    __~usesplash{setTimeout(function() { splashlogin() }, 500 );}
    154 }
    155 
    156 $( "#closeModal3" ).click( function() {
    157    closeModal3();
    158 });
    159 
    160 function closeModal4()
    161 {
    162    ga.repeats.restore();
    163    $( ".modalDialog4" ).removeClass( "modalDialog4_on" );
    164    $( "#configbody4" ).html( "" );
    165    __~frontpage:url{if ( !ga.apprun ) { ga.frontpage( "__frontpage:url__" ); } else }
    166    {
    167        ga.apprun = 0;
    168        __~usesplash{setTimeout(function() { splashlogin() }, 500 );}
    169    }
    170 }
    171 
    172 $( "#closeModal4" ).click( function() {
    173    closeModal4();
    174 });
    175 
    176 function closeaModal( mnum ) {
    177     switch( mnum ) {
    178         case 1 : closeModal(); break;
    179         case 2 : closeModal2(); break;
    180         case 3 : closeModal3(); break;
    181         case 4 : closeModal4(); break;
    182         default : console_warn( "closeaModal called with unknown modal number " + mnum ); break;
    183     }
    184 }
     112ga.msg.clicks();
    185113
    186114$( "#tab_feedback" ).click( function() {
     
    206134
    207135
    208      __~register:globuslogin{ function my_globus_call(code) {$.ajax({ type: 'POST', data: {'register':code}, url:'util/globusoauth.php', cache: false }).done( function(data){window.location.href = data;      }).fail( function(){ messagebox( { icon: "toast.png", text: "There was an error, Globus!", buttons : [ { id : "ok", label : "OK" } ] });  return; }); } }
     136     __~register:globuslogin{ function my_globus_call(code) {$.ajax({ type: 'POST', data: {'register':code}, url:'util/globusoauth.php', cache: false }).done( function(data){window.location.href = data;      }).fail( function(){ ga.msg.box( { icon: "toast.png", text: "There was an error, Globus!", buttons : [ { id : "ok", label : "OK" } ] });  return; }); } }
    209137   
    210    __~register:googlelogin{  function my_google_call(code) { $.ajax({ type: 'POST', data: {'register':code}, url:'util/googleoauth.php', cache: false }).done( function(data){  window.location.href = data; }).fail ( function(){  messagebox( { icon: "toast.png", text: "There was an error, Google!", buttons : [ { id : "ok", label : "OK" } ] });  return; });  } }
     138   __~register:googlelogin{  function my_google_call(code) { $.ajax({ type: 'POST', data: {'register':code}, url:'util/googleoauth.php', cache: false }).done( function(data){  window.location.href = data; }).fail ( function(){  ga.msg.box( { icon: "toast.png", text: "There was an error, Google!", buttons : [ { id : "ok", label : "OK" } ] });  return; });  } }
    211139
    212140
    213141__~register:globuslogin{ if ( ga.urlparams("weloggedinglobus") ) { var username_globus = ga.urlparams("username_split"); var email_globus = ga.urlparams("email"); if ( ga.urlparams("register") ) { $( "#configbody" ).load( "etc/sys_register_globus.html" ); $( ".modalDialog" ).addClass( "modalDialog_on" ); window.history.replaceState( {}, "__title__ __version__", "/__application__/" );  } else { $( "#configbody" ).load( "etc/sys_login_globus.html" ); $( ".modalDialog" ).addClass( "modalDialog_on" );  window.history.replaceState( {}, "__title__ __version__", "/__application__/" ); } } }
    214142
    215 __~register:globuslogin{ if ( ga.urlparams("sourcefailed") ) { messagebox( { icon: "toast.png", text: "Invalid source of registration! <br> Please use allowed Globus credentials to register/login" } );} }
     143__~register:globuslogin{ if ( ga.urlparams("sourcefailed") ) { ga.msg.box( { icon: "toast.png", text: "Invalid source of registration! <br> Please use allowed Globus credentials to register/login" } );} }
    216144
    217145
     
    258186   $( ".modalDialog" ).addClass( "modalDialog_on" );
    259187});
    260 
    261 function messagebox( m, force, mnum )
    262 {
    263    mnum = mnum || 3;
    264 
    265    if ( !force )
    266    {
    267       if ( $( ".modalDialog" + mnum ).hasClass( "modalDialog" + mnum + "_on" ) )
    268       {
    269           var ws = $( "#_state" ).data( "__msgs" );
    270           if ( !ws || (ws && ( Object.prototype.toString.call( ws ) != '[object Array]' ) ) )
    271           {
    272              ws = [];
    273           }
    274           ws.push( m );
    275           $( "#_state" ).data( "__msgs",  ws );
    276           return;
    277       }
    278    }
    279    if ( m.icon )
    280    {
    281       $( "#configbody" + mnum ).html( "<table style='width:95%;vertical-align:middle'><tr><td style='width:10%'><img src='pngs/" + m.icon + "' width=40px></td><td style='text-align:center'>" + m.text + "</td></tr></table>" );
    282    } else {
    283       $( "#configbody" + mnum ).html( "<center>" + m.text + "</center>" );
    284    }
    285 
    286    if ( m.buttons ) {
    287       tmp = "<center><table><tr>";
    288       for ( i = 0; i < m.buttons.length; i++ ) {
    289           tmp = tmp + '<td><button id="_mbb_' + m.buttons[ i ].id + '">' + m.buttons[ i ].label + '</button></td>';
    290       }
    291       tmp = tmp + "</tr></table><center>";
    292 __~debug:mb{      console.log( 'm buttons' + tmp );}
    293       $( "#configbody" + mnum ).append( tmp );
    294       for ( i = 0; i < m.buttons.length; i++ ) {
    295           if ( m.buttons[ i ].cb ) {
    296               if ( m.buttons[ i ].adata ) {
    297                   switch( m.buttons[ i ].adata.length ) {
    298                   case 2 :
    299                       $( "#_mbb_" + m.buttons[ i ].id ).off().one( "click" , m.buttons[ i ], function( event ) { event.data.cb( event.data.adata[ 0 ], event.data.adata[ 1 ] ); closeaModal( mnum ); } );
    300                       break;
    301                   case 3 :
    302                       $( "#_mbb_" + m.buttons[ i ].id ).off().one( "click" , m.buttons[ i ], function( event ) { event.data.cb( event.data.adata[ 0 ], event.data.adata[ 1 ],  event.data.adata[ 2 ]  ); closeaModal( mnum ); } );
    303                       break;
    304                   case 4 :
    305                       $( "#_mbb_" + m.buttons[ i ].id ).off().one( "click" , m.buttons[ i ], function( event ) { event.data.cb( event.data.adata[ 0 ], event.data.adata[ 1 ],  event.data.adata[ 2 ], event.data.adata[ 3 ] ); closeaModal( mnum ); } );
    306                       break;
    307                   case 5 :
    308                       $( "#_mbb_" + m.buttons[ i ].id ).off().one( "click" , m.buttons[ i ], function( event ) { event.data.cb( event.data.adata[ 0 ], event.data.adata[ 1 ],  event.data.adata[ 2 ], event.data.adata[ 3 ],  event.data.adata[ 4 ] ); closeaModal( mnum ); } )
    309                       break;
    310                   case 6 :
    311                       $( "#_mbb_" + m.buttons[ i ].id ).off().one( "click" , m.buttons[ i ], function( event ) { event.data.cb( event.data.adata[ 0 ], event.data.adata[ 1 ],  event.data.adata[ 2 ], event.data.adata[ 3 ],  event.data.adata[ 4 ], event.data.adata[ 5 ] ); closeaModal( mnum ); } )
    312                       break;
    313                   default :
    314                       console.warn( "in message box unsupported number of adata arguments " + m.buttons[ i ].adata.length )
    315                       break;
    316                   }
    317               } else {
    318                   $( "#_mbb_" + m.buttons[ i ].id ).off().one( "click" , m.buttons[ i ], function( event ) { __~debug:fc{console.log( "you callback clicked " + event.data.label );} event.data.cb( event.data.data ); closeaModal( mnum ); } );
    319               }
    320           } else {
    321               $( "#_mbb_" + m.buttons[ i ].id ).off().one( "click" , m.buttons[ i ], function( event ) { __~debug:fc{console.log( "you clicked " + event.data.label );} closeaModal( mnum ); } );
    322           }
    323       }
    324    }     
    325    if ( m.ptext ) {
    326       $( "#configbody" + mnum ).append( m.ptext );
    327    }
    328    if ( m.eval ) {
    329       eval( m.eval );
    330    }
    331    ga.repeats.save();
    332    $( ".modalDialog" + mnum ).addClass( "modalDialog" + mnum + "_on" );
    333 }
    334188
    335189function syncState() {
     
    370224          }
    371225
    372           $( "#login" ).html( "" );
     226          $( "#login" ).empty();
    373227          $( "#logoff" ).html( "Logoff " + l );
    374228          $( "#files" ).show();
    375229          $( "#jobs" ).show();
    376 //          $( "#register" ).html( "" );
     230//          $( "#register" ).empty();
    377231//          $( "#userconfig" ).html( "<img src=\"etc/config.png\" width=40px id=\"config\" class=\"config\">" );
    378232          ga.license.get();
     
    384238          }
    385239          $( "#login" ).html( "Login" );
    386           $( "#logoff" ).html( "" );
    387           $( "#sel_project" ).html( "" );
     240          $( "#logoff" ).empty();
     241          $( "#sel_project" ).empty();
    388242          $( "#files" ).hide();
    389243          $( "#jobs" ).hide();
     
    408262        ga.jc.clear( "#" );
    409263        ga.valuen.reset();
    410         $( "#panelmain" ).html( "" );
    411         $( "#seabug" ).html( "" );
     264        $( "#panelmain" ).empty();
     265        $( "#seabug" ).empty();
    412266        if ( !$( ".sidebar" ).is(':visible') ) {
    413267            $( "#menuspan" ).trigger( "click" );
    414268        }
    415269        $( "#global_data" ).data( "hoverhelp", 1 );
    416         resetHoverHelp();
     270        ga.hhelp.reset();
    417271        if ( hiderestricted ) {
    418272          ga.restricted.hideall();
     
    456310              !/^[a-zA-Z0-9_\-\.]+$/.test( sw[0] + sw[1] + sw[2] + sw[3] ) ) {
    457311             console.warn( "bad switch: '" + sw[0] + sw[1] + sw[2] + sw[3] + "'" );
    458              messagebox( { icon: "toast.png", text: "Invalid switch parameters" } );
     312             ga.msg.box( { icon: "toast.png", text: "Invalid switch parameters" } );
    459313         } else {
    460314__~debug:switch{         console.log( "switch to " + sw[0] + " module " + sw[1] + " project " + sw[2] + " id " + sw[3] );}
     
    481335               $( "#panel_" + sw[ 0 ] ).load( "ajax/" + sw[0] + "/" + sw[1] + ".html",
    482336                   function(){
    483 __~debug:job{            console.log( "now to eval: subMsging( '" + sw[3] + "', msg_" + sw[1] + ",'" + sw[1] + "');get_results_" + sw[1] + "('" + sw[3] + "',0,1,1);" );}
    484                        ga.trytilltrue( "typeof loaded_" + sw[1] + " === 'number'", sw[ 1 ] + "_reset(); subMsging('" + sw[3] + "', msg_" + sw[1] + ",'" + sw[1] + "');get_results_" + sw[1] + "('" + sw[3] + "',0,1,1);", 20, 200 );
     337__~debug:job{            console.log( "now to eval: ga.ws.sub( '" + sw[3] + "', msg_" + sw[1] + ",'" + sw[1] + "');get_results_" + sw[1] + "('" + sw[3] + "',0,1,1);" );}
     338                       ga.trytilltrue( "typeof loaded_" + sw[1] + " === 'number'", sw[ 1 ] + "_reset(); ga.ws.sub('" + sw[3] + "', msg_" + sw[1] + ",'" + sw[1] + "');get_results_" + sw[1] + "('" + sw[3] + "',0,1,1);", 20, 200 );
    485339                   });
    486340                });
     
    499353          $( "#sel_project" ).html( "Project " + p );
    500354      } else {
    501           $( "#sel_project" ).html( "" );
     355          $( "#sel_project" ).empty();
    502356      }
    503357      s.data( '_project:last', p );
     
    506360   var m = s.data( '_message' );
    507361   if ( m ) {
    508        messagebox( m );
     362       ga.msg.box( m );
    509363       s.removeData( '_message' );
    510364   }
     
    564418}
    565419if ( "_message" in data ) {
    566     messagebox( data[ "_message" ] );
     420    ga.msg.box( data[ "_message" ] );
    567421}
    568422syncState();
     
    573427
    574428ga.fc.delete_warn_delete = function( ids ) {
    575     messagebox( {
     429    ga.msg.box( {
    576430                   icon  : "warning.png",
    577431                   text  : ga.fc.delete_node_message( ids ),
     
    591445
    592446ga.fc.delete_error_msg = function( ids, text ) {
    593     messagebox( {
     447    ga.msg.box( {
    594448                   icon : "warning.png",
    595449                   text : text,
     
    601455
    602456ga.fc.ajax_error_msg = function( text ) {
    603     messagebox( {
     457    ga.msg.box( {
    604458                   icon : "toast.png",
    605459                   text : text,
     
    640494        !$( ".modalDialog3" ).hasClass( "modalDialog3_on" )
    641495       ) {
    642         messagebox( {
     496        ga.msg.box( {
    643497            text :
    644498            '<h2>__title__ __version__</h2>' +
     
    678532                '$( ".modalDialog" ).addClass( "modalDialog_on" );' +
    679533                '$( ".modalDialog4" ).removeClass( "modalDialog4_on" );' +
    680                 '$( "#configbody4" ).html( "" );' +
     534                '$( "#configbody4" ).empty();' +
    681535                '});' +
    682536            '$( "#splash_register" ).click( function() {' +
     
    686540                '$( ".modalDialog" ).addClass( "modalDialog_on" );' +
    687541                '$( ".modalDialog4" ).removeClass( "modalDialog4_on" );' +
    688                 '$( "#configbody4" ).html( "" );' +
     542                '$( "#configbody4" ).empty();' +
    689543            '});'
    690544            __~register:googlelogin{ + '$( "#splash_login_google" ).click( function() { my_google_call();});' }
     
    721575$( '.helpwsstatus' ).css( "bottom", ga.tmp.ftr.org ).css( "bottom", "+=3px" );
    722576ga.tmp.ftr = {};
    723 resetHoverHelp();</script>
     577ga.hhelp.reset();</script>
    724578</body>
    725579</html>
  • languages/html5/base_header.html

    r1363 r1598  
    443443}
    444444
    445 document
    446 
    447     margin: 0; 
    448     padding: 0; 
    449     cursor: none;
    450 
    451 
    452 
    453 body {
    454 background: rgb( __background_color_rgb__ );
    455 color: rgb( __text_color_rgb__ );
    456 __~footersize{margin-bottom: __footersize__;}
    457 }
    458 __~style:backgroundimage{body {  background: url(__style:backgroundimage__) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;}}
    459 
    460 #splash td, #splash div {
    461     text-align: center;
    462 }
    463 
    464 #splash td {
    465     font-size: .85em;
    466 }
    467 
    468 #splash img {
    469     display: block;
    470     margin-left: auto;
    471     margin-right: auto;
    472     margin-bottom: 10px; 
    473 }
    474 
    475 .splashsmall {
    476     font-size: .65em;
    477     text-align: center;
    478     font-style: italic;
    479 }
    480 
    481 textarea {
    482 __~color:textarea{  color: rgb( __color:textarea__ );}
    483 __~color:textarea_bg{  background: rgb( __color:textarea_bg__ );}
    484 }
    485 
    486 .title {
    487   text-decoration: none;
    488   outline: 0;
    489 }
    490 
    491 .title:link {
    492   color: rgb( __text_color_rgb__ );
    493 }
    494 
    495 .title:visited {
    496   color: rgb( __text_color_rgb__ );
    497 }
    498 
    499 .title:active {
    500   color: rgb( __text_color_rgb__ );
    501 }
    502 
    503 .title:hover {
    504    color: rgb( __select_color_rgb__ ); 
    505 }
    506 
    507 .pagetitle {
    508    z-index: -1;
    509 }
    510 
    511 .opacity {
    512 opacity: 0.7;
    513 filter: alpha(opacity=70);
    514 -webkit-transition: opacity 1s linear;
    515 }
    516 
    517 .opacity:hover {
    518 opacity: 1;
    519 filter: alpha(opacity=100);
    520 -webkit-transition: opacity 1s linear;
    521 }
    522 
    523 td {
    524    padding-top:  0;
    525    padding-left: 0;
    526    padding-bottom: 0;
    527 }
    528 
    529 table {
    530     border-collapse: collapse;
    531 }
    532 
    533 
    534 .padcell td {
    535    padding-left: 5px;
    536    padding-right: 5px;
    537    text-align : center;
    538 }
    539 
    540 .padcell th {
    541    padding-left: 5px;
    542    padding-right: 5px;
    543    text-align : center;
    544 }
    545 
    546 __~footersize{footer { position: fixed; left: 0; bottom: 0; height: __footersize__; width: 100%; background: rgb( __background_color_rgb__ ); z-index:50;}}
    547 .logo { position: fixed; bottom: 0px; right: 0; z-index:51;}
    548 .wsstatus { position: fixed; right: 30px; color:red; z-index:51 }
    549 .helpwsstatus {
    550     position:fixed;
    551     right:10px;
    552     min-width: 20em;
    553 }
    554 
    555 #tab_feedback {
    556      position: fixed;
    557      right: 0;
    558      top: 200px;
    559      display: block;
    560      width: 25px;
    561      height: 102px;
    562      text-indent: -10000px;
    563      background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAABmCAYAAAA+nTp3AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAANGUlEQVRo3q2ae4xc1X3HP99z7p2ZfeEXXi8G87SdlPDIU8hJadU0aVqh0lZNWgpOUoKd3S00AaIktIn6iCIlRWkBh+JZTGwgVquKPsIfVBGqQIqFQNCYFGhCoOERwN6n37s7e+fe8+sf987u7HpmvQs+0qzmzp5zvuf3O7/z/T3OhdPcLtxjs9/P32OlNXfbh3Q6AbrvNU58Xtz9ium7T3DhoSmutcDZpw1k427j/z4n2GOda2t8TeJDztGTBv7nHYG8a7fx88/NTbFxt336RMIfm7jAGZP1QF2O/dFyJz5/l/Ha9nzijd342pBdVIq5bqrOdVMJKwTHzZjKwDtRMyNeFsh5984BnDdkV+w/wm8o8Nl6whkGmaAGhKYhAmxJ6tq823ipUMsF99nlM4FtFnifPCtDoIQgy+iIHRaMxGDaIMGYMnhhyXtyyf127niN24ArTCDDA7EgNuEdOITLjLqM6dAE0lJdl+w2XihW3le1DWXPZ8amuNocFot6asTLUfNJIOfvMV64XvzRQ1bad4QtZtwwnbFZjsQJlxpxrul3APLa9bkET01wczCuJKIkY1IOb0a0zPnng/TtNIYHxeqqnRl57qolrEmFysICmOWW0q4tiusAzv9eDrB+p/XJ2BEZkUEaO6gHDkmU2owXMA68wiKLcL07jdduEJfstd5MfD0W3UlG2XvsnB6OJQnfDnDMC5lIBQ5DuYFhCdxWcfwXubW1BhkdFBvvt9Kbh9nuPb2ZUZewqTqV4wmVYzfpOYkd9UDdjCgYAUNmlDG2TQzoRzEIy7XSVl1vHeLSiuOiEAhOCFBHTO3oDBWAkX49KnjAQSYhHCETgyODenLV3eaPB9bhSNura8g6VnbzSR8VplnQgHIdZ2uH7Btrh6xjdEAPGjwITGN8e2xAjwOUPH8G/AHz6WQ+SNmz0kR3YnO9FFCWEQHBwRYHX1i70+LRAd0b4ItZxr8DrKval5z4wqmsKzo8Q6knZoU0q1NFjjQJxMXgyIyrJWrAXaMDehagr2pfBm6gxVk7CaQr5rNJRih7SMktJIBCvmGxwbckKkDX2qqtGBvQ0TVDtlbGLwz+lpx9fw/41bYgEj9HbGz+0XJpMiAe7dejCwdN9GsMcpUBnDVkFwBXtlNblGRs8aIWjMqC4xTMsDPvsQ/Gjq4MJHACFSws8jMTDDZrkX2JLDAuz/om2rAsEJmI39vLgaeHuROYqnh8EnDO6LaAJFwGcalEQkZXyDB8a+p0pYSfGnQWKwOQd2RJwL10iDM7I96KHa/XUjCjIxiWbxeRxBtpykSWIVSMF8YCinHFZz66QZcnqWWUUuOONOHL3jHuwFQoyaAs2DU6wifM8VwxecvWigosGD6zXP+HZ9jvIj4MrFvQbwZje/grGTlBumKBWgoIAcyLDLDsi0qALjjJG1oDWDDZ9PtJ+9KW1GYn+g9zwEFguknXEpQNflw8dyw2yWIgCsC6ES4XPAH8i8ExoAtDBvsE31i307rNOBeWtyeNYMk2reRIalwzPCCTsQfYavAJ4KoAtwwP6E3gPaWI9wqy5YDIC6sF/IFJSmnGlrN22bXBUB3GRgb05gnjQNkxtWanbShH/EOtTnfIKLcDaUluBsQO0kCpo8xkyBiUuCKGJ/qqNmbQWQ+8L3ZcW8uoeJEppyG/ZBAnzEFWz/LATZAgPijj14AI4WV4M0oOEhPHBWuWoy6rB1w9zJpsw/JT8lh3hpy/3kB8K0vZIniknRTtJJETIfLUiwMZmyGJFJgxeBHj+8MDeqYx4Kwha+t624GYgc8yHMKbGJd4xWB/gB+ND2i00fHMe2xV5Hi/wWXKHauWCiKX770MYoxbgxgb61e90WFt1TafqPCyr/H7wNcFMWrv41tbl6FNq5n42WE2HxrUgcbv66r2eRnXBuNVTXHjak/HIaiUYHo2Rl6qulIjevUoa0puHicxfZz7O7o4jNgUe8JUSiUVpbJjZjHuaClJnG96yURYN2TbMJ4PxvNjg5o6Bg81+nVU7ZkSPFoXlwt62oG0xp+j6wBsBf5aYte6qt3SW7XZeGB4QPsyY5vghyzXhMk33ooALwU6BSsFGyWu663aKxIPhnfzyOiva3r9kB2dt8SlqKu5sxlIs7GuyK3vYoyq/ymTfVX7PnDe7OTCFjquqM3kApzl7tZjHAOGgbMF5wb4ieApiW7LY64Lme9vlqcug5cEf2P5JBUztgbjn8cG9RZfNfou4DGDnYK1cLIU7Tce8Mp9fUi5b2RAB53nGDAyMqDvlOBAb9Xic96DC8Zzgv9ukmJJ7teygD+nh6NmdIwfZH/vkG0Iga+YcVWhz98Enifjm6ODqlnGWCsJFpVEgl8eY5V3TPNNZWZ8BOMaxNcKkHc5ICRcTW4JyWIZZTt/Egy8zT2XMUqiyB3zHLLHrHC5OkXqwBLaSL8eAB4A6KuaDg7oDuCOpYxtp67GxgW1MMnhAbVa9fL9SQPMIF03ZH+BUQIiUfiY3Jl5zan0Mlge1atAys+J8TGJCKMDKJNHko0YunFonZYbdxno/DOYNIMs4GWcAL5Xh48P9+viNOUy4CaDF53HYr0NdWUB99YJOlIjrsRMePF3b2zT040OEzcpAR69+SF7fO8Yu+T4LRz15YDgHSEz4tgzkwb2HejX02uqtiqCTws2GpwQPHTnp/Ts+qrdbuISoJd26VyrH0XOvgZe4odrdlqnh7sEmxFxwcifXLvTrgnwMwcvkLNAS5DFAm4DNCl+4R0fVk7nzSadebhteEDTwCgsk1ZoYuET21VXrooV5Ce+RG5lEbnpQs7Q8wafUl00+ZPi+VXg4WJ8w3y9NLv6WeuSclUvBWReG+nXk8CTS+nbqrU8jAIrRyS1jAp/b529XXQaWMnhsmw26te0YSs7qc/U6Jg97rY0EEsNtzomOZYQ9XZzeyzi1PBZoFyoyc0E/IoK9aOTdHeI9YiA5ny3nQIEDB2doVKOmDLj8nrAGzgHTiIywztHPJ3gBKtMTC83xcY7QhpwIS/5fUdinyvUiJhEJMoreObFLQGeZr4J65QgTUtyI/16mCYfPtyvKwVV8mAuGx7QPwE/YbnnxAyCYbKCvvOqSdow6Sw/K5kVyaiBJy+HtCyutLSu2JFJkFh72mn+Oq+YkqPYqUCsllGSQ7+ymmNj+ZJrkZjIGos0phETDR/SHZFM19vfYbSUpOyo1wMdvzxOJ8D4oH4A/ABgbdU0OqD7gfsbA5KUKOQl9norG2tXW3FyhHp28u3CWAsfn0KiomR7Uh2KRWjF5RFk1jtkDyvf+KgIi7wVKTb5/UkUoOJyI2i56FNxlwHdxeI8uVVFxXdH7u8rsFhot0gE6YQhJNgLPNfU9wWMceasdYdyp7Xsc2LBACMa6dce8iqRB1QW2w0eLZ6zgwO6C3iqMZe0RBBAEsHN8dFsqvZ6v1Lmimha+P+lq8sRQiDavJrxxuqKq42s2Ckn8KEY3x2RENq78nYsTGa4lw/lRRmD8STwvJtb+UHgxypAZzKiBgtbI6lbALLQ7i0LxF6ErEErxr5IPDMXwPKfBo81TkzdcGqi+pP8SRbR4+bzjXCEBaqsG3nw1lc1ZyLBSJifXS3QRRPIjPhAJyRh7tYB5RmvMT/gdsw/IwKis6om4FIWK+CUPK+mxqUloUYR0eeu1AXDDH63yauWChBfAMbkNxOm1oySW5dgxDX5g2JPfJZbiydPfvaT00adPOYSkDR95qUNCzfZlSP6nJiuz118yQsrzohG+zUE7CsANTygi4OxA1pfzUqzV1VzIOM1Hk4yVjSJamle97WVFWrFrqoADcVz3Ijh5EjdSW5qgSSrYw5E4oDTbKgpJ0I9pVzxRWQolAXcgtgqL4YUFQUtdgXYk1GLp3nSQ48My1TcBHnSkcm8vGSGlyg7cieGiAwqMjotoyeD2HKzbxzGeXIJ4IK9tmbyMF9RifMyiBXwTkRAeWRAH28esK5qGlnguM4asq8KbkRYq/t4t+E+49WtmoiNf1tM5EYbaZ39LupPZv+5da/pkSN8zHv+UhETyoi9KKXGs4JYwmHEAmfCFQtqZMSbBBsQaiWJANb/o3Hgxhyv67v20UrErZGjHowuctv11t79nvL1BQfMAlR2GJN/rse8qHpRywI4IVskR19Ka6vL8+6zTfXAnySBq2JxIuQ3eSXn8MbbkGRh27DLeH2bXq6UuB24NQ3IjMi7Wad1eiRZ2M7eZXceT9jSHaHM8pLHO5KkuW3cbcQ7jLe26+aNZ/CZAI87UUM55RdJZGhchs79eRuSvHuP8eL1s6/4fMSM3w7iysy4CEgNnMvR6kAtGDPLfgNnYXv/LisfMVZMGn/oHIMEzvQiS/PJTz4n77Rd+a+26vUjfCozbkozOpW/SzRjgWkT//uOQS7dazy/dW6avqr9aQq/Ezk2WeBEMF4+ra/DNVrHHdZzRicfyAJfMuOV0w6y8m7jyE35tKvusTMCXPj/5fb1g1j+7BcAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDUtMTJUMTI6MDQ6MTItMDU6MDBBdj1KAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA1LTEyVDEyOjA0OjEyLTA1OjAwMCuF9gAAAABJRU5ErkJggg==);
    564      opacity: 0.7;
    565      filter: alpha(opacity=70);
    566      -webkit-transition: opacity 1s linear;
    567      overflow: hidden;
    568      z-index: 5;
    569 }
    570 
    571 #tab_feedback:hover {
    572     opacity: 1;
    573     filter: alpha(opacity=100);
    574     -webkit-transition: opacity 1s linear;
    575 }
    576 
    577 #tab_feedback2 {
    578      position: fixed;
    579      right: 0;
    580      top: 200px;
    581      display: block;
    582      width: 25px;
    583      height: 102px;
    584      text-indent: -10000px;
    585      background-image: url(pngs/tabfeedback.png);
    586      overflow: hidden;
    587      z-index: 5;
    588 }
    589 
    590 #tab_docs {
    591      position: fixed;
    592      right: 0;
    593      top: 295px;
    594      z-index: 4;
    595 }
    596 
    597 .warning {
    598 color: rgb( __error_color_rgb__ );
    599 }
    600 
    601 .ui-state-highlight {
    602   color: rgb( __select_color_rgb__ );
    603 }
    604 
    605 .header1 {
    606 font-size: 2em;
    607 __~header1_color{color: rgb( __header1_color__ );}
    608 }
    609 .header2 {
    610 font-size: 1.75em;
    611 __~header2_color{color: rgb( __header2_color__ );}
    612 }
    613 .header3 {
    614 font-size: 1.5em;
    615 __~header3_color{color: rgb( __header3_color__ );}
    616 }
    617 .header4 {
    618 font-size: 1.25em;
    619 __~header4_color{color: rgb( __header4_color__ );}
    620 }
    621 
    622 .sidebar {
    623    position: absolute;
    624    __~style:menupositionfixed{position: fixed;}
    625    left: 0;
    626    __~style:sidebartop{top: __style:sidebartop__;}
    627    __~style:sidebarmargintop{margin-top: __style:sidebarmargintop__;}
    628    __~style:sidebarpaddingtop{padding-top: __style:sidebarpaddingtop__;}
    629    __~style:sidebarleftpadding{padding-left: __style:sidebarleftpadding__;}
    630    __~style:sidebarrightpadding{padding-right: __style:sidebarrightpadding__;}
    631    __~style:sidebarrightmargin{margin-right: __style:sidebarrightmargin__;}
    632    __~style:sidebarbackgroundcolor{background: rgb( __style:sidebarbackgroundcolor__ );}
    633    __~style:sidebartextalign{text-align: __style:sidebartextalign__;}
    634    __~style:sidebarheight{height: __style:sidebarheight__;}
    635    display: block;
    636 }
    637 
    638 .sidebar ul {
    639    list-style-type: none;
    640    padding-left: 0;
    641 }
    642 
    643 /* .sidebar ul li + li {
    644   border-top: 1px dotted;
    645 } */
    646 
    647 .sidebar ul li {
    648    display: block; 
    649    width: 140px; 
    650    __~style:sidebarwidth{width: __style:sidebarwidth__;}
    651    font-size: 18px; 
    652    line-height: 44px; 
    653    text-align: center; 
    654    __~style:menutextalign{text-align: __style:menutextalign__;}
    655    vertical-align: middle;
    656    text-decoration: none; 
    657    color: rgb( __text_color_rgb__ );
    658    __~style:menutextcolor{color: rgb( __style:menutextcolor__ );}
    659    __~style:menubackgroundcolor{background: rgb( __style:menubackgroundcolor__ );}
    660    __~style:menumargintop{margin-top: __style:menumargintop__;}
    661    __~style:menupaddingtop{padding-top: __style:menupaddingtop__;}
    662    __~style:menuleftpadding{padding-left: __style:menuleftpadding__;}
    663    __~style:menurightpadding{padding-right: __style:menurightpadding__;}
    664    __~style:menurightmargin{margin-right: __style:menurightmargin__;}
    665 }
    666 
    667 .sidebar ul li img {
    668    vertical-align: middle;
    669    float: right;
    670 }
    671 
    672 .sidebar ul li:hover {
    673    color: rgb( __select_color_rgb__ ); 
    674 }
    675 
    676 .config {
    677    vertical-align: middle;
    678    float: right;
    679 }
    680 
    681 .hoverhighlight {
    682    text-align: right;
    683 }
    684 
    685 .hoverhighlight:hover {
    686    color: rgb( __select_color_rgb__ ); 
    687 }
    688 
    689 #panelmain {
    690 position: relative;
    691     display: block; 
    692 
    693 }
    694 
    695 __~link_unvisited_color_rgb{a:link   {color: rgb( __link_unvisited_color_rgb__ );}}
    696 a:visited {color: rgb( __text_color_rgb__ );}
    697 __~link_hover_color_rgb{a:hover   {color: rgb( __link_hover_color_rgb__ );}}
    698 a:active  {color: rgb( __select_color_rgb__ );}
    699 
    700 button {
    701   outline: none;
    702 /*  cursor: none; */
    703   border: 0px;
    704   text-decoration: none;
    705   text-shadow: 0 1px 1px rgba(0,0,0,.3);
    706   border-radius: .2em;
    707   -webkit-border-radius: .2em;
    708   -moz-border-radius: .2em;
    709   background-color: rgb( __button_color_rgb__ );
    710   background: -webkit-gradient(linear, left top, left bottom, from( rgb( __button_color_rgb__ ) ), to( rgb( __button_g_color_rgb__ ) ));
    711   background: -moz-linear-gradient(top, rgb( __button_color_rgb__ ),  rgb( __button_g_color_rgb__ ) );
    712   filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr=rgb( __button_g_color_rgb__ ), endColorstr=rgb( __button_g_color_rgb__ ));
    713   padding: 0;
    714   padding-left: 2px;
    715   padding-right: 2px;
    716 }
    717 
    718 
    719 button:hover {
    720 /*   opacity: .5; */
    721    background-color: rgb( __button_hover_color_rgb__ );
    722    background: -webkit-gradient(linear, left top, left bottom, from( rgb( __button_hover_color_rgb__ ) ), to( rgb( __button_hover_g_color_rgb__ ) ));
    723     background: -moz-linear-gradient(top, rgb( __button_hover_color_rgb__ ),  rgb( __button_hover_g_color_rgb__ ) );
    724     filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr=rgb( __button_hover_g_color_rgb__ ), endColorstr=rgb( __button_hover_g_color_rgb__ ));
    725 /*   color: rgb( 255, 128, 0 );   */
    726 }
    727 
    728 button:active {
    729 position: relative;
    730 top: 1px;
    731 left: 1px;
    732 }
    733 
    734 .box-shadow-menu {
    735 vertical-align:middle;
    736 font-size: 2em;
    737 }
    738 
    739 .box-shadow-menu:hover {
    740   color: rgb(__select_color_rgb__);
    741   stroke: rgb(__select_color_rgb__);
    742 }
    743 
    744 .svgmenu {
    745   color: rgb(__text_color_rgb__);
    746   stroke: rgb(__text_color_rgb__);
    747   padding: 5px;
    748 }
    749 .svgmenu:hover {
    750   color: rgb(__select_color_rgb__);
    751   stroke: rgb(__select_color_rgb__);
    752 }
    753 .highlight:hover {
    754   color: rgb(__select_color_rgb__);
    755 }
    756 
    757 .help {
    758     background-color: rgba(__help_background_color_rgb__, 0.95 );
    759     color: rgb(__help_text_color_rgb__);
    760     border-radius: .5em;
    761     box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    762     opacity: 0; /* Make it transparent */
    763     padding: .5em;
    764     position: absolute;
    765     text-decoration: none;
    766     visibility: hidden; /* and hidden */
    767 /*    width: 25em; */
    768     z-index: 10;
    769 }
    770 
    771 .hidden {
    772     opacity: 0; 
    773     visibility: hidden;
    774 /*    display: none; */
    775 }
    776 
    777 .helpright {
    778     top: 60px;
    779 }
    780 
    781 .helpleft {
    782     left: 10px;
    783     min-width: 20em;
    784 }
    785 
    786 .help_link_on:hover + span {
    787     opacity: 1;
    788     visibility: visible;
    789 }
    790 
    791 .plot2ddef {
    792    width: 600px;
    793    height: 300px;
    794 }
    795 
    796 .coord {
    797     background-color: rgba(__help_background_color_rgb__, 0.95 );
    798     color: rgb(__help_text_color_rgb__);
    799     border-radius: .5em;
    800     box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    801     opacity: 0; /* Make it transparent */
    802     padding: .5em;
    803     position: absolute;
    804     text-decoration: none;
    805     visibility: hidden;
    806 /*    width: 25em; */
    807     z-index: 10;
    808 }
    809 
    810 .coordvisible {
    811     opacity: 1;
    812     visibility: visible;
    813 }
    814 
    815 .modalDialog {
    816    position: fixed;
    817 /*             font-family: Arial, Helvetica, sans-serif; */
    818    top: 0;
    819    right: 0;
    820    bottom: 0;
    821    left: 0;
    822    background: rgba(0,0,0,0.8);
    823    z-index: 99999;
    824    opacity:0;
    825    -webkit-transition: opacity 400ms ease-in;
    826    -moz-transition: opacity 400ms ease-in;
    827    transition: opacity 400ms ease-in;
    828    pointer-events: none;
    829 }
    830 
    831 .modalDialog_on {
    832    opacity:1;
    833    pointer-events: auto;
    834 }
    835 
    836 .modalDialog > div {
    837    width: 50%;
    838    position: relative;
    839    margin: 10% auto;
    840    padding: 5px 20px 13px 20px;
    841    border-radius: 10px;
    842    background: rgb( __background_color_rgb__ );
    843    background: -moz-linear-gradient(rgb( __background_color_rgb__ ), #222);
    844    background: -webkit-linear-gradient(rgb( __background_color_rgb__ ), #222);
    845    background: -o-linear-gradient(rgb( __background_color_rgb__ ), #222);
    846 }
    847 
    848 .close {
    849    background: #606061;
    850    color: #FFFFFF;
    851    line-height: 25px;
    852    position: absolute;
    853    right: -12px;
    854    text-align: center;
    855    top: -10px;
    856    width: 24px;
    857    text-decoration: none;
    858    font-weight: bold;
    859    -webkit-border-radius: 12px;
    860    -moz-border-radius: 12px;
    861    border-radius: 12px;
    862    -moz-box-shadow: 1px 1px 3px #000;
    863    -webkit-box-shadow: 1px 1px 3px #000;
    864    box-shadow: 1px 1px 3px #000;
    865 }
    866 
    867 .close:hover { background: #00d9ff; }
    868 
    869 .modalDialog2 {
    870    position: fixed;
    871 /*             font-family: Arial, Helvetica, sans-serif; */
    872    top: 0;
    873    right: 0;
    874    bottom: 0;
    875    left: 0;
    876    background: rgba(0,0,0,0.8);
    877    z-index: 99998;
    878    opacity:0;
    879    -webkit-transition: opacity 400ms ease-in;
    880    -moz-transition: opacity 400ms ease-in;
    881    transition: opacity 400ms ease-in;
    882    pointer-events: none;
    883 }
    884 
    885 .modalDialog2_on {
    886    opacity:1;
    887    pointer-events: auto;
    888 }
    889 
    890 .modalDialog2 > div {
    891    width: 55%;
    892    position: relative;
    893    margin: 10% auto;
    894    padding: 5px 20px 13px 20px;
    895    border-radius: 10px;
    896    background: rgb( __background_color_rgb__ );
    897    background: -moz-linear-gradient(rgb( __background_color_rgb__ ), #222);
    898    background: -webkit-linear-gradient(rgb( __background_color_rgb__ ), #222);
    899    background: -o-linear-gradient(rgb( __background_color_rgb__ ), #222);
    900 }
    901 
    902 .close2 {
    903    background: #606061;
    904    color: #FFFFFF;
    905    line-height: 25px;
    906    position: absolute;
    907    right: -12px;
    908    text-align: center;
    909    top: -10px;
    910    width: 24px;
    911    text-decoration: none;
    912    font-weight: bold;
    913    -webkit-border-radius: 12px;
    914    -moz-border-radius: 12px;
    915    border-radius: 12px;
    916    -moz-box-shadow: 1px 1px 3px #000;
    917    -webkit-box-shadow: 1px 1px 3px #000;
    918    box-shadow: 1px 1px 3px #000;
    919 }
    920 
    921 .close2:hover { background: #00d9ff; }
    922 
    923 .modalDialog3 {
    924    position: fixed;
    925 /*             font-family: Arial, Helvetica, sans-serif; */
    926    top: 0;
    927    right: 0;
    928    bottom: 0;
    929    left: 0;
    930    background: rgba(0,0,0,0.8);
    931    z-index: 99999;
    932    opacity:0;
    933    -webkit-transition: opacity 400ms ease-in;
    934    -moz-transition: opacity 400ms ease-in;
    935    transition: opacity 400ms ease-in;
    936    pointer-events: none;
    937 }
    938 
    939 .modalDialog3_on {
    940    opacity:1;
    941    pointer-events: auto;
    942 }
    943    
    944 
    945 .table-wrapper {
    946    overflow: auto;
    947    max-height: 400px;
    948 }
    949 
    950 .modalDialog3 > div {
    951    max-width: 70%;
    952    position: relative;
    953    margin: 10% auto;
    954    padding: 5px 20px 13px 20px;
    955    max-height: 95%;
    956    border-radius: 10px;
    957    background: rgb( __background_color_rgb__ );
    958    background: -moz-linear-gradient(rgb( __background_color_rgb__ ), #222);
    959    background: -webkit-linear-gradient(rgb( __background_color_rgb__ ), #222);
    960    background: -o-linear-gradient(rgb( __background_color_rgb__ ), #222);
    961 }
    962 
    963 .close3 {
    964    background: #606061;
    965    color: #FFFFFF;
    966    line-height: 25px;
    967    position: absolute;
    968    right: -12px;
    969    text-align: center;
    970    top: -10px;
    971    width: 24px;
    972    text-decoration: none;
    973    font-weight: bold;
    974    -webkit-border-radius: 12px;
    975    -moz-border-radius: 12px;
    976    border-radius: 12px;
    977    -moz-box-shadow: 1px 1px 3px #000;
    978    -webkit-box-shadow: 1px 1px 3px #000;
    979    box-shadow: 1px 1px 3px #000;
    980 }
    981 
    982 .close3:hover { background: #00d9ff; }
    983 
    984 .modalDialog4 {
    985    position: fixed;
    986 /*             font-family: Arial, Helvetica, sans-serif; */
    987    top: 0;
    988    right: 0;
    989    bottom: 0;
    990    left: 0;
    991    background: rgba(0,0,0,0.8);
    992    z-index: 99999;
    993    opacity:0;
    994    -webkit-transition: opacity 400ms ease-in;
    995    -moz-transition: opacity 400ms ease-in;
    996    transition: opacity 400ms ease-in;
    997    pointer-events: none;
    998 }
    999 
    1000 .modalDialog4_on {
    1001    opacity:1;
    1002    pointer-events: auto;
    1003 }
    1004    
    1005 .modalDialog4 > div {
    1006    max-width: 70%;
    1007    position: relative;
    1008    margin: 10% auto;
    1009    padding: 5px 20px 13px 20px;
    1010    max-height: 95%;
    1011    border-radius: 10px;
    1012    background: rgb( __background_color_rgb__ );
    1013    background: -moz-linear-gradient(rgb( __background_color_rgb__ ), #222);
    1014    background: -webkit-linear-gradient(rgb( __background_color_rgb__ ), #222);
    1015    background: -o-linear-gradient(rgb( __background_color_rgb__ ), #222);
    1016 }
    1017 
    1018 .close4 {
    1019    background: #606061;
    1020    color: #FFFFFF;
    1021    line-height: 25px;
    1022    position: absolute;
    1023    right: -12px;
    1024    text-align: center;
    1025    top: -10px;
    1026    width: 24px;
    1027    text-decoration: none;
    1028    font-weight: bold;
    1029    -webkit-border-radius: 12px;
    1030    -moz-border-radius: 12px;
    1031    border-radius: 12px;
    1032    -moz-box-shadow: 1px 1px 3px #000;
    1033    -webkit-box-shadow: 1px 1px 3px #000;
    1034    box-shadow: 1px 1px 3px #000;
    1035 }
    1036 
    1037 .close4:hover { background: #00d9ff; }
    1038 
    1039 .legendLabel {
    1040    color: rgb( __text_color_rgb__ );
    1041 }
    1042 .overflow {
    1043    overflow-x : auto;
    1044    overflow-y : auto;
    1045 }
    1046 
    1047445</style>
     446<link rel="stylesheet" href="css/ga.css">
    1048447</head>
    1049448<header>
     
    1145544<link rel="stylesheet" href="css/jstree.min.css">
    1146545<link rel="stylesheet" href="css/spectrum.min.css">
    1147 <link rel="stylesheet" href="css/bokeh-0.12.7.min.css">
    1148 <link rel="stylesheet" href="css/bokeh-widgets-0.12.7.min.css">
     546__~bokeh:version{<link rel="stylesheet" href="css/bokeh-__bokeh:version__.min.css">}
     547__~bokeh:version{<link rel="stylesheet" href="css/bokeh-widgets-__bokeh:version__.min.css">}
     548__~bokeh:version{<link rel="stylesheet" href="css/bokeh-tables-__bokeh:version__.min.css">}
    1149549<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
    1150550<script src="js/genapp.js"></script>
     551__~bokeh:version{<script src="js/bokeh-__bokeh:version__.min.js"></script>}
     552__~bokeh:version{<script src="js/bokeh-widgets-__bokeh:version__.min.js"></script>}
     553__~bokeh:version{<script src="js/bokeh-tables-__bokeh:version__.min.js"></script>}
     554
    1151555__~frontpage:url{<script>ga.apprun = ga.urlparams( "apprun" );if ( !ga.apprun ) { ga.frontpage( "frontpage.html" ); }</script>}
    1152556
     
    1189593gd.data( "_unload", 0 );
    1190594window.onbeforeunload = function (e) { gd.data( "_unload", 1 ); __~debug:ws{console.log( "before unload" );} };
    1191 
    1192 function setMsging()
    1193 {
    1194 __~debug:ws{   console.log( 'setMsging() called' );}
    1195    var ws = $( "#_state" ).data( "_ws" );
    1196    if ( !ws )
    1197    {
    1198       console.log( "setMsging: ws not defined" );
    1199       return;
    1200    }
    1201 
    1202    var conn = $( '#_state' ).data( "_wssession" );
    1203    if ( conn && conn.isOpen )
    1204    {
    1205       console.log( "setMsging: connection is already open" );
    1206       return;
    1207    }
    1208    
    1209 __~debug:ws{   console.log( 'setMsging trying new session' );}
    1210    conn = new ab.Session( ws
    1211       , function() {            // Once the connection has been established
    1212           $(".wsstatus").css( "color", "green" );
    1213 __~debug:ws{          console.log( 'setMsging: connection established' );}
    1214           ga.event( "global", "ws messaging", "connection established" );
    1215           $( '#_state' ).data( "_wssession", conn );
    1216 __~debug:ws{          console.log('websocket opened');}
    1217           subMsging( "keepalive", keepalive, "keepalive" );
    1218         }
    1219       , function() {            // When the connection is closed
    1220             $(".wsstatus").css( "color", "red" );
    1221 __~debug:ws{            console.warn('setMsging connection closed');}
    1222             if ( gd.data( "_unload" ) == 0 ) {
    1223 __~debug:ws{            console.warn('resubing');}
    1224                 return setMsging();
    1225             } else {
    1226                console.log( "ws connection closed on unload of page" );
    1227             }
    1228 //            {
    1229 //              ga.event( "global", "ws messaging", "connection failed" );
    1230 //            messagebox( { icon: "toast.png",
    1231 //                         text: "WebSocket messaging failed to " + ws + "<p>Your firewall may be blocking external access to port " + ws.replace( /^.*:/g, '') + " or the WebSocket server is down.<p>This results in a crippled experience with no messaging.",
    1232 //                         buttons : [ { id : "ok", label : "OK" } ] });
    1233 //            }
    1234         }
    1235       , {                       // Additional parameters, we're ignoring the WAMP sub-protocol for older browsers
    1236             'skipSubprotocolCheck': true,
    1237             'maxRetries': 60,
    1238             'retryDelay': 2000
    1239         }
    1240     );
    1241 
    1242 __~debug:ws{   console.log( 'setMsging end' );}
    1243 }       
    1244 
    1245 function keepalive() {
    1246     __~debug:ws{console.log( "keepalive received: " + Date().toLocaleString() );}
    1247 }
    1248 
    1249 subd_msging = [];
    1250 
    1251 function subMsging( vuuid, onevent, moduleid )
    1252 {
    1253 __~debug:msg{   console.log( "subMsging: called " + moduleid + " " + vuuid );}
    1254    if ( moduleid in subd_msging )
    1255    {
    1256 __~debug:msg{      console.log( "subMsging: calling unsubMsging for " + moduleid + " " + subd_msging[ moduleid ] );}
    1257       unsubMsging( subd_msging[ moduleid ], moduleid );
    1258    }
    1259 __~debug:msg{   console.log( "subMsging: added to subd_msging: " + moduleid + " " + vuuid );}
    1260    subd_msging[ moduleid ] = vuuid;
    1261 
    1262    var ws = $( "#_state" ).data( "_ws" );
    1263    if ( !ws )
    1264    {
    1265       console.log( "subMsging: ws not defined" );
    1266       return;
    1267    }
    1268 
    1269    var conn = $( '#_state' ).data( "_wssession" );
    1270    if ( !conn )
    1271 //   if ( conn && !conn.isOpen )
    1272    {
    1273       console.log( "subMsging: connection is not open" );
    1274       return;
    1275    }
    1276 
    1277    conn.subscribe( vuuid, onevent );
    1278 // this doesn't work:
    1279 // .then( function( subscription ) { $( '#_state' ).data( "_wssub:" + vuuid, subscription ) } );
    1280 }
    1281 
    1282 function unsubMsging( vuuid, moduleid )
    1283 {
    1284 __~debug:msg{   console.log( "unsubMsging: called " + moduleid + " " + vuuid );}
    1285    if ( moduleid in subd_msging )
    1286    {
    1287 __~debug:msg{      console.log( "unsubMsging: found and deleting " + moduleid + " " + subd_msging[ moduleid ] );}
    1288       delete subd_msging[ moduleid ];
    1289    } else {
    1290 __~debug:msg{      console.log( "unsubMsging: not found so not unsubscribing" );}
    1291       return;
    1292    }
    1293    var ws = $( "#_state" ).data( "_ws" );
    1294    if ( !ws )
    1295    {
    1296       console.log( "subMsging: ws not defined" );
    1297       return;
    1298    }
    1299 
    1300    var conn = $( '#_state' ).data( "_wssession" );
    1301    if ( !conn )
    1302 //   if ( conn && !conn.isOpen )
    1303    {
    1304       console.log( "subMsging: connection is not open" );
    1305       return;
    1306    }
    1307 
    1308    conn.unsubscribe( vuuid );
    1309    $( '#_state' ).data( "_wssub:" + vuuid, null );
    1310 }
    1311 
    1312 function msgGenericEvent( vuuid, data )
    1313 {
    1314    console.log( 'msgGenericEvent ' + vuuid + ' : ' + data.json);
    1315 }
    1316595
    1317596function getSid()
     
    1331610     __~debug:ws{console.log( "getSid:_ws returned " + v );}
    1332611     $( "#_state" ).data( "_ws", v );
    1333      setMsging();
     612     ga.ws.set();
    1334613   }
    1335614   if ( k == "_airavata" ) {
     
    1385664ga.jc.url         = "ajax/sys_config/sys_jobs.php";
    1386665
     666ga.qr.url         = "ajax/sys_config/qr_post.php";
     667
    1387668ga.license.url    = "ajax/sys_config/sys_license.php";
    1388669
     
    1394675ga.apprun         = ga.urlparams( "apprun" );
    1395676ga.admin.ajax.url = "ajax/sys_config/sys_manageusers.php";
     677
     678__~usesplash{ga.usesplash = 1;}
     679__~frontpage:url{ga.frontpageurl = "__frontpage:url__";}
    1396680
    1397681// var fs_test = function( obj ) {
     
    1401685
    1402686//ga.fc( "#", fs_test );
    1403 
    1404 function resetHoverHelp() {
    1405     __~debug:help{console.log("resetHoverHelp()");}
    1406    if ( $( "#global_data" ).data( "hoverhelp" ) ||
    1407         $( "#global_data" ).data( "hoverhelp" ) != 0 )
    1408    {
    1409        $( ".help_link" ).removeClass( "help_link_on" );
    1410        $( ".help_link" ).addClass( "help_link_on" );
    1411    }
    1412 }
    1413 
    1414 function setHoverHelp() {
    1415     __~debug:help{console.log("setHoverHelp()");}
    1416     __~debug:help{console.log("setHoverHelp() gd hoverhelp " + $( "#global_data" ).data( "hoverhelp" ) );}
    1417    if ( !$( "#global_data" ).data( "hoverhelp" ) ||
    1418         $( "#global_data" ).data( "hoverhelp" ) == 0 )
    1419    {
    1420        __~debug:help{console.log("setHoverHelp() turning hoverhelp off");}
    1421        $( ".help_link" ).removeClass( "help_link_on" );
    1422        $( "#hoverhelp" ).html( "Help off" );
    1423    } else {
    1424        __~debug:help{console.log("setHoverHelp() turning hoverhelp on");}
    1425        $( ".help_link" ).addClass( "help_link_on" );
    1426        $( "#hoverhelp" ).html( "Help on" );
    1427    }
    1428 }
    1429687
    1430688function setLogin() {
  • languages/html5/js/altfile.js

    r1363 r1598  
    9292       tmp = $( '#_state' ).data( '_logon' );
    9393       if ( !tmp || !tmp.length ) {
    94            messagebox( {
     94           ga.msg.box( {
    9595               icon : "warning.png",
    9696               text : "You must login to browse server information",
     
    128128
    129129ga.altfile.button.cb = function() {
    130 __~debug:altfile{   console.log( "ga.altfile.button.cb" );}
    131     closeModal();
     130    __~debug:altfile{console.log( "ga.altfile.button.cb" );}
     131    ga.msg.close( 1 );
    132132}
    133133
     
    144144__~debug:altfile{  console.log( "ga.altfile.button.lrfile() .each this.id " + this.id + " decoded " + $.base64.decode( this.id ) + " this.children.length " + this.children.length );}
    145145     if ( !this.children.length ) {
    146        add += '<input type="hidden" name="' + id + '_altval[]" value="' + this.id + '" class="' + hclass + '">';
     146       add += '<input type="hidden" name="' + id + '_altval[]" value="' + this.id + '" class="' + hclass + '" data-type="rfile_val">';
    147147         r.push( $.base64.decode( this.id ).substr( 2 ) );
    148148     }
     
    152152__~debug:altfile{     console.log( "filename:" + r ); }     
    153153     $( hid + "_altval").html( "<i>Server</i>: " + r );
    154      $( hid + "_msg").html( "" );
     154     $( hid + "_msg").empty();
    155155     $( hid ).val("");
    156156     $( hmod ).append( add );
     
    187187  if ( r.length ) {
    188188     $( hid + "_altval").html( "<i>Server</i>: " + r );
    189      $( hid + "_msg").html( "" );
     189     $( hid + "_msg").empty();
    190190     $( hid ).val("");
    191191     $( hmod ).append( add );
     
    207207__~debug:altfile{  console.log( "ga.altfile.button.rfile() .each this.id " + this.id + " decoded " + $.base64.decode( this.id ) + " this.children.length " + this.children.length );}
    208208     if ( !this.children.length ) {
    209        add += '<input type="hidden" name="' + id + '_altval[]" value="' + this.id + '" class="' + hclass + '">';
     209       add += '<input type="hidden" name="' + id + '_altval[]" value="' + this.id + '" class="' + hclass + '" data-type="rfile_val">';
    210210       r.push( $.base64.decode( this.id ).substr( 2 ) );
    211211     }
     
    214214  if ( r.length ) {
    215215     $( hid + "_altval").html( "<i>Server</i>: " + r );
    216      $( hid + "_msg").html( "" );
     216     $( hid + "_msg").empty();
    217217     $( hid ).val("");
    218218     $( hmod ).append( add );
     
    247247  if ( r.length ) {
    248248     $( hid + "_altval").html( "<table>" + r + "</table>" );
    249      $( hid + "_msg").html( "" );
     249     $( hid + "_msg").empty();
    250250     $( hid ).val("");
    251251     $( hmod ).append( add );
  • languages/html5/js/bokeh.js

    r1363 r1598  
    2424        if ( !mode ) {
    2525            mode = 1;
    26             result.docs_json = $.parseJSON( lines[ i ].replace( /^\s*var\s+docs_json\s+=\s+/, "" ).replace( /;$/, "" ) );
     26            result.docs_json = $.parseJSON( lines[ i ].replace( /^\s*var\s+docs_json\s+=\s+/, "" ).replace( /(^'|('|);$)/g, "" ) );
    2727            __~debug:bokeh{console.log( "ga.bokeh.getdata() found docs_json:");console.dir( result.docs_json );}
    2828            continue;
     
    7575    }
    7676    ga.bokeh.data[ mod ][ tag ] = {};
    77     $( "#" + tag ).html("");
     77    $( "#" + tag ).empty();
    7878}
  • languages/html5/js/calc.js

    r1363 r1598  
    8181    ga.calc.data[ mod ].calc[ id ].tokens = ga.calc.tokens( calc );
    8282    if ( ga.calc.data[ mod ].calc[ id ].tokens._error ) {
    83         messagebox( {
     83        ga.msg.box( {
    8484            icon: "toast.png",
    8585            text: "Module field calc internal error: " + ga.calc.data[ mod ].calc[ id ].tokens._error + " in calc field id " + id
     
    9393    __~debug:calcdeps{console.log( "ga.calc.register() dependent depth is " + ga.calc.depthofdeps( mod, id ) );}
    9494    if ( ga.calc.depthofdeps( mod, id ) > 99 ) {
    95         messagebox( {
     95        ga.msg.box( {
    9696            icon: "toast.png",
    9797            text: "Module field calc internal error: maximum recursion depth found in calc field id " + id
     
    101101    ga.calc.data[ mod ].calc[ id ].tree = ga.calc.mktree( ga.calc.data[ mod ].calc[ id ].tokens );
    102102    if ( ga.calc.data[ mod ].calc[ id ].tree._error ) {
    103         messagebox( {
     103        ga.msg.box( {
    104104            icon: "toast.png",
    105105            text: "Module field calc internal error: " + ga.calc.data[ mod ].calc[ id ].tree._error + " in calc field id " + id
     
    222222
    223223    if ( result._error ) {
    224         messagebox( {
     224        ga.msg.box( {
    225225            icon: "toast.png",
    226226            text: "Module field calc internal error: " + ga.calc.data[ mod ].calc[ id ].tokens._error + " in calc field id " + id
  • languages/html5/js/captcha.js

    r539 r1598  
    1616        __~debug:captcha{console.log( "ga.captcha() success id = " + data.id );}
    1717        if ( data.error ) {
    18             messagebox( {
     18            ga.msg.box( {
    1919                icon : "toast.png"
    2020                ,text  : data.error
     
    3333        ;
    3434        __~debug:captchahtml{console.log( msg );}
    35         messagebox( {
     35        ga.msg.box( {
    3636            text  : msg
    37             ,eval  : "resetHoverHelp();$('#sys_captcha').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});"
     37            ,eval  : "ga.hhelp.reset();$('#sys_captcha').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});"
    3838            ,buttons : [
    3939                {
     
    4949        } );
    5050    }).error( function( error ) {
    51         messagebox( {
     51        ga.msg.box( {
    5252            icon : "toast.png"
    5353            ,text  : "Error contacting server"
     
    7272                __~debug:captcha{console.log( "ga.captcha_verify() success id = " + vdata.id );}
    7373                if ( vdata.error ) {
    74                     messagebox( {
     74                    ga.msg.box( {
    7575                        icon : "toast.png"
    7676                        ,text  : vdata.error
     
    8585           })
    8686        .error( function( error ) {
    87             messagebox( {
     87            ga.msg.box( {
    8888                icon : "toast.png"
    8989                ,text  : "Error contacting server"
  • languages/html5/js/data.js

    r1363 r1598  
    55ga.data.nofcrefresh = {};
    66
     7// play with tooltips upon hover
     8function showTooltip(x, y, content, bg_color) {
     9        $('<div id="rtooltip">' + content + '</div>').css({
     10            'position' : 'absolute',
     11            'top'      : y + 5,
     12            'left'     : x + 5,
     13            'border'   : '1px solid #181616',
     14            'padding'  : '2px',
     15            'background-color' : bg_color,
     16            'color'    : 'white'
     17        }).appendTo( "body" );
     18    }
     19
     20
    721// apply the data to the screen output, return an object with job_status
    8 
    922
    1023ga.data.dataURLtoFile = function(dataurl, filename) {
     
    7891        t,
    7992        jsmolfile,
    80         match;
     93        match,
     94        t2;
    8195
    8296__~debug:data{    console.log( "ga.data.update( " + mod + " , " + data + " )" );}
     
    86100    if ( msging_f ) {
    87101__~debug:data{    console.log( "ga.data.update() msging_f defined" );}
    88         $( "#" + mod + "_progress" ).html( "" );
     102        $( "#" + mod + "_progress" ).empty();
    89103        jqhmod_out_msgs.text( "" );
    90104    }
     
    104118            switch ( match.attr( "type" ) )
    105119            {
     120            case "plot3d" :
     121            case "plotly" :
     122                htag = "#" + k;
     123                __~debug:plotly{console.log( "Plotly v:" + JSON.stringify( v ) );}
     124                // v.layout = $.extend( {}, v.layout, {showlegend: false } );
     125               
     126                ga.plot3dglobal     = v.layout;
     127                ga.dataplot3dglobal = v.data;
     128                ga.plotted3d[ mod ] = 0;
     129               
     130                __~debug:plotly{console.log("Plotly JSON Options: " + JSON.stringify(v.layout));}
     131                __~debug:plotly{console.log("plotly JSON Data: " + JSON.stringify(v.data));}
     132
     133                if ( $( htag  + "_showcollapse" ).length )
     134                {
     135                    $(htag + "_showcollapse").removeClass( "hidden" );
     136                }
     137               
     138                //if(!ga.showcollapse3d)
     139                //{
     140                Plotly.plot(k, v.data, v.layout);
     141                //}
     142                if ( ga.showcollapse3d[ mod ] )
     143                {
     144                    ga.plotted3d[ mod ] = 1;
     145                    $(  htag  + "_showcollapse" ).trigger( "click" );
     146                }
     147                savekey = mod_out + ":#" + k + ":last_value";
     148                $( "#global_data" ).data( savekey , v );
     149                break;
    106150            case "plot2d" :
    107151                __~debug:plottwod{console.log( "ga.data.update v is " );console.dir( v );}
     
    123167                    //console.dir(ga.pl );
    124168                   
     169                    //console.dir(ga.value.get.plot2d.plot_options( htag, v.options ));
     170
    125171                    plot = $.plot( htag, v.data, ga.value.get.plot2d.plot_options( htag, v.options ) );
     172
     173                    // play with tooltip response upon hover //////////////////////////////////////////
     174                    if ( ga.customtooltips[ mod ] )
     175                    {
     176                        var previousPoint = null;
     177                        $( htag ).bind("plothover", function (event, pos, item) {
     178                            if (item) {
     179                                if (previousPoint != item.dataIndex) {
     180                                    previousPoint = item.dataIndex;
     181                                   
     182                                    $("#rtooltip").remove();
     183                                    var x = item.datapoint[0].toFixed(2),
     184                                    y = item.datapoint[1].toFixed(2);
     185                                   
     186                                    if (item.series.tooltips.length) //specific for Rotdif's 'rdata' for residues...
     187                                    {
     188                                        showTooltip(item.pageX, item.pageY, item.series.tooltips[item.dataIndex], item.series.color );
     189                                        //alert(item.series.rdata);
     190                                    }
     191                                }
     192                            }
     193                            else {
     194                                $("#rtooltip").remove();
     195                                //$("#tooltip").hide();
     196                            previousPoint = null;
     197                            }
     198                        });
     199                    }
     200                    // END of tooltip response /////////////////////////////////////////////////////
     201                   
    126202                } else {
    127203                    plot = $.plot( htag, v,  ga.value.get.plot2d.plot_options( htag ) );
     
    157233                        $(htag + "_changescaley_message").html("Y-lin");
    158234                    }
     235                }
     236
     237                if ( $( htag  + "_showcollapse" ).length )
     238                {
     239                    $(htag + "_showcollapse").removeClass( "hidden" );
     240                    $(htag).show();
     241                    ga.plotted2d[ mod ]=1;
     242                    $(  htag  + "_showcollapse" ).trigger( "click" );
    159243                }
    160244
     
    219303                }
    220304               
    221                 savekey = mod_out + ":#" + k + ":last_value";
     305                savekey = mod_out + ":#" + k + ":last_value";
    222306                $( "#global_data" ).data( savekey , v );
    223307                break;
     
    227311                ga.bokeh.render( mod, k, v );
    228312                break;
     313
     314            case "ngl" :
     315                ga.value.nglshow( mod_out, k, v );
     316                break;
     317
    229318            case "atomicstructure" :
    230319                //                               Jmol.setDocument( 0 );
     
    317406                        if ( k == "_message" )
    318407                        {
    319                             messagebox( v );
     408                            ga.msg.box( v );
     409                        }
     410                        if ( k == "_question" )
     411                        {
     412                            // could probably just send data._question==v, data._uuid & data._msgid
     413                            ga.qr.question( mod, data );
     414                        }
     415                        if ( k == "_question_answered" )
     416                        {
     417                            // could probably just send data._question==v, data._uuid & data._msgid
     418                            ga.qr.answered( mod, data );
     419                        }
     420                        if ( k == "_question_timeout" )
     421                        {
     422                            // could probably just send data._question==v, data._uuid & data._msgid
     423                            ga.qr.timeout( mod, data );
    320424                        }
    321425                        if ( /^_getinput/.test( k ) )
     
    417521    ga.value.saveLastValues( mod_out );
    418522    ga.value.saveLastValue( mod_out, hmod_out_msgs );
    419     $( hmod_out + '_progress' ).html( "" );
     523    $( hmod_out + '_progress' ).empty();
    420524    if ( state_changed )
    421525    {
     
    424528    if ( do_close )
    425529    {
    426         closeModal();
     530        ga.msg.close( 1 );
    427531    }
    428532    if ( do_close2 )
    429533    {
    430         closeModal2();
     534        ga.msg.close( 2 );
    431535    }
    432536    return retobj;
  • languages/html5/js/ga_global.js

    r1363 r1598  
    1010ga.currentstage = 0;
    1111
    12 ga.fielderrors = 0;
     12//ga.fielderrors = 0;
     13//ga.customtooltips = 0;
     14//ga.showcollapse3d = 0;
     15//ga.showcollapse2d = 0;
     16
     17ga.fielderrors    = {}; 
     18ga.customtooltips = {};
     19ga.showcollapse3d = {};
     20ga.plotted3d      = {};
     21ga.showcollapse2d = {};
     22ga.plotted2d      = {};
     23
     24//ga.firstplotted3d = 0;
     25
     26
    1327
    1428// extend jstree for singleselect & conditional select plugins:
     
    381395        {               
    382396            if ( ga.restricted.data[ cachedelete ] ) {
    383                 messagebox( {
     397                ga.msg.box( {
    384398                    icon  : "question.png"
    385399                    ,text  : "Show or clear previously computed results."
     
    405419                return;
    406420            } else {
    407                 messagebox( { icon:"information.png", text:"Showing previously computed results." } );
     421                ga.msg.box( { icon:"information.png", text:"Showing previously computed results." } );
    408422            }
    409423        }
     
    411425    case "askrecompute" :
    412426        if ( ga.restricted.data[ cachedelete ] ) {
    413             messagebox( {
     427            ga.msg.box( {
    414428                icon  : "question.png"
    415429                ,text  : "Previously computed results are available."
     
    440454            } );
    441455        } else {
    442             messagebox( {
     456            ga.msg.box( {
    443457                icon  : "question.png"
    444458                ,text  : "Previously computed results are available."
     
    465479        {               
    466480            if ( ga.restricted.data[ cachedelete ] ) {
    467                 messagebox( {
     481                ga.msg.box( {
    468482                    icon  : "question.png"
    469483                    ,text  : "Show or clear previously computed results."
     
    498512ga.cache.clear = function( uuid, cachedelete ) {
    499513    __~debug:cache{ console.log( "ga.cache.clear( " + uuid + " , " + cachedelete + " )" );}
    500     // maybe messagebox to confirm delete of cached results
    501     messagebox( {
     514    // maybe ga.msg.box to confirm delete of cached results
     515    ga.msg.box( {
    502516        icon  : "admin.png"
    503517        ,text  : "Are you sure you want to permanently remove this previously computed result?"
     
    534548                __~debug:cache{console.log( "ga.cache.doclear() .getJSON done" )};
    535549                if ( data[ 'success' ] == "true" ) {
    536                     messagebox( { icon : "information.png",
     550                    ga.msg.box( { icon : "information.png",
    537551                                  text : "Previously computed results cleared" } );
    538552                } else {
    539                     messagebox( { icon : "toast.png",
     553                    ga.msg.box( { icon : "toast.png",
    540554                                  text : data[ 'error' ] } );
    541555                }
     
    545559                __~debug:cache{console.log( "ga.cache.doclear() .getJSON fail" )};
    546560                console.warn( "could not clear cache data" );
    547                 messagebox( { icon : "toast.png",
     561                ga.msg.box( { icon : "toast.png",
    548562                              text : "Error: server failed to clear cached entry" } );
    549563            });
    550564    } else {
    551         messagebox( { icon : "toast.png",
     565        ga.msg.box( { icon : "toast.png",
    552566                      text : "Internal error: no url defined for cache clear" } );
    553567    }
     
    599613    }                               
    600614
    601     messagebox( msg );
     615    ga.msg.box( msg );
    602616}
    603617
     
    606620    var form = $( "#sys_login" );
    607621    if ( !form ) {
    608         return messagebox( { icon : "toast.png", text: "Internal error: form missing" } );
     622        return ga.msg.box( { icon : "toast.png", text: "Internal error: form missing" } );
    609623    }
    610624    form.append( '<input type="hidden" name="_resendverify" class="toclear">' );
     
    614628ga.login.verify.change = function () {
    615629    __~debug:loginverify{console.log( "ga.login.verify.change()" );}
    616     return messagebox( {
     630    return ga.msg.box( {
    617631        icon : "question.png"
    618         ,text : '<center><label  class="header3 ">Change email address</label></center><form id="_changeemail"><table><tr><td><label for="_changeemail1">Email address </label></td><td><input type="email" name="_changeemail1" id="_changeemail1" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail1_msg" class="warning field_msg" > </span></td></tr><tr><td><label for="_changeemail2">Repeat email address </label></td><td><input type="email" name="_changeemail2" id="_changeemail2" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail2_msg" class="warning field_msg" > </span></td></tr></table></form><script>$( "#_changeemail1" ).keypress( function() { $( "#_changeemail1_msg" ).html( "" );});$( "#_changeemail2" ).keypress( function() { $( "#_changeemail2_msg" ).html( "" );});$( "#_changeemail2" ).blur( function() { ga.valid.checkMatch( "#_changeemail2", "#_changeemail1" ); } );setHoverHelp();</script>'
     632        ,text : '<center><label  class="header3 ">Change email address</label></center><form id="_changeemail"><table><tr><td><label for="_changeemail1">Email address </label></td><td><input type="email" name="_changeemail1" id="_changeemail1" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail1_msg" class="warning field_msg" > </span></td></tr><tr><td><label for="_changeemail2">Repeat email address </label></td><td><input type="email" name="_changeemail2" id="_changeemail2" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail2_msg" class="warning field_msg" > </span></td></tr></table></form><script>$( "#_changeemail1" ).keypress( function() { $( "#_changeemail1_msg" ).empty();});$( "#_changeemail2" ).keypress( function() { $( "#_changeemail2_msg" ).empty();});$( "#_changeemail2" ).blur( function() { ga.valid.checkMatch( "#_changeemail2", "#_changeemail1" ); } );ga.hhelp.set();</script>'
    619633        ,buttons : [
    620634            {
     
    635649    var form = $( "#sys_login" );
    636650    if ( !form ) {
    637         return messagebox( { icon : "toast.png", text: "Internal error: form missing" } );
     651        return ga.msg.box( { icon : "toast.png", text: "Internal error: form missing" } );
    638652    }
    639653// window to input email 2x to verify
     
    649663    var form = $( "#sys_login" );
    650664    if ( !form ) {
    651         return messagebox( { icon : "toast.png", text: "Internal error: form missing" } );
     665        return ga.msg.box( { icon : "toast.png", text: "Internal error: form missing" } );
    652666    }
    653667    form.append( '<input type="hidden" name="_cancel" class="toclear">' );
     
    677691    }                               
    678692
    679     messagebox( msg );
     693    ga.msg.box( msg );
    680694}
    681695
     
    684698    var form = $( "#sys_login" );
    685699    if ( !form ) {
    686         return messagebox( { icon : "toast.png", text: "Internal error: form missing" } );
     700        return ga.msg.box( { icon : "toast.png", text: "Internal error: form missing" } );
    687701    }
    688702    form.append( '<input type="hidden" name="_resendapprove" class="toclear">' );
     
    694708    var form = $( "#sys_login" );
    695709    if ( !form ) {
    696         return messagebox( { icon : "toast.png", text: "Internal error: form missing" } );
     710        return ga.msg.box( { icon : "toast.png", text: "Internal error: form missing" } );
    697711    }
    698712    form.append( '<input type="hidden" name="_cancel" class="toclear">' );
     
    721735            data = JSON.parse( data.replace( /^\s*[\r\n]/gm, '' ).split( /\r?\n/)[1]);
    722736            if ( data[ 'success' ] == "true" ) {
    723                 // messagebox( { icon : "information.png",
     737                // ga.msg.box( { icon : "information.png",
    724738                // text : "system user management command returned success" } );
    725739            } else {
    726                 messagebox( { icon : "toast.png",
     740                ga.msg.box( { icon : "toast.png",
    727741                              text : data[ 'error' ] ? data[ 'error' ] : "unknown error"  } );
    728742            }
     
    734748        .fail( function( xhr, status, errorThrown ) {
    735749            __~debug:admin{console.log( "ga.admin.ajax() .getJSON fail: " + errorThrown )};
    736             messagebox( { icon : "toast.png",
     750            ga.msg.box( { icon : "toast.png",
    737751                          text : "Error: system user management backend command failed to run: " + errorThrown } );
    738752        });
     
    740754
    741755ga.admin.ajax.remove = function ( cmd, name, id, manageid ) {
    742     messagebox( {
     756    ga.msg.box( {
    743757        icon  : "admin.png"
    744758        ,text  : "Are you sure you want to permanently remove this user, all of their job history and their stored data?"
     
    759773
    760774ga.admin.ajax.group = function ( cmd, name, id, manageid, users_group ) {
    761     messagebox( {
     775    ga.msg.box( {
    762776        icon  : "admin.png"
    763777        ,text  :
     
    768782            '<span class="help">Enter a group for this user, then press ok or cancel</span>' +
    769783            '</form>'
    770         ,eval  : "resetHoverHelp();$('#sys_musergrp').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});"
     784        ,eval  : "ga.hhelp.reset();$('#sys_musergrp').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});"
    771785        ,buttons : [
    772786            {
     
    805819            data = JSON.parse( data.replace( /^\s*[\r\n]/gm, '' ).split( /\r?\n/)[1]);
    806820            if ( data[ 'success' ] == "true" ) {
    807                 // messagebox( { icon : "information.png",
     821                // ga.msg.box( { icon : "information.png",
    808822                // text : "system user management command returned success" } );
    809823            } else {
    810                 messagebox( { icon : "toast.png",
     824                ga.msg.box( { icon : "toast.png",
    811825                              text : data[ 'error' ] ? data[ 'error' ] : "unknown error"  } );
    812826            }
     
    818832        .fail( function( xhr, status, errorThrown ) {
    819833            __~debug:admin{console.log( "ga.admin.ajax.group.cb() .getJSON fail: " + errorThrown )};
    820             messagebox( { icon : "toast.png",
     834            ga.msg.box( { icon : "toast.png",
    821835                          text : "Error: system user management backend command failed to run: " + errorThrown } );
    822836        });
     
    838852ga.admin.ajax.cancel = function ( name, id, manageid, module, jid ) {
    839853    __~debug:admin{console.log( "ga.admin.ajax.cancel( " + name + " , " + id + " , " + manageid + " , " + module + " , " + jid + " )" );}
    840     messagebox( {
     854    ga.msg.box( {
    841855        icon  : "admin.png"
    842856        ,text  : "Are you sure you want to cancel this '" + module + "' job belonging to " + name + " ?"
     
    884898    delete ga.set.data[ "extrahidden" ][ moduleid ];
    885899}
     900
     901ga.hhelp = {};
     902
     903// resetHoverHelp() -> ga.hhelp.reset()
     904// setHoverHelp() -> ga.hhelp.set()
     905
     906ga.hhelp.reset = function() {
     907    __~debug:help{console.log("ga.hhelp.reset()");}
     908   if ( $( "#global_data" ).data( "hoverhelp" ) ||
     909        $( "#global_data" ).data( "hoverhelp" ) != 0 )
     910   {
     911       $( ".help_link" ).removeClass( "help_link_on" );
     912       $( ".help_link" ).addClass( "help_link_on" );
     913   }
     914}
     915
     916ga.hhelp.set = function() {
     917    __~debug:help{console.log("ga.hhelp.set()");}
     918    __~debug:help{console.log("ga.hhelp.set() gd hoverhelp " + $( "#global_data" ).data( "hoverhelp" ) );}
     919   if ( !$( "#global_data" ).data( "hoverhelp" ) ||
     920        $( "#global_data" ).data( "hoverhelp" ) == 0 )
     921   {
     922       __~debug:help{console.log("ga.hhelp.set() turning hoverhelp off");}
     923       $( ".help_link" ).removeClass( "help_link_on" );
     924       $( "#hoverhelp" ).html( "Help off" );
     925   } else {
     926       __~debug:help{console.log("ga.hhelp.set() turning hoverhelp on");}
     927       $( ".help_link" ).addClass( "help_link_on" );
     928       $( "#hoverhelp" ).html( "Help on" );
     929   }
     930}
  • languages/html5/js/hide.js

    r1363 r1598  
    4444    }
    4545// fix up help
    46     setHoverHelp();
     46    ga.hhelp.set();
    4747__~debug:hide{    console.log( "ga.hide.update( " + module + " , " + id + " ) returns" );}
    4848}
  • languages/html5/js/license.js

    r525 r1598  
    5252    if ( needs.length ) {
    5353
    54         messagebox( {
     54        ga.msg.box( {
    5555            icon  : "warning.png",
    5656            text  : msg,
  • languages/html5/js/register.js

    r599 r1598  
    5252    if ( needs.length ) {
    5353
    54         messagebox( {
     54        ga.msg.box( {
    5555            icon  : "warning.png",
    5656            text  : msg,
  • languages/html5/js/repeat.js

    r1363 r1598  
    380380    __~debug:pull{else { console.log( "ga.repeat.change() did not find pull json for id " + id );} }
    381381
    382     resetHoverHelp();
     382    ga.hhelp.reset();
    383383}
    384384
  • languages/html5/js/valid.js

    r1363 r1598  
    1010      $( tag1 + "_msg" ).html( " does not match" );
    1111   } else {
    12       $( tag1 + "_msg" ).html( "" );
     12      $( tag1 + "_msg" ).empty();
    1313   }
    1414}
     
    3636        else {
    3737            ok = 1;
    38             $( tag + "_msg" ).html("");
     38            $( tag + "_msg" ).empty();
    3939        }
    4040    }   
     
    8080                $( tag + "_msg" ).html( " value set to maximum allowed" );
    8181            } else {                                                             
    82                 $( tag + "_msg" ).html( "" );
     82                $( tag + "_msg" ).empty();
    8383            }
    8484        }
     
    121121                    t.val( parseInt( parseFloat( fieldValue ) + .5 ) );
    122122                } else {
    123                     $( tag + "_msg" ).html( "" );
     123                    $( tag + "_msg" ).empty();
    124124                }
    125125            }
     
    137137       $( tag + "_msg" ).html( "Not an acceptable filename, reset to default" );
    138138   } else {
    139        $( tag + "_msg" ).html( "" );
     139       $( tag + "_msg" ).empty();
    140140   }
    141141}
     
    215215   }
    216216
     217   ga.valid.clearerrorcounter( module );
     218   
    217219   for ( i in ga.altfile.bdata[ module ] ) {
    218220      if ( ga.altfile.bdata[ module ][ i ].req  ) {
    219221          //console.log( "ga.altfile.bdata[ module ][ i ].req = " +  ga.altfile.bdata[ module ][ i ].req);
    220222          switch ( ga.altfile.bdata[ module ][ i ].req ) {
    221               case "lrfile" : ok = ok && ga.valid.checkLrfile( "#" + i ); if ($("#" + i).length && !ga.valid.checkLrfile( "#" + i )) {++ga.fielderrors;} break;
    222               case "rpath"  : ok = ok && ga.valid.checkRpath ( "#" + i ); if ($("#" + i).length && !ga.valid.checkRpath ( "#" + i )) {++ga.fielderrors;} break;
    223               case "rfile"  : ok = ok && ga.valid.checkRfile ( "#" + i ); if ($("#" + i).length && !ga.valid.checkRfile ( "#" + i )) {++ga.fielderrors;} break;
     223              case "lrfile" : ok = ok && ga.valid.checkLrfile( "#" + i ); if ($("#" + i).length && !ga.valid.checkLrfile( "#" + i )) {++ga.fielderrors[module];} break;
     224              case "rpath"  : ok = ok && ga.valid.checkRpath ( "#" + i ); if ($("#" + i).length && !ga.valid.checkRpath ( "#" + i )) {++ga.fielderrors[module];} break;
     225              case "rfile"  : ok = ok && ga.valid.checkRfile ( "#" + i ); if ($("#" + i).length && !ga.valid.checkRfile ( "#" + i )) {++ga.fielderrors[module];} break;
    224226              default       : console.log( "ga.valid.checksubmit() unsupported required check " +  ga.altfile.bdata[ module ][ i ].req ); break;
    225227          }
     
    232234            switch ( ga.value.types[ module ][ i ].req ) {
    233235            case "float":
    234                 if ($("#" + i).length && !ga.valid.checkFloat( "#" + i )) {++ga.fielderrors;}
     236                if ($("#" + i).length && !ga.valid.checkFloat( "#" + i )) {++ga.fielderrors[module];}
    235237                break;
    236238            case "integer":
    237                 if ($("#" + i).length && !ga.valid.checkInt( "#" + i )) {++ga.fielderrors;}
     239                if ($("#" + i).length && !ga.valid.checkInt( "#" + i )) {++ga.fielderrors[module];}
    238240                break;
    239241            case "text":
    240                 if ($("#" + i).length && !ga.valid.checkText( "#" + i )) {++ga.fielderrors;}
     242                if ($("#" + i).length && !ga.valid.checkText( "#" + i )) {++ga.fielderrors[module];}
    241243                //console.log( "pattern of " + i + ": " + $('#'+i).attr("pattern") );
    242244                //console.log( "text_req Check: " +  ga.valid.checkText( "#" + i ));
    243245                break; 
    244246            case "file":
    245                 if ($("#" + i).length && !ga.valid.checkLrfile( "#" + i )) {++ga.fielderrors;}
     247                if ($("#" + i).length && !ga.valid.checkLrfile( "#" + i )) {++ga.fielderrors[module];}
    246248                break;
    247249            default:
     
    252254    }
    253255   
    254     if (ga.fielderrors > 0)
     256    if (ga.fielderrors[module] > 0)
    255257    {
    256258        ok = 0;
    257259    }
    258260   
    259     //console.log( "ga.fielderrors = " + ga.fielderrors );     
     261    //console.log( "ga.fielderrors = " + ga.fielderrors[module] );     
    260262    return ok;
    261263}
    262264
    263 ga.valid.showerrormessage = function() {
    264     messagebox( {
     265ga.valid.showerrormessage = function( module ) {
     266    ga.msg.box( {
    265267        icon : "warning.png",
    266         text : "" + ga.fielderrors + " fields are missing or not set correctly!",
     268        text : "" + ga.fielderrors[ module ] + " fields are missing or not set correctly!",
    267269        buttons : [
    268270            { id    : "ok",
    269271              label : "OK" } ]
    270272    });
    271     ga.fielderrors = 0;
    272 }
    273 
    274 ga.valid.clearerrorcounter = function() {
    275     ga.fielderrors = 0;
     273    ga.fielderrors[ module ] = 0;
     274}
     275
     276ga.valid.clearerrorcounter = function( module ) {
     277    ga.fielderrors[ module ] = 0;
    276278}
    277279
     
    297299
    298300    if ( !a.resources || !a.resources.length ) {
    299         messagebox( {
     301        ga.msg.box( {
    300302            icon  : "warning.png"
    301303            ,text  : "No resources currently enabled for Airavata submission"
     
    341343            msg += '</table>';
    342344
    343             messagebox( {
     345            ga.msg.box( {
    344346                icon     : "question.png"
    345347                ,text    : msg
     
    351353        default :
    352354        {
    353             messagebox( {
     355            ga.msg.box( {
    354356                icon  : "toast.png"
    355357                ,text  : "ga.airavata.select, unknown selection type '" + selecttype + "'"
     
    391393
    392394    if ( !a || !a.length ) {
    393         messagebox( {
     395        ga.msg.box( {
    394396            icon  : "warning.png"
    395397            ,text  : "No XSEDE projects currently defined.  Create one under the user configuration button at the top right."
     
    420422    msg += '</table>';
    421423
    422     messagebox( {
     424    ga.msg.box( {
    423425        icon     : "question.png"
    424426        ,text    : msg
  • languages/html5/js/value.js

    r1363 r1598  
    2929                    value.push( t.attr( "max" ) );
    3030                } else {
    31                     $( tag + "_msg" ).html( "" );
     31                    $( tag + "_msg" ).empty();
    3232                }
    3333            }
     
    5656                            value.push( parseInt( parseFloat( temp_int ) + .5 ) );
    5757                        } else {
    58                             $( tag + "_msg" ).html( "" );
     58                            $( tag + "_msg" ).empty();
    5959                        }
    6060                    }
     
    143143               t = ids_array[i] + "-" + j; // For CHECKBOXES for now...
    144144                //console.log(t);
    145                formData.delete( t ); 
     145               formData.delete( t );
    146146           }
    147147        }
     
    223223                {
    224224                    __~debug:values{ console.log( "Achtung!!! " +  elements[i]); }
    225                     messagebox( {
     225                    ga.msg.box( {
    226226                        icon : "warning.png",
    227227                        text : "Wrong format of the input file! Input value on the line #" + lineNumberErr + " is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     
    238238                if ( !( ga.value.checkFloatIntOK("#" + ids_array[i], value) ) )
    239239                {
    240                     messagebox( {
     240                    ga.msg.box( {
    241241                        icon : "warning.png",
    242242                        text : "Wrong format of the input file! Input value on the line #" + lineNumberErr + " is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     
    254254                break; 
    255255            default:
    256                 messagebox( {
     256                ga.msg.box( {
    257257                    icon : "warning.png",
    258258                    text : "Selected input type is currently not supported. Contact the developer",
     
    378378                {
    379379                    __~debug:values{ console.log( "Achtung!!! " +  elements[i]); }
    380                     messagebox( {
     380                    ga.msg.box( {
    381381                        icon : "warning.png",
    382382                        text : "Wrong format of the input file! Input value on the line #" + lineNumberErr + " is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     
    393393                if ( !( ga.value.checkFloatIntOK("#" + ids_array[i], value) ) )
    394394                {
    395                     messagebox( {
     395                    ga.msg.box( {
    396396                        icon : "warning.png",
    397397                        text : "Wrong format of the input file! Input value on the line #" + lineNumberErr + " is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     
    409409                break; 
    410410            default:
    411                 messagebox( {
     411                ga.msg.box( {
    412412                    icon : "warning.png",
    413413                    text : "Selected input type is currently not supported. Contact the developer",
     
    449449                    {
    450450                        __~debug:values{ console.log( "Achtung!!! " +  elements[i]); }
    451                         messagebox( {
     451                        ga.msg.box( {
    452452                            icon : "warning.png",
    453453                            text : "Wrong format of the input file! Checkbox input value on the line #" + lineNumberErr + " is not valid. Options are: [1 | 0 | yes | no | true | false | t | f | T | F | y | n | Y | N ]. Check your input file",
     
    463463                    if ( !( ga.value.checkFloatIntOK("#" + ids_array[i], value) ) )
    464464                    {
    465                         messagebox( {
     465                        ga.msg.box( {
    466466                            icon : "warning.png",
    467467                            text : "Wrong format of the input file! Input value on the line #" + lineNumberErr + " is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     
    482482                    {
    483483                        __~debug:values{ console.log( "Achtung!!! " +  elements[i]); }
    484                         messagebox( {
     484                        ga.msg.box( {
    485485                            icon : "warning.png",
    486486                            text : "Wrong format of the input file! Input value on the line #" + lineNumberErr + " is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     
    493493                    break;
    494494                default:
    495                     messagebox( {
     495                    ga.msg.box( {
    496496                        icon : "warning.png",
    497497                        text : "Selected input type is currently not supported. Contact the developer",
     
    507507        else
    508508        {
    509             messagebox( {
     509            ga.msg.box( {
    510510                icon : "warning.png",
    511511                text : "Wrong format of the input file! Number of parameters is inconsistent with the model chosen. Check your parameter file",
     
    518518        break;
    519519    default:
    520         messagebox( {
     520        ga.msg.box( {
    521521            icon : "warning.png",
    522522            text : "Selected file parsing mode is currently not supported. Contact the developer",
     
    717717                $( "#global_data" ).data( dv, t.html() );
    718718                break;
    719             case "plot2d" :
     719            case "plot3d" :
     720            case "plotly" :
     721            __~debug:plotly{console.log("PLOT3D: " + tag);}
     722                var tag_s = tag;
     723                tag_s = tag_s.replace(/^#/, "");
     724            __~debug:plotly{console.log("PLOT3D: " + tag_s);}
     725                Plotly.newPlot(tag_s,[],{});
     726                Plotly.purge(tag_s);
     727                break;
     728            case "plot2d" :
    720729               __~debug:values{console.log( "ga.value.setLastValue() on undefined plot2d not yet: " + tl );}
    721730               __~debug:plottwod{console.log( "ga.value.setLastValue() on undefined plot2d not yet: " + tl );}
     731               break;
     732            case "ngl" :
     733               ga.ngl.clear( tl, tag );
    722734               break;
    723735            case "bokeh" :
     
    762774                  } else {
    763775__~debug:values{        console.log( "ga.value.setLastValue() atomic structure global data NOT found for tag " + stag );}
    764                       t.html("");
     776                      t.empty();
    765777                  }
    766778                  break;
     
    777789                     }
    778790                     break;
     791            case "plot3d" :
     792            case "plotly" :
     793            __~debug:values{console.log( "ga.value.setLastValue() on plotly trying" );}
     794                     var ptly = gd.data( tl );
     795                     if ( ptly.data ) {
     796                         Plotly.plot(tag.replace( /^#/, "" ), ptly.data, ptly.layout);
     797                     }
     798                     break;
    779799            case "bokeh" :
    780800                    __~debug:values{console.log( "ga.value.setLastValue() bokeh" );}
    781801                    __~debug:bokeh{console.log( "ga.value.setLastValue() bokeh" );}
    782802                     break;
     803            case "ngl" :
     804                var ngld = gd.data( tl );
     805                if ( ngld ) {
     806                    ga.value.nglshow( pkg, tag.replace(/^#/, ""), ngld );
     807                }
     808                break;
    783809            case "filelink" :
    784810            case "filelinkm" :
     
    842868ga.value.resetDefaultValue = function( pkg, tag ) {
    843869__~debug:values{   console.log( "ga.value.resetDefaultValue( " + pkg + " , " + tag + " )" );}
     870    __~debug:resetvalues{console.log( "ga.value.resetDefaultValue( " + pkg + " , " + tag + " )" );}
    844871   var t = $( tag );
     872   var tl;
    845873__~debug:values{   console.log( "ga.value.resetDefaultValue() type:" + t.attr( "type" ) );}
    846874__~debug:values{   console.log( "ga.value.resetDefaultValue() tagname:" + t.prop( "tagName" ) );}
     
    850878      switch( t.attr( "type" ) )
    851879      {
     880          case "ngl" : {
     881              tl = pkg + ":" + tag + ":last_value";
     882              ga.ngl.clear( tl, tag );
     883
     884//              tl = pkg + ":" + tag + ":last_value";
     885//              if ( ga.stage[ tl ] ) {
     886//                  ga.stage[ tl ].dispose();
     887//                  delete ga.stage[ tl ];
     888//              }
     889//              $( tag + "_plot" ).empty();
     890//              $( "#global_data" ).removeData( tl );
     891          }
     892          break;
     893
    852894          case "file" : __~debug:values{console.log( "ga.value.resetDefaultValue() file set is insecure, skipped" );} return; break;
    853895          case "checkbox" :
     
    865907          case "plot2d" :
    866908__~debug:plottwod{                     console.log( "ga.value.resetDefaultValue() plot2d" );}
     909                        console.log( "ga.value.resetDefaultValue() plot2d, t is " + tag );
    867910                        $( "#global_data" ).data( pkg + ":" + tag + ":last_value", [[]] );
    868911                        ga.value.clear.plot2d( tag );
    869                         t.plot( [[]], ga.value.get.plot2d.plot_options( tag ) ); break;
     912                        t.plot( [[]], ga.value.get.plot2d.plot_options( tag ) );
     913                        //if (ga.showcollapse2d)
     914                       if($( tag + "_showcollapse" ).length)
     915                        {
     916                            $( tag + "_div").hide();
     917                           
     918                            if( $( tag + "_savetofile").length )
     919                            {
     920                                $( tag + "_savetofile").hide();
     921                                $( tag + "_savetofile_link").hide();
     922                            }
     923                            if( $( tag + "_changescalex").length )
     924                            {
     925                                $( tag + "_changescalex").hide();
     926                                $( tag + "_changescalex_message").hide();
     927                            }
     928                            if( $( tag + "_changescaley").length )
     929                            {
     930                                $( tag + "_changescaley").hide();
     931                                $( tag + "_changescaley_message").hide();
     932                            }
     933                            if ( $( tag + "_showcollapse" ).length )
     934                            {
     935                                $(tag + "_showcollapse").addClass( "hidden" );
     936                            }
     937                        }
    870938                        break;
    871939          case "bokeh" :
     
    873941              ga.bokeh.reset( pkg, tag.replace( /^#/, "" ) );
    874942              break;
     943          case "plot3d" :
     944          case "plotly" :
     945              console.log( "reset default value for plot3d: " + tag );
     946              Plotly.purge(tag.replace( /^#/, "" ));
     947              if ( $( tag + "_showcollapse" ).length )
     948                {
     949                    $(tag + "_showcollapse").addClass( "hidden" );
     950                }
     951              break;
    875952          case "image" :
    876953          __~debug:image{console.log( "reset default value for image" );}
    877           t.html("");
     954          t.empty();
    878955          break;
    879956          case "video" :
    880957          __~debug:video{console.log( "reset default value for video" );}
    881           t.html("");
     958          t.empty();
    882959          break;
    883960
     
    886963__~debug:values{                         console.log( "ga.value.resetDefaultValue() atomic structure " + pkg + ":" + tag + ":last_value" );}
    887964                        $( "#global_data" ).data( pkg + ":" + tag + ":last_value", "" );
    888                         $( tag ).html("");
     965                        $( tag ).empty();
    889966                        break;
    890967          default: t.val( t.attr( "value" ) ); break;
     
    892969   }
    893970   ga.value.saveLastValue( pkg, tag );
    894    $( tag + "_msg" ).html("");
     971   $( tag + "_msg" ).empty();
    895972}
    896973
    897974ga.value.resetDefaultValues = function( pkg, msgs ) {
    898 __~debug:values{   console.log( "ga.value.resetDefautValues( " + pkg + " )" );}
     975    __~debug:values{console.log( "ga.value.resetDefautValues( " + pkg + " )" );}
     976    __~debug:resetvalues{console.log( "ga.value.resetDefautValues( " + pkg + " )" );}
    899977    var i,
    900978    hmod_textarea;
     
    9221000
    9231001ga.value.extra_resets = function( id ) {
    924 __~debug:values{     console.log( "ga.value.extra_resets( " + id + " )" );}
     1002    __~debug:values{console.log( "ga.value.extra_resets( " + id + " )" );}
     1003    __~debug:resetvalues{console.log( "ga.value.extra_resets( " + id + " )" );}
    9251004    ga.value.extra_resets.data = ga.value.extra_resets.data || {};
    9261005    ga.value.extra_resets.data[ id ] = 1;
     
    9281007
    9291008ga.value.extra_resets.clear = function() {
    930 __~debug:values{     console.log( "ga.value.extra_resets.clear()" );}
     1009    __~debug:values{console.log( "ga.value.extra_resets.clear()" );}
     1010    __~debug:resetvalues{console.log( "ga.value.extra_resets.clear()" );}
    9311011    ga.value.extra_resets.data = {};
    9321012}
    9331013   
    934 
    9351014ga.value.setLastValueOutput = function( mod ) {
    9361015__~debug:values{     console.log( "ga.value.setLastValueOutput( " + mod + " )" );}
     
    9811060        tagxy     = tag + "_xy";
    9821061
    983     $( tagtitle  ).html("");
    984     $( tagxlabel ).html("");
    985     $( tagylabel ).html("");
    986     $( tagxy     ).html("");
     1062    $( tagtitle  ).empty();
     1063    $( tagxlabel ).empty();
     1064    $( tagylabel ).empty();
     1065    $( tagxy     ).empty();
    9871066}
    9881067
     
    12251304    return "";
    12261305};
     1306
     1307ga.ngl = {};
     1308
     1309ga.ngl.types = [
     1310    "backbone"
     1311    ,"ball+stick"
     1312//    ,"base"
     1313    ,"cartoon"
     1314    ,"contact"
     1315//    ,"crossing"
     1316    ,"helixorient"
     1317    ,"hyperball"
     1318    ,"label"
     1319    ,"licorice"
     1320    ,"line"
     1321    ,"point"
     1322    ,"ribbon"
     1323    ,"rocket"
     1324    ,"rope"
     1325    ,"spacefill"
     1326    ,"surface"
     1327    ,"trace"
     1328    ,"tube"
     1329];
     1330
     1331// ga.ngl.types = [
     1332//    "cartoon"
     1333//    ,"spacefill"
     1334//];
     1335
     1336ga.ngl.clear = function ( tl, tid ) {
     1337    if ( ga.ngl[ tl ] ) {
     1338        if ( ga.ngl[ tl ].stage ) {
     1339            ga.ngl[ tl ].stage.dispose();
     1340        }
     1341        delete ga.ngl[ tl ];
     1342    }
     1343    $( tid + "_plot" ).empty();
     1344    $( tid + "_buttons" ).empty();
     1345    $( "#global_data" ).removeData( tl );
     1346}
     1347
     1348ga.value.nglshow = function( mod, id, v ) {
     1349    __~debug:ngl{console.log( "ga.value.nglshow( " + mod + " , " + id  + " , " + JSON.stringify( v ) + " )" );}
     1350    var tid = "#" + id;
     1351    ga.ngl = ga.ngl || {};
     1352    var savekey = mod + ":" + tid + ":last_value";
     1353    ga.ngl.clear( savekey, tid );
     1354    if ( v.loadname ) {
     1355        if ( !v.loadparams ) {
     1356            v.loadparams = {};
     1357        }
     1358        if ( !v.representation ) {
     1359            v.representation = "cartoon";
     1360        }
     1361        ga.ngl[ savekey ] = {};
     1362        ga.ngl[ savekey ].stage = new NGL.Stage( id + "_plot" );
     1363        ga.ngl[ savekey ].stage.loadFile( v.loadname, v.loadparams ).then( function (component) {
     1364            ga.ngl[ savekey ].component = component;
     1365            ga.ngl[ savekey ].reps = {};
     1366            ga.ngl[ savekey ].reps[ v.representation ] = component.addRepresentation( v.representation );
     1367            // provide a "good" view of the structure
     1368            component.autoView();
     1369           
     1370            var al = ga.ngl.types.length;
     1371            var htmladd = "";
     1372            var evaladd = "";
     1373            for ( var i = 0; i < al; ++i ) {
     1374                htmladd += '<button id="' + ga.ngl.types[ i ].replace( '+', '' ) + '">' + ga.ngl.types[ i ] + '</button>';
     1375                evaladd += '$("#' + ga.ngl.types[ i ].replace( '+', '' ) + '").on("click", function() { var sk = ga.ngl["' + savekey + '"]; var comp = sk.component; var crep = sk.reps["' + ga.ngl.types[ i ] + '"]; if ( comp && crep ) { comp.removeRepresentation( crep ); delete sk.reps["' + ga.ngl.types[ i ] + '"]; } else { sk.reps["' + ga.ngl.types[ i ] + '"] = comp.addRepresentation("' + ga.ngl.types[ i ] + '");} return false; });';
     1376            }
     1377            $( tid + "_buttons" ).html( htmladd );
     1378            __~debug:ngl{console.log( evaladd );}
     1379            eval ( evaladd );
     1380        });
     1381        $( "#global_data" ).data( savekey , v );
     1382    }
     1383    ga.value.extra_resets( id );
     1384}   
  • languages/html5/js/valuen.js

    r519 r1598  
    3434    //}
    3535
    36     $( hform + " .field_msg" ).html("");
     36    $( hform + " .field_msg" ).empty();
    3737
    3838    // add repeaters repeatedly until no more unassigned repeaters exist
  • languages/html5/license-base.php

    r910 r1598  
    3232    // check mongo
    3333    try {
    34         $m = new MongoClient();
     34        $m = new MongoClient(
     35            __~mongo:url{"__mongo:url__"}
     36            __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]
     37            );
    3538    } catch ( Exception $e ) {
    3639        $db_error = "Error connecting to the database. " . $e->getMessage();
  • languages/html5/register-base.php

    r1363 r1598  
    4545    // check mongo
    4646    try {
    47         $m = new MongoClient();
     47        $m = new MongoClient(
     48             __~mongo:url{"__mongo:url__"}
     49             __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     50             );
    4851    } catch ( Exception $e ) {
    4952        $db_error = "Error connecting to the database. " . $e->getMessage();
  • languages/html5/sys/cache_remove_one.php

    r835 r1598  
    3030   
    3131try {
    32     $m = new MongoClient();
     32    $m = new MongoClient(
     33        __~mongo:url{"__mongo:url__"}
     34        __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     35    );
    3336} catch ( Exception $e ) {
    3437    $results[ 'error' ] .= "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/cached_results.php

    r818 r1598  
    4747   if ( !isset( $use_db ) ) {
    4848      try {
    49          $use_db = new MongoClient();
     49         $use_db = new MongoClient(
     50         __~mongo:url{"__mongo:url__"}
     51         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     52         );
    5053      } catch ( Exception $e ) {
    5154         $db_errors = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/joblog.php

    r1363 r1598  
    1111   {
    1212      try {
    13          $use_db = new MongoClient();
     13         $use_db = new MongoClient(
     14         __~mongo:url{"__mongo:url__"}
     15         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     16         );
    1417      } catch ( Exception $e ) {
    1518         $db_errors = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_captcha.php

    r952 r1598  
    106106
    107107try {
    108     $m = new MongoClient();
     108    $m = new MongoClient(
     109        __~mongo:url{"__mongo:url__"}
     110        __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     111        );
    109112} catch ( Exception $e ) {
    110113    $results[ 'error' ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_captcha_verify.php

    r540 r1598  
    2828$now = new MongoDate();
    2929try {
    30     $m = new MongoClient();
     30    $m = new MongoClient(
     31         __~mongo:url{"__mongo:url__"}
     32         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     33    );
    3134} catch ( Exception $e ) {
    3235    $results[ 'error' ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_jobintegritycheck.php

    r1363 r1598  
    5353   if ( !isset( $use_db ) ) {
    5454      try {
    55          $use_db = new MongoClient();
     55         $use_db = new MongoClient(
     56         __~mongo:url{"__mongo:url__"}
     57         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     58         );
    5659      } catch ( Exception $e ) {
    5760         $db_errors = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_jobmonitor.php

    r549 r1598  
    6161   if ( !isset( $use_db ) ) {
    6262      try {
    63          $use_db = new MongoClient();
     63         $use_db = new MongoClient(
     64             __~mongo:url{"__mongo:url__"}
     65             __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     66             );
    6467      } catch ( Exception $e ) {
    6568         $db_errors = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_license.php

    r525 r1598  
    1414}
    1515
     16session_write_close();
     17
    1618if ( !isset( $_SESSION[ $window ][ 'logon' ] ) ||
    1719     !isset( $_REQUEST[ '_logon' ] ) )
     
    2325
    2426try {
    25     $m = new MongoClient();
     27    $m = new MongoClient(
     28         __~mongo:url{"__mongo:url__"}
     29         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     30         );
    2631} catch ( Exception $e ) {
    2732    $results[ 'error' ] .= "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_login.php

    r1363 r1598  
    4343// connect
    4444try {
    45      $m = new MongoClient();
     45     $m = new MongoClient(
     46         __~mongo:url{"__mongo:url__"}
     47         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     48         );
    4649} catch ( Exception $e ) {
    4750    $results[ "error" ] = "Could not connect to the db " . $e->getMessage();
     
    480483   }
    481484
    482    $results[ 'status' ] = $addstat . "Login successful";
     485   $results[ 'status' ] = $addstat . "Login successful. ";
    483486   $results[ '_logon' ] = $userid;
    484487   $_SESSION[ $window ][ 'logon' ] = $userid;
    485488   $_SESSION[ $window ][ 'app'   ] = "__application__";
    486489   session_commit();
     490
     491   # store session id
     492   {
     493       $msession = $m->__application__->session;
     494       try {
     495           $msession->update( [ "_id"  => session_id() ],
     496                              [ '$set' => [ "name" => $userid ] ],
     497                              [ 'upsert' => true
     498                              __~mongojournal{, writeConcern => [ "j" => true ]}
     499                              ] );
     500       } catch(MongoCursorException $e) {
     501           $results[ 'status' ] .= "Unable to store session id. ";
     502       }
     503   }
    487504
    488505   if ( isset( $doc[ "groups" ] ) ) {
  • languages/html5/sys/sys_login_globus.php

    r1363 r1598  
    4343// connect
    4444try {
    45      $m = new MongoClient();
     45     $m = new MongoClient(
     46         __~mongo:url{"__mongo:url__"}
     47         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     48         );
    4649} catch ( Exception $e ) {
    4750    $results[ "error" ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_login_google.php

    r1363 r1598  
    4343// connect
    4444try {
    45      $m = new MongoClient();
     45     $m = new MongoClient(
     46         __~mongo:url{"__mongo:url__"}
     47         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     48     );
    4649} catch ( Exception $e ) {
    4750    $results[ "error" ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_manageusers.php

    r1363 r1598  
    5656   if ( !isset( $use_db ) ) {
    5757      try {
    58          $use_db = new MongoClient();
     58         $use_db = new MongoClient(
     59        __~mongo:url{"__mongo:url__"}
     60        __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     61        );
    5962      } catch ( Exception $e ) {
    6063         $db_errors = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_pull.php

    r729 r1598  
    4444   $results[ 'error'  ] = 'Possible security violation user mismatch. ';
    4545   try {
    46       $m = new MongoClient();
     46      $m = new MongoClient(         
     47         __~mongo:url{"__mongo:url__"}
     48         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     49         );
    4750   } catch ( Exception $e ) {
    4851      $results[ 'error' ] .= "Could not connect to the db " . $e->getMessage();
     
    9194
    9295try {
    93      $m = new MongoClient();
     96     $m = new MongoClient(
     97         __~mongo:url{"__mongo:url__"}
     98         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     99     );
    94100} catch ( Exception $e ) {
    95101    $results = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_register.php

    r1363 r1598  
    7070// connect
    7171try {
    72      $m = new MongoClient();
     72     $m = new MongoClient(
     73         __~mongo:url{"__mongo:url__"}
     74         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     75         );
    7376} catch ( Exception $e ) {
    7477    $results[ "error" ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_register_globus.php

    r1363 r1598  
    7070// connect
    7171try {
    72      $m = new MongoClient();
     72     $m = new MongoClient(
     73        __~mongo:url{"__mongo:url__"}
     74        __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     75     );
    7376} catch ( Exception $e ) {
    7477    $results[ "error" ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_register_google.php

    r1363 r1598  
    7070// connect
    7171try {
    72      $m = new MongoClient();
     72     $m = new MongoClient(
     73         __~mongo:url{"__mongo:url__"}
     74         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     75         );
    7376} catch ( Exception $e ) {
    7477    $results[ "error" ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_status.php

    r1561 r1598  
    106106      $mongook = 1;
    107107      try {
    108           $m = new MongoClient();
     108          $m = new MongoClient(
     109              __~mongo:url{"__mongo:url__"}
     110              __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     111          );
    109112      } catch ( Exception $e ) {
    110113          $results[ 'error' ] .= "Could not connect to the db " . $e->getMessage();
     
    130133          $mongook = 1;
    131134          try {
    132               $m = new MongoClient();
     135              $m = new MongoClient(
     136                  __~mongo:url{"__mongo:url__"}
     137                  __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     138                  );
    133139          } catch ( Exception $e ) {
    134140              $results[ 'error' ] .= "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_uid.php

    r1363 r1598  
    4444   $mj = '__docroot:html5__/__application__/etc/module_' . $currentmodule . '.php';
    4545     
    46    $contents = file_get_contents($mj);
    47    if (!strpos($contents, '"multistage"')) continue;
     46   if (file_exists($mj))
     47   {   
     48       $contents = file_get_contents($mj);
     49       $pos = strpos($contents, '"multistage"');
    4850
    49    require_once $mj;
     51       if ($pos === false) continue;
     52
     53       require_once $mj;
    5054   
    51    //$fileStr .= 'require_once "' . $mj . '";';
    52    //$fileStr .= "require_once \"" . $mj . "\";";
    53    //$fileStr = 'require_once "' . $mj . '";';
    54    //$fileStr = 'require ("' . $mj . '");';
    55    //array_push($toeval,$fileStr);     
     55        //$fileStr .= 'require_once "' . $mj . '";';
     56        //$fileStr .= "require_once \"" . $mj . "\";";
     57        //$fileStr = 'require_once "' . $mj . '";';
     58        //$fileStr = 'require ("' . $mj . '");';
     59        //array_push($toeval,$fileStr);
    5660 
    5761
    58    foreach ( $GLOBALS[ 'modulejson' ][ $currentmodule ]->fields as $v ) {
    59         if ( isset( $v->multistage ) ){
    60             //$response[ 'moduleinfo' ][ $currentmodule ] = json_decode( '$v->multistage' );
    61             $response[ 'moduleinfo' ][ $currentmodule ] = $v->multistage;
    62         }
    63    }
    64 }
     62        foreach ( $GLOBALS[ 'modulejson' ][ $currentmodule ]->fields as $v ) {
     63                if ( isset( $v->multistage ) ){
     64                //$response[ 'moduleinfo' ][ $currentmodule ] = json_decode( '$v->multistage' );
     65                $response[ 'moduleinfo' ][ $currentmodule ] = $v->multistage;
     66                }
     67        }
     68    }
     69}       
    6570//eval($fileStr);
    6671//for ($i = 0; $i < count($toeval); ++$i) {
  • languages/html5/sys/sys_user_config.php

    r1363 r1598  
    3838   $results[ 'error'  ] = 'Possible security violation user mismatch. ';
    3939   try {
    40       $m = new MongoClient();
     40      $m = new MongoClient(
     41         __~mongo:url{"__mongo:url__"}
     42         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     43      );
    4144   } catch ( Exception $e ) {
    4245      $results[ 'error' ] .= "Could not connect to the db " . $e->getMessage();
     
    7881
    7982try {
    80      $m = new MongoClient();
     83     $m = new MongoClient(
     84         __~mongo:url{"__mongo:url__"}
     85         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     86         );
    8187} catch ( Exception $e ) {
    8288    $results[ 'error' ] = "Could not connect to the db " . $e->getMessage();
  • languages/html5/sys/sys_userslist.php

    r1363 r1598  
    5454   if ( !isset( $use_db ) ) {
    5555      try {
    56          $use_db = new MongoClient();
     56         $use_db = new MongoClient(
     57         __~mongo:url{"__mongo:url__"}
     58         __~mongo:cafile{,[], [ "context" => stream_context_create([ "ssl" => [ "cafile" => "__mongo:cafile__" ] ] ) ]}
     59         );
    5760      } catch ( Exception $e ) {
    5861         $db_errors = "Could not connect to the db " . $e->getMessage();
  • languages/html5/types/bokeh.output

    r1363 r1598  
    1 <tr><td><label for="__fields:id__">__fields:label__ </label></td><td><div name="__fields:id__" id="__fields:id__" type="bokeh"></div></td></tr>
     1</table>
     2
     3__~fields:label{<p><label for="__fields:id__">__fields:label__</label></p>}
     4
     5<div name="__fields:id__" id="__fields:id__" type="bokeh"></div>
    26<script>
    37ga.value.setLastValue( "__moduleid___output", "#__fields:id__" );
    48ga.value.extra_resets( "__fields:id__" );
    59</script>
     10
     11<table>
  • languages/html5/types/input.footer

    r1363 r1598  
    6060                  __moduleid___timeout_handler = "unset";
    6161              }
    62               unsubMsging( id, "__moduleid__" );
     62              ga.ws.unsub( id, "__moduleid__" );
    6363              eval( __moduleid___done_eval );
    6464           } else {
     
    8888               __moduleid___timeout_handler = "unset";
    8989           }
    90            unsubMsging( id, "__moduleid__" );
     90           ga.ws.unsub( id, "__moduleid__" );
    9191           eval( __moduleid___done_eval );
    9292          } );
     
    107107       clearTimeout( __moduleid___timeout_handler );
    108108       if ( __moduleid___timeout_handler_uuid ) {
    109            unsubMsging( __moduleid___timeout_handler_uuid, "__moduleid__" );
     109           ga.ws.unsub( __moduleid___timeout_handler_uuid, "__moduleid__" );
    110110       }
    111111       __moduleid___timeout_handler = "unset";
     
    133133
    134134   if ( !ga.valid.checksubmit( "__moduleid__" ) ) {
    135        ga.valid.showerrormessage();
     135       ga.valid.showerrormessage( "__moduleid__" );
    136136       return false;
    137137   }
     
    182182             case "1" :
    183183             {
    184                  messagebox( { icon:"warning.png", text:"This project directory is currently locked by another project.\nYou can wait until it completes, change the project in user configuration or clear the lock in the job manager." } );
     184                 ga.msg.box( { icon:"warning.png", text:"This project directory is currently locked by another project.\nYou can wait until it completes, change the project in user configuration or clear the lock in the job manager." } );
    185185                 return;
    186186             } break;
    187187             case "2" :
    188188             {
    189                  messagebox( { icon:"warning.png", text:"You must be logged in to submit this module." } );
     189                 ga.msg.box( { icon:"warning.png", text:"You must be logged in to submit this module." } );
    190190                 return;
    191191             } break;
     
    198198             {
    199199                if ( /^Your job/.test( data ) ) {
    200                    messagebox( { icon : "warning.png",
     200                   ga.msg.box( { icon : "warning.png",
    201201                                 text : data } );
    202202                   return;
     
    213213       }
    214214       ,error: function() { // your error handler
    215           messagebox( { icon:"toast.png", text:"Checking the project lock failed. This is possibly a server or network issue" } );
     215          ga.msg.box( { icon:"toast.png", text:"Checking the project lock failed. This is possibly a server or network issue" } );
    216216       }
    217217       ,complete: function() {
     
    278278    ga.extrahidden( "__moduleid__" );
    279279
    280     subMsging( vuuid, msg___moduleid__, "__moduleid__" );
     280    ga.ws.sub( vuuid, msg___moduleid__, "__moduleid__" );
    281281
    282282    var formData = new FormData($('#__moduleid__')[0]);
     
    363363                   __moduleid___timeout_handler = "unset";
    364364               }
    365                unsubMsging( vuuid, "__moduleid__" );
     365               ga.ws.unsub( vuuid, "__moduleid__" );
    366366               eval( __moduleid___done_eval );
    367367           } else {
     
    383383               __moduleid___timeout_handler = "unset";
    384384           }
    385            unsubMsging( vuuid, "__moduleid__" );
     385           ga.ws.unsub( vuuid, "__moduleid__" );
    386386           eval( __moduleid___done_eval );
    387387          } );
     
    404404       clearTimeout( __moduleid___timeout_handler );
    405405       if ( __moduleid___timeout_handler_uuid ) {
    406            unsubMsging( __moduleid___timeout_handler_uuid, "__moduleid__" );
     406           ga.ws.unsub( __moduleid___timeout_handler_uuid, "__moduleid__" );
    407407       }
    408408       __moduleid___timeout_handler = "unset";
    409409    }
    410410    ga.event( "", "__moduleid__", "reset clicked" );
    411     ga.valid.clearerrorcounter();
     411    ga.valid.clearerrorcounter( "__moduleid__" );
    412412
    413413   if ( ga.multistage["__moduleid__"] )
     
    432432});
    433433
    434 setHoverHelp();
     434ga.hhelp.set();
    435435__~resetonload{ga.value.resetDefaultValues( "__moduleid__" );ga