Changeset 937 in genappalpha


Ignore:
Timestamp:
Jun 29, 2016, 1:55:11 AM (6 years ago)
Author:
ehb
Message:

html5 : removed repeater restrictions, now general repeater structures allowed. Still alpha

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • etc/perl/genapp_util.pl

    r936 r937  
    12641264                            $error .= "Module $f field '$k' repeat on '$repeat{ $k }' : missing repeater\n";
    12651265                        }
    1266                         if ( $repeater{ $k } && $repeater{ $repeat{ $k } } =~ /(integer)/ )
    1267                         {
    1268                             $error .= "Module $f field '$k' is a repeat on '$repeat{ $k }' which is a repeater of type '$repeater{ $repeat{ $k } }'. This structure is not currently supported for integer repeat types\n";
    1269                         }
     1266#                        if ( $repeater{ $k } && $repeater{ $repeat{ $k } } =~ /(integer)/ )
     1267#                        {
     1268#                            $warn .= "Module $f field '$k' is a repeat on '$repeat{ $k }' which is a repeater of type '$repeater{ $repeat{ $k } }'. This structure is not currently supported for integer repeat types\n";
     1269#                        }
    12701270                        if ( $repeat{ $k } eq $k )
    12711271                        {
     
    12831283
    12841284                            $depth++;
    1285                             if ( $depth > 4 )
     1285                            if ( $depth > 25 )
    12861286                            {
    12871287                                $error .= "Module $f field '$k' exceeds maximum supported repeater depth\n";
  • languages/html5/add/js/ga.min.js

    r936 r937  
    5959b)&&++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("#"+
    6060b)&&++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={};
    61 ga.airavata.select=function(a,b,c,d){var e=ga.airavata.data,f="",g=[],h,m,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*
    62 Math.random()),Object.keys(e.resources[k])[0];case "choose":g.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 resource compute resource and press submit</h3><form id="airavata"><table>';for(h in e.resources)for(m in e.resources[h])f+='<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_'+
    63 h+'">'+e.resources[h][m]+"</label></td></tr>";messagebox({icon:"question.png",text:f+"</table>",buttons:g});return"deferred";default:return messagebox({icon:"toast.png",text:"ga.airavata.select, unknown selectoin type '"+a+"'"}),"abort"}};ga.value={};ga.value.settings={};
     61ga.airavata.select=function(a,b,c,d){var e=ga.airavata.data,f="",g=[],h,n,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*
     62Math.random()),Object.keys(e.resources[k])[0];case "choose":g.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 resource compute resource and press submit</h3><form id="airavata"><table>';for(h in e.resources)for(n in e.resources[h])f+='<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_'+
     63h+'">'+e.resources[h][n]+"</label></td></tr>";messagebox({icon:"question.png",text:f+"</table>",buttons:g});return"deferred";default:return messagebox({icon:"toast.png",text:"ga.airavata.select, unknown selectoin type '"+a+"'"}),"abort"}};ga.value={};ga.value.settings={};
    6464ga.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=
    6565b[0],b.splice(0,b.length),b.push(parseInt(parseFloat(c)+.5))):$(a+"_msg").html(""));return!0};
     
    9595ga.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={};
    9696ga.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.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="'+
    97 b+'_button"'),'id="%%id%%_button"').replace(RegExp('="'+b+'_altval"',"g"),'="%%id%%_altval"').replace(RegExp('name="_selaltval_'+b+'"'),'name="_selaltval_%%id%%"');ga.repeat.data[a].repeat[b].evalr=d.replace(RegExp('"#'+b+'"',"g"),'"#%%id%%"').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('"#'+
    98 b+'_altval"',"g"),'"#%%id%%_altval"');return'<tr><td></td><td><span id="'+b+'-span"></span></td></tr>'};
    99 ga.repeat.repeatOn=function(a,b,c){var d=/^(.*):(.*)$/.exec(c);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||[],ga.repeat.data[a].repeater[c].choice=
    100 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))};ga.repeat.repeater=function(a,b,c){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};
     97b+'_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].evalr=d.replace(RegExp('"#'+b+'"',"g"),'"#%%id%%"').replace(RegExp(":"+b+":","g"),":%%id%%:").replace(RegExp('"#'+b+'_msg"',"g"),'"#%%id%%_msg"').replace(RegExp('"'+b+'"',"g"),'"%%id%%"').replace(RegExp('"#'+
     98b+'_button"',"g"),'"#%%id%%_button"').replace(RegExp('"'+b+'_altval"',"g"),'"%%id%%_altval"').replace(RegExp('"#'+b+'_altval"',"g"),'"#%%id%%_altval"');return'<tr><td></td><td><span id="'+b+'-span"></span></td></tr>'};
     99ga.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||
     100[],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))};ga.repeat.repeater=function(a,b,c){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};
    101101ga.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};
    102 ga.repeat.change=function(a,b,c){var d,e=[],f="#"+b;d=$(f);var g,h="",m="",k,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;g=ga.repeat.children(a,
    103 b);switch(ga.repeat.data[a].repeater[b].type){case "checkbox":if(d)for(k in g)h+=ga.repeat.data[a].repeat[k].html,m+=ga.repeat.data[a].repeat[k].eval,ga.repeat.data[a].repeater[k]&&(e.push(k),ga.repeat.data[a].repeater[k].value&&delete ga.repeat.data[a].repeater[k].value);break;case "integer":for(n=1;n<=d;++n)for(k in g)h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,k+"-"+n).replace("%%label%%","["+n+"]"),m+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,k+"-"+n),ga.repeat.data[a].repeater[k]&&
    104 (e.push(k),ga.repeat.data[a].repeater[k].value&&delete ga.repeat.data[a].repeater[k].value);break;case "listbox":g=ga.repeat.children(a,b+":"+d);for(k in g)h+=ga.repeat.data[a].repeat[k].html,m+=ga.repeat.data[a].repeat[k].eval,ga.repeat.data[a].repeater[k]&&(e.push(k),ga.repeat.data[a].repeater[k].value&&delete ga.repeat.data[a].repeater[k].value);break;default:return console.warn("ga.repeat.change( "+a+" , "+b+" ) type "+ga.repeat.data[a].repeater[b].type+" not supported"),!1}!/^<tr>/.test(h)&&
    105 /<\/tr>$/.test(h)&&(h="<tr>"+h);$(f+"-repeater").html(h);eval(m);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#"+b)&&ga.pull.doPull("#"+b);resetHoverHelp()};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={};
     102ga.repeat.change=function(a,b,c){var d,e=[],f="#"+b;d=$(f);var g,h="",n="",k,p,l;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;g=
     103ga.repeat.children(a,b);switch(ga.repeat.data[a].repeater[b].type){case "checkbox":if(d)for(k in g)l=b+"-"+k,h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%",""),n+=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])),e.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);break;case "integer":for(p=
     1041;p<=d;++p)for(k in g)l=b+"-"+k+"-"+(p-1),h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%","["+p+"]"),n+=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])),e.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);break;case "listbox":p=b+"-"+d;g=ga.repeat.children(a,p);for(k in g)l=p+"-"+k,
     105h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%",""),n+=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])),e.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+" , "+b+" ) type "+ga.repeat.data[a].repeater[b].type+" not supported"),
     106!1}!/^<tr>/.test(h)&&/<\/tr>$/.test(h)&&(h="<tr>"+h);$(f+"-repeater").html(h);eval(n);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#"+b)&&ga.pull.doPull("#"+b);resetHoverHelp()};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={};
    106107ga.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")};
    107108ga.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={};
    108109ga.data.nofcrefresh={};
    109 ga.data.update=function(a,b,c,d){var e=0,f=0,g=0,h=0,m=0,k=a+"_output",n="#"+k,A=$(n),x={},v=n+"_msgs",u=$(v),y,w,r,t,q,z,p;c&&($("#"+a+"_progress").html(""),u.text(""));$.each(b,function(b,l){p=A.find("#"+b);if(p.length)switch(e||(u.text(""),e=1),p.attr("type")){case "plot2d":y="#"+b;l.data?(ga.value.set.plot2d(y,l.options),$.plot(p,l.data,ga.value.get.plot2d.plot_options(y,l.options))):$.plot(p,l,ga.value.get.plot2d.plot_options(y));r=k+":#"+b+":last_value";$("#global_data").data(r,l);break;case "atomicstructure":r=
    110 k+":#"+b+":last_value";z=l.file?l.file:l;_jmol_info[b].script="set background ["+ga.colors.background+"]; set zoomlarge false;set echo top center;echo loading "+z.split("/").pop()+';refresh;load "'+z+'";';ga.set(a+":jsmoladd")&&(_jmol_info[b].script+=ga.set(a+":jsmoladd"));l.script&&(_jmol_info[b].script+=";"+l.script);$("#global_data").data(r,_jmol_info[b].script);$("#"+b).html(Jmol.getAppletHtml("jmolApplet"+b,_jmol_info[b]));break;case "checkbox":case "radio":p.prop("checked",!0);break;case "div":p.html(l);
    111 break;case "video":w=$("#"+b),q="<video ",w.attr("data-width")&&(q+=' width="'+w.attr("data-width")+'"'),w.attr("data-height")&&(q+=' height="'+w.attr("data-height")+'"'),q+=" controls>",q+='<source src="'+l+'.mp4" type="video/mp4" /><source src="'+l+'.webm" type="video/webm" />',q+="</video>",w.html(q);case "filelink":t='<a href="'+l+'" target="_blank">'+l.split("/").pop()+"</a>";r=k+":#"+b+":last_value";$("#global_data").data(r,t);$("#"+b+"_filelink").html(t);break;case "filelinkm":r=k+":#"+b+":last_value";
    112 t="";$.each(l,function(a,b){t+='<a href="'+b+'" target="_blank">'+b.split("/").pop()+"</a> "});$("#global_data").data(r,t);$("#"+b+"_filelink").html(t);break;default:$("#global_data").data("_append:"+k+"_"+b)?(p.val(p.val()+"\n"+l),p.height(parseFloat(p.prop("scrollHeight")+parseFloat(p.css("borderTopWidth"))+parseFloat(p.css("borderBottomWidth"))))):p.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,
    113 l),"_textarea"==b&&ga.data.textarea(n,l),"_airavata"==b&&ga.data.airavata(n,l),"_status"==b&&"complete"==l&&c(d,0,0)):(f||(u.append("<p>Unexpected results:</p>"),f=1),u.append("<p>"+b+" => "+l+"</p>")):"_"==b.charAt(0)?/^_fs_/.test(b)&&ga.data.nofcrefresh[a]||($("#_state").data(b,l),g=1,"_status"==b&&(x.job_status=l),/^_getinput/.test(b)&&"_getinput"==b&&ga.valuen.input(a,l),"_textarea"==b&&ga.data.textarea(n,l),"_airavata"==b&&ga.data.airavata(n,l)):"-close"==b?h=1:"-close2"==b?m=1:(f||(u.text(""),
    114 u.append("<p>Unexpected results:</p>"),e=f=1),u.append("<p>"+b+" => "+l+"</p>"))});ga.value.saveLastValues(k);ga.value.saveLastValue(k,v);$(n+"_progress").html("");g&&syncState();h&&closeModal();m&&closeModal2();return x};
     110ga.data.update=function(a,b,c,d){var e=0,f=0,g=0,h=0,n=0,k=a+"_output",p="#"+k,l=$(p),A={},w=p+"_msgs",v=$(w),y,x,t,u,r,z,q;c&&($("#"+a+"_progress").html(""),v.text(""));$.each(b,function(b,m){q=l.find("#"+b);if(q.length)switch(e||(v.text(""),e=1),q.attr("type")){case "plot2d":y="#"+b;m.data?(ga.value.set.plot2d(y,m.options),$.plot(q,m.data,ga.value.get.plot2d.plot_options(y,m.options))):$.plot(q,m,ga.value.get.plot2d.plot_options(y));t=k+":#"+b+":last_value";$("#global_data").data(t,m);break;case "atomicstructure":t=
     111k+":#"+b+":last_value";z=m.file?m.file:m;_jmol_info[b].script="set background ["+ga.colors.background+"]; set zoomlarge false;set echo top center;echo loading "+z.split("/").pop()+';refresh;load "'+z+'";';ga.set(a+":jsmoladd")&&(_jmol_info[b].script+=ga.set(a+":jsmoladd"));m.script&&(_jmol_info[b].script+=";"+m.script);$("#global_data").data(t,_jmol_info[b].script);$("#"+b).html(Jmol.getAppletHtml("jmolApplet"+b,_jmol_info[b]));break;case "checkbox":case "radio":q.prop("checked",!0);break;case "div":q.html(m);
     112break;case "video":x=$("#"+b),r="<video ",x.attr("data-width")&&(r+=' width="'+x.attr("data-width")+'"'),x.attr("data-height")&&(r+=' height="'+x.attr("data-height")+'"'),r+=" controls>",r+='<source src="'+m+'.mp4" type="video/mp4" /><source src="'+m+'.webm" type="video/webm" />',r+="</video>",x.html(r);case "filelink":u='<a href="'+m+'" target="_blank">'+m.split("/").pop()+"</a>";t=k+":#"+b+":last_value";$("#global_data").data(t,u);$("#"+b+"_filelink").html(u);break;case "filelinkm":t=k+":#"+b+":last_value";
     113u="";$.each(m,function(a,b){u+='<a href="'+b+'" target="_blank">'+b.split("/").pop()+"</a> "});$("#global_data").data(t,u);$("#"+b+"_filelink").html(u);break;default:$("#global_data").data("_append:"+k+"_"+b)?(q.val(q.val()+"\n"+m),q.height(parseFloat(q.prop("scrollHeight")+parseFloat(q.css("borderTopWidth"))+parseFloat(q.css("borderBottomWidth"))))):q.val(m)}else c?"_"==b.charAt(0)?/^_fs_/.test(b)&&ga.data.nofcrefresh[a]||("_message"==b&&messagebox(m),/^_getinput/.test(b)&&"_getinput"==b&&ga.valuen.input(a,
     114m),"_textarea"==b&&ga.data.textarea(p,m),"_airavata"==b&&ga.data.airavata(p,m),"_status"==b&&"complete"==m&&c(d,0,0)):(f||(v.append("<p>Unexpected results:</p>"),f=1),v.append("<p>"+b+" => "+m+"</p>")):"_"==b.charAt(0)?/^_fs_/.test(b)&&ga.data.nofcrefresh[a]||($("#_state").data(b,m),g=1,"_status"==b&&(A.job_status=m),/^_getinput/.test(b)&&"_getinput"==b&&ga.valuen.input(a,m),"_textarea"==b&&ga.data.textarea(p,m),"_airavata"==b&&ga.data.airavata(p,m)):"-close"==b?h=1:"-close2"==b?n=1:(f||(v.text(""),
     115v.append("<p>Unexpected results:</p>"),e=f=1),v.append("<p>"+b+" => "+m+"</p>"))});ga.value.saveLastValues(k);ga.value.saveLastValue(k,w);$(p+"_progress").html("");g&&syncState();h&&closeModal();n&&closeModal2();return A};
    115116ga.data.textarea=function(a,b){var c=a+"_textarea",d=$(c);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"))+parseFloat(d.css("borderBottomWidth")))};
    116117ga.data.textarea.h={};ga.data.airavata=function(a,b){var c=$(a+"_airavata");c.is(":hidden")&&c.show();c.html(b)};
     
    118119ga.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={};
    119120ga.valuen.dflt.html={};ga.valuen.lastload="";
    120 ga.valuen.restore=function(a,b,c){var d="#"+a,e=$(d),f=e.find(":input").get(),g={},h,m;b=b||ga.valuen.data[a];c=c||ga.valuen.html[a];if(b){$(d+" .field_msg").html("");do h=!1,$.each(f,function(){var c,d,m=$(this),x,v;if(m.attr("data-repeater")&&!g[this.name]){g[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)){x=m.val();v=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==x){v=!0;break}m.prop("checked",v)}else m.val(d[0]);h=!0;
     121ga.valuen.restore=function(a,b,c){var d="#"+a,e=$(d),f=e.find(":input").get(),g={},h,n;b=b||ga.valuen.data[a];c=c||ga.valuen.html[a];if(b){$(d+" .field_msg").html("");do h=!1,$.each(f,function(){var c,d,l=$(this),n,w;if(l.attr("data-repeater")&&!g[this.name]){g[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)){n=l.val();w=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==n){w=!0;break}l.prop("checked",w)}else l.val(d[0]);h=!0;
    121122ga.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(h);$.each(f,function(){var c,d,e,f,h;if(this.name&&!g[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)){f=e.val();h=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==
    122 f){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(c=0;c<e.length;++c)b[e[c]]&&ga.altfile.button.addhtml(a,this.id,d,b[e[c]])});for(m in c)$("#"+m).html(c[m])}};
     123f){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(c=0;c<e.length;++c)b[e[c]]&&ga.altfile.button.addhtml(a,this.id,d,b[e[c]])});for(n in c)$("#"+n).html(c[n])}};
    123124ga.valuen.restore.dflt=function(a){return ga.valuen.restore(a,ga.valuen.dflt.data[a],ga.valuen.dflt.html[a])};
    124125ga.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]=
    125126data,ga.valuen.html[a]=html)};
    126 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 g,h,m=$(this),k,n;if(m.attr("data-repeater")&&!e[this.name]){e[this.name]=!0;if(this.name&&(b[this.name]||/checkbox|radio/i.test(this.type))){h=b[this.name];"[object Array]"!==Object.prototype.toString.call(h)&&(h=[h]);if(/checkbox|radio/i.test(this.type)){k=m.val();n=!1;if(h)for(g=0;g<h.length;g++)if(h[g]==k){n=!0;break}m.prop("checked",n)}else m.val(h[0]);f=!0;ga.repeat.change(a,this.name,
    127 !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 "+h[0])}});while(f);$.each(d,function(){var c,d,f,k,n;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();
    128 n=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==k){n=!0;break}f.prop("checked",n)}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]])});
     127ga.valuen.input=function(a,b){var c=$("#"+a),d=c.find(":input").get(),e={},f;if(b){do f=!1,$.each(d,function(){var g,h,n=$(this),k,p;if(n.attr("data-repeater")&&!e[this.name]){e[this.name]=!0;if(this.name&&(b[this.name]||/checkbox|radio/i.test(this.type))){h=b[this.name];"[object Array]"!==Object.prototype.toString.call(h)&&(h=[h]);if(/checkbox|radio/i.test(this.type)){k=n.val();p=!1;if(h)for(g=0;g<h.length;g++)if(h[g]==k){p=!0;break}n.prop("checked",p)}else n.val(h[0]);f=!0;ga.repeat.change(a,this.name,
     128!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 "+h[0])}});while(f);$.each(d,function(){var c,d,f,k,p;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();
     129p=!1;if(d)for(c=0;c<d.length;c++)if(d[c]==k){p=!0;break}f.prop("checked",p)}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]])});
    129130$.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)};
    130131ga.valuen.reset=function(){ga.valuen.data={};ga.valuen.html={};ga.valuen.dflt={};ga.valuen.dflt.data={};ga.valuen.dflt.html={};ga.valuen.lastload=""};
  • languages/html5/base.php

    r936 r937  
    678678    {
    679679        $a = preg_split( "/-/", $v );
    680         $_REQUEST[ $a[ 0 ] ][ $a[ 1 ] - 1 ] = $_REQUEST[ $v ];
     680        __~debug:basemylog{error_log( "preg_split of $v:\n" . json_encode( $a, JSON_PRETTY_PRINT ), 3, "/tmp/mylog" );}
     681        if ( !isset( $_REQUEST[ $a[ 0 ] ] ) || !is_array( $_REQUEST[ $a[ 0 ] ] ) ) {
     682            $_REQUEST[ $a[ 0 ] ] = [];
     683        }
     684        $obj = &$_REQUEST[ $a[ 0 ] ];
     685        for ( $i = 1; $i < count( $a ) - 1; ++$i ) {
     686            if ( !isset( $obj[ $a[ $i ] ] ) || !is_array( $obj[ $a[ $i ] ] ) ) {
     687                $obj[ $a[ $i ] ] = [];
     688            }
     689            $obj = &$obj[ $a[ $i ] ];
     690        }
     691        $obj[ $a[ count( $a ) - 1 ] ] = $_REQUEST[ $v ];
     692        // $_REQUEST[ $a[ 0 ] ][ $a[ 1 ] - 1 ] = $_REQUEST[ $v ];
    681693        unset( $_REQUEST[ $v ] );
    682694    }
  • languages/html5/js/repeat.js

    r936 r937  
    44ga.repeat               = {};
    55ga.repeat.data          = {};
     6
     7// ----------------------------------------------------------------------------------------------------------
     8// background
     9// ----------------------------------------------------------------------------------------------------------
     10// repeat and repeaters are identified by DOM id's of the element
     11// a repeat is an element that is dependent on a repeater
     12// a repeater is an element that has dependent repeats
     13// an element can be both a repeat (dependent on an element) and a repeater (has dependent repeats)
     14// ----------------------------------------------------------------------------------------------------------
     15// summary of data structures
     16// ----------------------------------------------------------------------------------------------------------
     17// ga.repeat.data[ mod ]                          : the module specific data object
     18//
     19// ga.repeat.data[ mod ].repeat                   : repeat data object
     20// ga.repeat.data[ mod ].repeat[ id ]             : repeat data object for repeat id
     21// ga.repeat.data[ mod ].repeat[ id ].html        : repeat id's html
     22// ga.repeat.data[ mod ].repeat[ id ].htmlr       : repeat id's html modified to ease replacement
     23// ga.repeat.data[ mod ].repeat[ id ].eval        : repeat id's eval
     24// ga.repeat.data[ mod ].repeat[ id ].evalr       : repeat id's eval modified to ease replacement
     25// ga.repeat.data[ mod ].repeat[ id ].refid       : repeat's repeater (as registered in repeatOn)
     26//
     27// ga.repeat.data[ mod ].repeater                 : repeater data object
     28// ga.repeat.data[ mod ].repeater[ id ]           : repeater data object for repeater id
     29// ga.repeat.data[ mod ].repeater[ id ].type      : repeater type (currently, checkbox, listbox or integer)
     30// ga.repeat.data[ mod ].repeater[ id ].child     : repeater's children (as registered in repeatOn)
     31// ga.repeat.data[ mod ].repeater[ id ].choice    : repeater's listbox choice
     32// ga.repeat.data[ mod ].repeater[ id ].value     : repeater's last value
     33// ----------------------------------------------------------------------------------------------------------
     34// summary of operations
     35// ----------------------------------------------------------------------------------------------------------
     36// ga.repeat.repeat   : register a repeat
     37// ga.repeat.repeater : register a repeater
     38// ga.repeat.repeatOn : register a repeat repeater reference
     39// ga.repeat.children : return all "children" ( repeats on the repeater)
     40// ga.repeat.change   : change value of a repeater
     41// ----------------------------------------------------------------------------------------------------------
     42
    643
    744// register a repeat
     
    2764        .replace( RegExp( 'for="' + id + '"' ), 'for="%%id%%"' )
    2865        .replace( RegExp( 'id="' + id + '_msg"' ), 'id="%%id%%_msg"' )
     66        .replace( RegExp( 'id="' + id + '_tr"' ), 'id="%%id%%_tr"' )
    2967        .replace( RegExp( 'id="' + id + '_button"' ), 'id="%%id%%_button"' )
    3068        .replace( RegExp( '="' + id + '_altval"', 'g' ), '="%%id%%_altval"' )
    3169        .replace( RegExp( 'name="_selaltval_' + id + '"' ), 'name="_selaltval_%%id%%"' )
     70        .replace( RegExp( 'id="' + id + '-repeater"' ), 'id="%%id%%-repeater"' )
    3271    ;   
    3372
     
    5190// the repeat should already exist
    5291
    53 ga.repeat.repeatOn = function( mod, id, refid  ) {
     92ga.repeat.repeatOn = function( mod, id, refid ) {
    5493    __~debug:repeat{console.log( "ga.repeat.repeatOn( " + mod + " , " + id + " , " + refid + " )" );}
    5594    var rxcolon = /^(.*):(.*)$/,
     
    5897        refchoice
    5998    ;
     99
     100    refid = refid.replace( ':', '-' );
    60101
    61102    ga.repeat.data[ mod ].repeater = ga.repeat.data[ mod ].repeater || {};
     
    134175    add_eval = "",
    135176    i,
    136     j;
     177    j,
     178    k;
    137179
    138180    __~debug:repeat{console.log( "ga.repeat.change( " + mod + " , " + id + " )" );}
     
    186228        if ( val ) {
    187229            for ( i in children ) {
    188                 add_html += ga.repeat.data[ mod ].repeat[ i ].html;
    189                 add_eval += ga.repeat.data[ mod ].repeat[ i ].eval;
     230                k = id + "-" + i;
     231                __~debug:repeat{console.log( " i " + i + " htmlr " + ga.repeat.data[ mod ].repeat[ i ].htmlr );}
     232                __~debug:repeat{console.log( " i " + i + " evalr " + ga.repeat.data[ mod ].repeat[ i ].evalr );}
     233                add_html += ga.repeat.data[ mod ].repeat[ i ].htmlr.replace( /%%id%%/g, k ).replace( "%%label%%", "" );
     234                add_eval += ga.repeat.data[ mod ].repeat[ i ].evalr.replace( /%%id%%/g, k );
    190235                if ( ga.repeat.data[ mod ].repeater[ i ] ) {
    191                     __~debug:repeat{console.log( "child repeater " + i );}
    192                     child_repeaters.push( i );
    193                     if ( ga.repeat.data[ mod ].repeater[ i ].value ) {
    194                         delete ga.repeat.data[ mod ].repeater[ i ].value;
     236                    __~debug:repeat{console.log( "child repeater " + k );}
     237                    if ( !ga.repeat.data[ mod ].repeater[ k ] ) {
     238                        ga.repeat.data[ mod ].repeater[ k ] = jQuery.extend( {}, ga.repeat.data[ mod ].repeater[ i ] );
     239                    }
     240                    child_repeaters.push( k );
     241                    if ( ga.repeat.data[ mod ].repeater[ k ].value ) {
     242                        delete ga.repeat.data[ mod ].repeater[ k ].value;
    195243                    }
    196244                }
     
    203251        for ( j = 1; j <= val; ++j ) {
    204252            for ( i in children ) {
    205                 __~debug:repeat{console.log( " j " + j + " i " + i + " html " + ga.repeat.data[ mod ].repeat[ i ].htmlr );}
    206                 __~debug:repeat{console.log( " j " + j + " i " + i + " eval " + ga.repeat.data[ mod ].repeat[ i ].evalr );}
    207                 add_html += ga.repeat.data[ mod ].repeat[ i ].htmlr.replace( /%%id%%/g, i + "-" + j ).replace( "%%label%%", "[" + j + "]" );
    208                 add_eval += ga.repeat.data[ mod ].repeat[ i ].evalr.replace( /%%id%%/g, i + "-" + j );
     253                k = id + "-" + i + "-" + ( j - 1 );
     254                __~debug:repeat{console.log( " j " + j + " i " + i + " htmlr " + ga.repeat.data[ mod ].repeat[ i ].htmlr );}
     255                __~debug:repeat{console.log( " j " + j + " i " + i + " evalr " + ga.repeat.data[ mod ].repeat[ i ].evalr );}
     256                add_html += ga.repeat.data[ mod ].repeat[ i ].htmlr.replace( /%%id%%/g, k ).replace( "%%label%%", "[" + j + "]" );
     257                add_eval += ga.repeat.data[ mod ].repeat[ i ].evalr.replace( /%%id%%/g, k );
    209258                if ( ga.repeat.data[ mod ].repeater[ i ] ) {
    210                     __~debug:repeat{console.log( "child repeater " + i );}
    211                     child_repeaters.push( i );
    212                     if ( ga.repeat.data[ mod ].repeater[ i ].value ) {
    213                         delete ga.repeat.data[ mod ].repeater[ i ].value;
     259                    __~debug:repeat{console.log( "child repeater " + k );}
     260                    if ( !ga.repeat.data[ mod ].repeater[ k ] ) {
     261                        ga.repeat.data[ mod ].repeater[ k ] = jQuery.extend( {}, ga.repeat.data[ mod ].repeater[ i ] );
     262                    }
     263                    child_repeaters.push( k );
     264                    if ( ga.repeat.data[ mod ].repeater[ k ].value ) {
     265                        delete ga.repeat.data[ mod ].repeater[ k ].value;
    214266                    }
    215267                }
     
    220272    case "listbox" :
    221273       
    222         j = id + ":" + val;
     274        j = id + "-" + val;
    223275
    224276        children = ga.repeat.children( mod, j );
     
    226278
    227279        for ( i in children ) {
    228             add_html += ga.repeat.data[ mod ].repeat[ i ].html;
    229             add_eval += ga.repeat.data[ mod ].repeat[ i ].eval;
     280            k = j + "-" + i;
     281            __~debug:repeat{console.log( " i " + i + " htmlr " + ga.repeat.data[ mod ].repeat[ i ].htmlr );}
     282            __~debug:repeat{console.log( " i " + i + " evalr " + ga.repeat.data[ mod ].repeat[ i ].evalr );}
     283            add_html += ga.repeat.data[ mod ].repeat[ i ].htmlr.replace( /%%id%%/g, k ).replace( "%%label%%", "" );
     284            add_eval += ga.repeat.data[ mod ].repeat[ i ].evalr.replace( /%%id%%/g, k );
    230285            if ( ga.repeat.data[ mod ].repeater[ i ] ) {
    231                 __~debug:repeat{console.log( "child repeater " + i );}
    232                 child_repeaters.push( i );
    233                 if ( ga.repeat.data[ mod ].repeater[ i ].value ) {
    234                     delete ga.repeat.data[ mod ].repeater[ i ].value;
     286                __~debug:repeat{console.log( "child repeater " + k );}
     287                if ( !ga.repeat.data[ mod ].repeater[ k ] ) {
     288                    ga.repeat.data[ mod ].repeater[ k ] = jQuery.extend( {}, ga.repeat.data[ mod ].repeater[ i ] );
     289                }
     290                child_repeaters.push( k );
     291                if ( ga.repeat.data[ mod ].repeater[ k ].value ) {
     292                    delete ga.repeat.data[ mod ].repeater[ k ].value;
    235293                }
    236294            }
  • languages/html5/types/input.footer

    r936 r937  
    2929//             url:"ajax/get_results.php?_window=" +  window.name + "&_logon=" +$( "#_state" ).data( "_logon" ) + '&_uuid=' + id,
    3030    var job_status = "";
     31    __~debug:getinput{console.log( "get_results___moduleid__( " + id + " , " + last_timeout + " , " + getlastmsg + " , " + getinput + " )" );}
    3132    $.getJSON(
    3233             "ajax/get_results.php",
  • sbin/getapp.pl

    r936 r937  
    4646   -gen                run genapp.pl after install
    4747   -nolinks            do not setup html links
     48   -dir directory      use specified directory instead of application name
    4849
    4950when using usage[2];
     
    5657my $gen;
    5758my $nolinks;
     59my $targetdir;
    5860
    5961while ( $ARGV[ 0 ] =~ /^-/ ) {
     
    6264        die "$0: option $option requries an argument\n" . $notes if !@ARGV;
    6365        $admin = shift @ARGV;
     66        next;
     67    }
     68    if ( $option =~ /^-dir$/ ) {
     69        die "$0: option $option requries an argument\n" . $notes if !@ARGV;
     70        $targetdir = shift @ARGV;
    6471        next;
    6572    }
     
    167174}
    168175
    169 $app     = shift || die $notes;
     176$app       = shift || die $notes;
     177$targetdir = $app if !$targetdir;
    170178
    171179die "$0: svn-type must be svn or svn+ssh and you specified '$svntype'\n" if $svntype !~ /^svn(\+ssh|)$/;
    172180
    173 die "$0: $app file already exists\n" if -e $app && !$force;
     181die "$0: $targetdir directory already exists\n" if -e $targetdir && !$force;
    174182
    175183@l = listapps();
     
    180188die "$0: Error: $app is not known as an application name\n" if !$vapp{ $app };
    181189
    182 $cmd = "svn $force co ${svntype}://$svnbase/$app $app";
     190$cmd = "svn $force co ${svntype}://$svnbase/$app $targetdir";
    183191
    184192print "$cmd\n";
     
    192200
    193201sub setappconfig {
    194     my $app    = $_[0];
    195     my $admin  = $_[1];
     202    my $app        = $_[0];
     203    my $targetdir  = $_[1];
     204    my $admin      = $_[2];
    196205
    197206    my $json = {};
     
    217226    $$json{ "lockdir" } = "$gb/etc";
    218227
    219     $f = "$app/appconfig.json";
     228    $f = "$targetdir/appconfig.json";
    220229    open  $fh, ">$f" || die "$0: could not open $f for writing\n";
    221230    print $fh to_json( $json, { utf8 => 1, pretty => 1 } );
     
    224233}
    225234
    226 setappconfig( $app, $admin );
     235setappconfig( $app, $targetdir, $admin );
    227236
    228237# setup directives.json
     
    232241
    233242sub setdirectives {
    234     my $app     = $_[0];
    235     my $webroot = $_[1];
     243    my $app       = $_[0];
     244    my $targetdir = $_[1];
     245    my $webroot   = $_[2];
    236246
    237247    my $f      = "directives.json.template";
    238248    my $fo     = "directives.json";
    239249   
    240     die "$0: $app/$f does not exist for this application. 
    241 This is an error of the application developer and they should be informed.\n$devmsg" if !-e "$app/$f";
    242 
    243     die "$0: $app/$fo already exists for this application.
     250    die "$0: $targetdir/$f does not exist for this application. 
     251This is an error of the application developer and they should be informed.\n$devmsg" if !-e "$targetdir/$f";
     252
     253    die "$0: $targetdir/$fo already exists for this application.
    244254This file must be manually removed before continuing. 
    245255If this error recurrs after removing,
    246 This is an error of the application developer and they should be informed.\n$devmsg" if -e "$app/$fo";
    247 
    248     my $djson  = get_file_json( "$app/$f" );
    249 
    250     open my $fh, "$app/$f" || die "$0: file open error on $app/$f\n";
     256This is an error of the application developer and they should be informed.\n$devmsg" if -e "$targetdir/$fo";
     257
     258    my $djson  = get_file_json( "$targetdir/$f" );
     259
     260    open my $fh, "$targetdir/$f" || die "$0: file open error on $targetdir/$f\n";
    251261    my @l = <$fh>;
    252262    close $fh;
     
    255265    chomp $dir;
    256266
    257     die "$0: $app/$f error, missing __app_parent_directory__ tags.
     267    die "$0: $targetdir/$f error, missing __app_parent_directory__ tags.
    258268This is an error of the application developer and they should be informed.\n$devmsg" if !( grep /__app_parent_directory__/, @l );
    259269
    260     die "$0: $app/$f error, missing __webroot__ tags.
     270    die "$0: $targetdir/$f error, missing __webroot__ tags.
    261271This is an error of the application developer and they should be informed.\n$devmsg" if !( grep /__webroot__/, @l );
    262272
    263 #    die "$0: $app/$f error, missing __application__ tags.
     273#    die "$0: $targetdir/$f error, missing __application__ tags.
    264274# This is an error of the application developer and they should be informed.\n$devmag" if !( grep /__application__/, @l );
    265275
    266276    grep s/__app_parent_directory__/$dir/g, @l;
    267277
    268     grep s/__webroot__/$dir/g, @l;
     278    grep s/__webroot__/$webroot/g, @l;
    269279
    270280#    grep s/__application__/$app/g, @l;
     281
     282    if ( $app ne $targetdir ) {
     283        grep s/"$app"/"$targetdir"/g, @l;
     284        grep s/\/$app\//\/$targetdir\//g, @l;
     285    }       
    271286
    272287    if ( $$djson{ 'usewss' } && !$$cfgjson{ 'https' } ) {
     
    283298    }
    284299
    285     die "$0 : $app/$f error: can not locate json closure.
     300    die "$0 : $targetdir/$f error: can not locate json closure.
    286301This is an error of the application developer and they should be informed.\n$devmsg" if $l[ -1 ] !~ /^\s*}\s*$/;
    287302
     
    290305    push @l, "}\n";
    291306
    292     open  $fh, ">$app/$fo" || die "$0: could not open $app/$fo for writing\n";
     307    open  $fh, ">$targetdir/$fo" || die "$0: could not open $targetdir/$fo for writing\n";
    293308    print $fh ( join '', @l );
    294309    close $fh;
    295     print "created $app/$fo\n";
    296 }
    297 
    298 setdirectives( $app, $$cfgjson{'webroot'} );
     310    print "created $targetdir/$fo\n";
     311}
     312
     313setdirectives( $app, $targetdir, $$cfgjson{'webroot'} );
    299314
    300315sub runcmd {
     
    321336
    322337if ( $gen ) {
    323     runcmd( "cd $app; env GENAPP=$gb \$GENAPP/bin/genapp.pl" );
     338    runcmd( "cd $targetdir; env GENAPP=$gb \$GENAPP/bin/genapp.pl" );
    324339    if ( !$nolinks ) {
    325340        my $dir = `pwd`;
    326341        chomp $dir;
    327342        my $cmds =
    328 "cd $app
    329 ln -sf $dir/$app/output/html5 $$cfgjson{'webroot'}/$app
     343"cd $targetdir
     344ln -sf $dir/$targetdir/output/html5 $$cfgjson{'webroot'}/$targetdir
    330345mkdir -p output/html5/results output/html5/deleted 2> /dev/null
    331346rm ajax results util 2> /dev/null
  • sbin/setconfig.pl

    r936 r937  
    356356if ( !$webroot ) {
    357357    $webroot = "/var/www/html" if $os =~ /^(ubuntu|centos|redhat)$/;
     358    $webroot = "/var/www/htdocs" if $os =~ /^slackware$/;
    358359}
    359360
Note: See TracChangeset for help on using the changeset viewer.