Changeset 1470 in genappalpha


Ignore:
Timestamp:
May 7, 2018, 11:14:02 PM (2 years ago)
Author:
alexey
Message:

corrections for behavior od some glabal vars...

Location:
languages
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • languages/html5.json

    r1466 r1470  
    450450                    "output"     : "js/ga.js",
    451451#                    "minify"     : "copy",
    452 #                    "minify"     : "minify",
     452#                     "minify"     : "minify",
    453453#                    "minify"     : "closure",
    454454                    "inputs"     : [
  • languages/html5/add/js/ga.min.js

    r1469 r1470  
    1 var ga={tmp:{},multistage:{},stages:{},stagesdefault:{},currentstage:0,fielderrors:0,customtooltips:0,showcollapse3d:0,firstplotted3d:0,showcollapse2d:0};
     1var ga={tmp:{},multistage:{},stages:{},stagesdefault:{},currentstage:0,fielderrors:{},customtooltips:{},showcollapse3d:{},plotted3d:{},showcollapse2d:{},plotted2d:{}};
    22(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)}};
    33a.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")};
     
    7474ga.valid.safeFile=function(a){var b=$(a);b.val().match("^[a-zA-Z0-9]+([a-zA-Z0-9_.-]+|/[a-zA-Z0-9_-])+$")?$(a+"_msg").empty():(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};
    7575ga.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};
    76 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("#"+
    77 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("#"+
    78 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(){ga.msg.box({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={};
     76ga.valid.checksubmit=function(a){var b,c=1;if(!ga.altfile.bdata[a]&&!ga.value.types[a])return 1;ga.valid.clearerrorcounter(a);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[a];break;case "rpath":c=c&&ga.valid.checkRpath("#"+b);$("#"+b).length&&!ga.valid.checkRpath("#"+b)&&++ga.fielderrors[a];break;case "rfile":c=c&&ga.valid.checkRfile("#"+b);
     77$("#"+b).length&&!ga.valid.checkRfile("#"+b)&&++ga.fielderrors[a];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[a];break;case "integer":$("#"+b).length&&!ga.valid.checkInt("#"+b)&&++ga.fielderrors[a];break;case "text":$("#"+b).length&&!ga.valid.checkText("#"+b)&&++ga.fielderrors[a];
     78break;case "file":$("#"+b).length&&!ga.valid.checkLrfile("#"+b)&&++ga.fielderrors[a];break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.value.types[a][b].req)}0<ga.fielderrors[a]&&(c=0);return c};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={};
    7979ga.airavata.select=function(a,b,c,d){var f=ga.airavata.data,e="",g=[],h,q,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__"!=b?b:f.select.length?f.select:"random";switch(a){case "random":return k=Math.floor(f.resources.length*
    8080Math.random()),Object.keys(f.resources[k])[0];case "choose":g.push({id:"submit_module",label:"Submit",data:[c,d,f.resources],cb:function(a){a[0](a[1],Object.keys(a[2][$("#airavata input[name=selectresource]:checked").val()])[0])}});e='<h3>Select a compute resource and press submit</h3><form id="airavata"><table>';for(h in f.resources)for(q in f.resources[h])e+='<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_'+
     
    108108$("#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"))})};
    109109ga.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":console.log("ga.value.resetDefaultValue() plot2d, t is "+
    110 b);$("#global_data").data(a+":"+b+":last_value",[[]]);ga.value.clear.plot2d(b);c.plot([[]],ga.value.get.plot2d.plot_options(b));ga.showcollapse2d&&($(b+"_div").hide(),$(b+"_savetofile").length&&($(b+"_savetofile").hide(),$(b+"_savetofile_link").hide()),$(b+"_changescalex").length&&($(b+"_changescalex").hide(),$(b+"_changescalex_message").hide()),$(b+"_changescaley").length&&($(b+"_changescaley").hide(),$(b+"_changescaley_message").hide()),$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden"));
     110b);$("#global_data").data(a+":"+b+":last_value",[[]]);ga.value.clear.plot2d(b);c.plot([[]],ga.value.get.plot2d.plot_options(b));$(b+"_showcollapse").length&&($(b+"_div").hide(),$(b+"_savetofile").length&&($(b+"_savetofile").hide(),$(b+"_savetofile_link").hide()),$(b+"_changescalex").length&&($(b+"_changescalex").hide(),$(b+"_changescalex_message").hide()),$(b+"_changescaley").length&&($(b+"_changescaley").hide(),$(b+"_changescaley_message").hide()),$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden"));
    111111break;case "bokeh":ga.bokeh.reset(a,b.replace(/^#/,""));break;case "plot3d":case "plotly":console.log("reset default value for plot3d: "+b);Plotly.purge(b.replace(/^#/,""));$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden");break;case "image":c.empty();break;case "video":c.empty();break;case "atomicstructure":b.replace(/^#/,"");$("#global_data").data(a+":"+b+":last_value","");$(b).empty();break;default:c.val(c.attr("value"))}ga.value.saveLastValue(a,b);$(b+"_msg").empty()};
    112112ga.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())};
     
    148148ga.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)}})}};
    149149ga.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")}};
    150 ga.data.update=function(a,b,c,d){var f=0,e=0,g=0,h=0,q=0,k=a+"_output",r="#"+k,n=$(r),z={},u=r+"_msgs",x=$(u),m,v,y,B,w,C,A;c&&($("#"+a+"_progress").empty(),x.text(""));$.each(b,function(p,l){A=n.find("#"+p);if(A.length)switch(f||(x.text(""),f=1),A.attr("type")){case "plot3d":case "plotly":m="#"+p;l.layout=$.extend({},l.layout,{showlegend:!1});ga.plot3dglobal=l.layout;ga.dataplot3dglobal=l.data;ga.plotted3d=0;$(m+"_showcollapse").length&&$(m+"_showcollapse").removeClass("hidden");Plotly.plot(p,l.data,
    151 l.layout);ga.showcollapse3d&&(ga.plotted3d=1,$(m+"_showcollapse").trigger("click"));y=k+":#"+p+":last_value";$("#global_data").data(y,l);break;case "plot2d":m="#"+p;ga.value.plot2d.zstack.reset(m);if(l.data){if(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)),ga.customtooltips){var u=null;$(m).bind("plothover",function(a,b,c){c?u!=c.dataIndex&&(u=c.dataIndex,$("#rtooltip").remove(),c.datapoint[0].toFixed(2),
     150ga.data.update=function(a,b,c,d){var f=0,e=0,g=0,h=0,q=0,k=a+"_output",r="#"+k,n=$(r),z={},u=r+"_msgs",x=$(u),m,v,y,B,w,C,A;c&&($("#"+a+"_progress").empty(),x.text(""));$.each(b,function(p,l){A=n.find("#"+p);if(A.length)switch(f||(x.text(""),f=1),A.attr("type")){case "plot3d":case "plotly":m="#"+p;l.layout=$.extend({},l.layout,{showlegend:!1});ga.plot3dglobal=l.layout;ga.dataplot3dglobal=l.data;ga.plotted3d[a]=0;$(m+"_showcollapse").length&&$(m+"_showcollapse").removeClass("hidden");Plotly.plot(p,
     151l.data,l.layout);ga.showcollapse3d[a]&&(ga.plotted3d[a]=1,$(m+"_showcollapse").trigger("click"));y=k+":#"+p+":last_value";$("#global_data").data(y,l);break;case "plot2d":m="#"+p;ga.value.plot2d.zstack.reset(m);if(l.data){if(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)),ga.customtooltips[a]){var u=null;$(m).bind("plothover",function(a,b,c){c?u!=c.dataIndex&&(u=c.dataIndex,$("#rtooltip").remove(),c.datapoint[0].toFixed(2),
    152152c.datapoint[1].toFixed(2),c.series.tooltips.length&&showTooltip(c.pageX,c.pageY,c.series.tooltips[c.dataIndex],c.series.color)):($("#rtooltip").remove(),u=null)})}}else $.plot(m,l,ga.value.get.plot2d.plot_options(m));$(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+
    153 "_changescaley").removeClass("hidden"),"log"==l.options.yscale?$(m+"_changescaley_message").html("Y-log"):$(m+"_changescaley_message").html("Y-lin"));$(m+"_showcollapse").length&&($(m+"_showcollapse").removeClass("hidden"),$(m).show(),ga.plotted2d=1,$(m+"_showcollapse").trigger("click"));if(ga.value.settings[m].selzoom||l.options&&l.options.selection&&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,
     153"_changescaley").removeClass("hidden"),"log"==l.options.yscale?$(m+"_changescaley_message").html("Y-log"):$(m+"_changescaley_message").html("Y-lin"));$(m+"_showcollapse").length&&($(m+"_showcollapse").removeClass("hidden"),$(m).show(),ga.plotted2d[a]=1,$(m+"_showcollapse").trigger("click"));if(ga.value.settings[m].selzoom||l.options&&l.options.selection&&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,
    154154l.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,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)},
    155155function(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)});y=k+":#"+p+":last_value";$("#global_data").data(y,l);break;case "bokeh":ga.bokeh.render(a,p,l);break;case "atomicstructure":y=k+":#"+p+":last_value";C=l.file?l.file:l;_jmol_info[p].script="set background ["+ga.colors.background+
  • languages/html5/js/data.js

    r1469 r1470  
    125125                ga.plot3dglobal     = v.layout;
    126126                ga.dataplot3dglobal = v.data;
    127                 ga.plotted3d        = 0;
     127                ga.plotted3d[ mod ] = 0;
    128128               
    129129                __~debug:plotly{console.log("Plotly JSON Options: " + JSON.stringify(v.layout));}
     
    139139                Plotly.plot(k, v.data, v.layout);
    140140                //}
    141                 if (ga.showcollapse3d)
     141                if ( ga.showcollapse3d[ mod ] )
    142142                {
    143                     ga.plotted3d=1;
     143                    ga.plotted3d[ mod ] = 1;
    144144                    $(  htag  + "_showcollapse" ).trigger( "click" );
    145145                }
     
    171171
    172172                    // play with tooltip response upon hover //////////////////////////////////////////
    173                     if (ga.customtooltips)
     173                    if ( ga.customtooltips[ mod ] )
    174174                    {
    175175                        var previousPoint = null;
     
    238238                    $(htag + "_showcollapse").removeClass( "hidden" );
    239239                    $(htag).show();
    240                     ga.plotted2d=1;
     240                    ga.plotted2d[ mod ]=1;
    241241                    $(  htag  + "_showcollapse" ).trigger( "click" );
    242242                }
  • languages/html5/js/ga_global.js

    r1468 r1470  
    1010ga.currentstage = 0;
    1111
    12 ga.fielderrors = 0;
    13 ga.customtooltips = 0;
    14 
    15 ga.showcollapse3d = 0;
    16 ga.firstplotted3d = 0;
    17 
    18 ga.showcollapse2d = 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
    1927
    2028// extend jstree for singleselect & conditional select plugins:
  • languages/html5/js/valid.js

    r1468 r1470  
    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() {
     265ga.valid.showerrormessage = function( module ) {
    264266    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
  • languages/html5/js/value.js

    r1469 r1470  
    886886                        ga.value.clear.plot2d( tag );
    887887                        t.plot( [[]], ga.value.get.plot2d.plot_options( tag ) );
    888                         if (ga.showcollapse2d)
     888                        //if (ga.showcollapse2d)
     889                       if($( tag + "_showcollapse" ).length)
    889890                        {
    890891                            $( tag + "_div").hide();
  • languages/html5/types/input.footer

    r1433 r1470  
    133133
    134134   if ( !ga.valid.checksubmit( "__moduleid__" ) ) {
    135        ga.valid.showerrormessage();
     135       ga.valid.showerrormessage( "__moduleid__" );
    136136       return false;
    137137   }
     
    409409    }
    410410    ga.event( "", "__moduleid__", "reset clicked" );
    411     ga.valid.clearerrorcounter();
     411    ga.valid.clearerrorcounter( "__moduleid__" );
    412412
    413413   if ( ga.multistage["__moduleid__"] )
  • languages/html5/types/plot2d.output

    r1434 r1470  
    5454__~fields:changescaley{ <table cellpadding="10"><tr><td><button id="__fields:id___changescaley" type="button" class="hidden">Change Y-axis Scale: Log/Lin</button></td><td><span id="__fields:id___changescaley_message" style="color:green;"></span></td></tr> </table><script> $( "#__fields:id___changescaley" ).click( function() {console.log("Inside Click: ");  if(ga.plotglobal.yscale=="log"){ga.plotglobal.yscale=""; $("#__fields:id___changescaley_message").html("Y-Lin");}else{ga.plotglobal.yscale="log";$("#__fields:id___changescaley_message").html("Y-Log");} console.dir(ga.plotglobal); var plot=$.plot( "#__fields:id__", ga.dataplotglobal, ga.value.get.plot2d.plot_options("#__fields:id__", ga.plotglobal ) ); });  </script>}
    5555
    56 __~fields:customtooltips{ <script> ga.customtooltips = 1; </script>}
     56__~fields:customtooltips{ <script> ga.customtooltips["__moduleid__"] = 1; </script>}
    5757
    5858
    59 __~fields:showcollapse{ <table cellpadding="10"><tr><td><button id="__fields:id___showcollapse" type="button" class="hidden">Show 2D plot</button></td><td><span id="__fields:id___showcollapse_message" style="color:green;"></span></td></tr> </table><script> ga.showcollapse2d=1; $("#__fields:id__").hide(); $( "#__fields:id___showcollapse" ).click( function() {console.log("Inside Click: "); if(!ga.plotted2d){ $("#__fields:id___div").show(); if($("#__fields:id___savetofile").length ){$("#__fields:id___savetofile").show();$("#__fields:id___savetofile_link").show();} if($("#__fields:id___changescalex").length ){$("#__fields:id___changescalex").show();$("#__fields:id___changescalex_message").show();} if($("#__fields:id___changescaley").length ){$("#__fields:id___changescaley").show();$("#__fields:id___changescaley_message").show();} $("#__fields:id___showcollapse").html("Hide 2D plot");console.log("show!"); ga.plotted2d=1;var plot=$.plot( "#__fields:id__", ga.dataplotglobal, ga.value.get.plot2d.plot_options("#__fields:id__", ga.plotglobal ) );}else{$("#__fields:id___div").hide(); if($("#__fields:id___savetofile").length ){$("#__fields:id___savetofile").hide();$("#__fields:id___savetofile_link").hide();} if($("#__fields:id___changescalex").length ){$("#__fields:id___changescalex").hide();$("#__fields:id___changescalex_message").hide();} if($("#__fields:id___changescaley").length ){$("#__fields:id___changescaley").hide();$("#__fields:id___changescaley_message").hide();} ga.plotted2d=0;$("#__fields:id___showcollapse").html("Show 2D plot");console.log("hide!");} });  </script>}
     59__~fields:showcollapse{ <table cellpadding="10"><tr><td><button id="__fields:id___showcollapse" type="button" class="hidden">Show 2D plot</button></td><td><span id="__fields:id___showcollapse_message" style="color:green;"></span></td></tr> </table><script> ga.showcollapse2d["__moduleid__"]=1; $("#__fields:id__").hide(); $( "#__fields:id___showcollapse" ).click( function() {console.log("Inside Click: "); if(!ga.plotted2d["__moduleid__"]){ $("#__fields:id___div").show(); if($("#__fields:id___savetofile").length ){$("#__fields:id___savetofile").show();$("#__fields:id___savetofile_link").show();} if($("#__fields:id___changescalex").length ){$("#__fields:id___changescalex").show();$("#__fields:id___changescalex_message").show();} if($("#__fields:id___changescaley").length ){$("#__fields:id___changescaley").show();$("#__fields:id___changescaley_message").show();} $("#__fields:id___showcollapse").html("Hide 2D plot");console.log("show!"); ga.plotted2d["__moduleid__"]=1;var plot=$.plot( "#__fields:id__", ga.dataplotglobal, ga.value.get.plot2d.plot_options("#__fields:id__", ga.plotglobal ) );}else{$("#__fields:id___div").hide(); if($("#__fields:id___savetofile").length ){$("#__fields:id___savetofile").hide();$("#__fields:id___savetofile_link").hide();} if($("#__fields:id___changescalex").length ){$("#__fields:id___changescalex").hide();$("#__fields:id___changescalex_message").hide();} if($("#__fields:id___changescaley").length ){$("#__fields:id___changescaley").hide();$("#__fields:id___changescaley_message").hide();} ga.plotted2d["__moduleid__"]=0;$("#__fields:id___showcollapse").html("Show 2D plot");console.log("hide!");} });  </script>}
    6060
    6161
  • languages/html5/types/plot3d.output

    r1434 r1470  
    1717
    1818
    19 __~fields:showcollapse{ <table cellpadding="10"><tr><td><button id="__fields:id___showcollapse" type="button" class="hidden">Show 3D plot</button></td><td><span id="__fields:id___showcollapse_message" style="color:green;"></span></td></tr> </table><script> ga.showcollapse3d=1; $( "#__fields:id___showcollapse" ).click( function() {console.log("Inside Click: ");  if(!ga.plotted3d){ $("#__fields:id__").show();$("#__fields:id___showcollapse").html("Hide 3D plot");console.log("show!"); ga.plotted3d=1;}else{$("#__fields:id__").hide();ga.plotted3d=0;$("#__fields:id___showcollapse").html("Show 3D plot");console.log("hide!");} });  </script>}
     19__~fields:showcollapse{ <table cellpadding="10"><tr><td><button id="__fields:id___showcollapse" type="button" class="hidden">Show 3D plot</button></td><td><span id="__fields:id___showcollapse_message" style="color:green;"></span></td></tr> </table><script> ga.showcollapse3d["__moduleid__"]=1; $( "#__fields:id___showcollapse" ).click( function() {console.log("Inside Click: ");  if(!ga.plotted3d["__moduleid__"]){ $("#__fields:id__").show();$("#__fields:id___showcollapse").html("Hide 3D plot");console.log("show!"); ga.plotted3d["__moduleid__"]=1;}else{$("#__fields:id__").hide();ga.plotted3d["__moduleid__"]=0;$("#__fields:id___showcollapse").html("Show 3D plot");console.log("hide!");} });  </script>}
    2020
    2121<table>
  • languages/html5/types/plotly.output

    r1469 r1470  
    1717
    1818
    19 __~fields:showcollapse{ <table cellpadding="10"><tr><td><button id="__fields:id___showcollapse" type="button" class="hidden">Show 3D plot</button></td><td><span id="__fields:id___showcollapse_message" style="color:green;"></span></td></tr> </table><script> ga.showcollapse3d=1; $( "#__fields:id___showcollapse" ).click( function() {console.log("Inside Click: ");  if(!ga.plotted3d){ $("#__fields:id__").show();$("#__fields:id___showcollapse").html("Hide 3D plot");console.log("show!"); ga.plotted3d=1;}else{$("#__fields:id__").hide();ga.plotted3d=0;$("#__fields:id___showcollapse").html("Show 3D plot");console.log("hide!");} });  </script>}
     19__~fields:showcollapse{ <table cellpadding="10"><tr><td><button id="__fields:id___showcollapse" type="button" class="hidden">Show 3D plot</button></td><td><span id="__fields:id___showcollapse_message" style="color:green;"></span></td></tr> </table><script> ga.showcollapse3d["__moduleid__"]=1; $( "#__fields:id___showcollapse" ).click( function() {console.log("Inside Click: ");  if(!ga.plotted3d["__moduleid__"]){ $("#__fields:id__").show();$("#__fields:id___showcollapse").html("Hide 3D plot");console.log("show!"); ga.plotted3d["__moduleid__"]=1;}else{$("#__fields:id__").hide();ga.plotted3d["__moduleid__"]=0;$("#__fields:id___showcollapse").html("Show 3D plot");console.log("hide!");} });  </script>}
    2020
    2121<table>
Note: See TracChangeset for help on using the changeset viewer.