file_onclick = function(){ window.location.href = "/login?p=login"; return false; } jQuery(document).ready(function() { /****** variables ******/ selectedsrv = new Object(); Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; }; Object.remove = function(name, obj) { var key,place; var size = Object.size(obj); for (key in obj) { if (obj[key]["name"]==name){delete obj[key];place=parseInt(key)+1;} } for (place;place"); var stbl= jq("#servicetable"); var prevselected = new Array(); var taxonservices = new Array(); var gridcompletedonce =false ; man_coordinates= new Object(); /****** function calls ******/ var versionnr=''; if(loggedin){ textElement.html(loggedin); //make sure the link in the menu is able to logout the user. var linkInMenu =jq("li#menu-1087-1 > a") ; linkInMenu.attr('href',"/login?p=logout"); linkInMenu.text("Logout Query tool"); }else{ textElement.html("Login"); } //emodnet.eu make sure the right menu gets highlighted. jq('#menu-492-1').removeClass("active-trail"); //menu's defer in dev server and on the live server... jq('#menu-649-1').addClass("active-trail"); //echo "textElement.html(versionnr + \"
Changelog\""); textElement.css('position', 'absolute'); textElement.css('right', '20px'); textElement.css('top', '3px'); textElement.css('color', '#00677F'); textElement.css('font-style', 'italic'); jq("#tabs").append(textElement); usedemo(); jq("#tabs").tabs({ disabled: [1,5] }); setInterval(function(){jq("#jobstable").trigger("reloadGrid"); },60000); jq('progress').hide(); jq( "#inputcordion" ).accordion({ collapsible: true, active: false, heightStyle:"content" }); /****** event functions ******/ jq('#demofile').change(function(){ usedemo(); }); jq('#man_coord').click(function(){ var lngVal = /^-?((1?[0-7]?|[0-9]?)[0-9]|180)\.[0-9]{1,6}$/; var latVal = /^-?([0-8]?[0-9]|90).[0-9]{1,6}$/; var validated = true; if(!lngVal.test(jq('#man_longitude').val())){ jq('#error_man_longitude').text("Not a valid longitude :" + jq('#man_longitude').val()); jq('#man_longitude').val(""); validated=false; } if(!latVal.test(jq('#man_latitude').val())){ jq('#error_man_latitude').text("Not a valid latitude : " + jq("#man_latitude").val()); jq('#man_latitude').val(""); validated=false; } if(validated){ man_coordinates[Object.size(man_coordinates)]=[jq('#man_latitude').val(),jq('#man_longitude').val()]; rewritecoordList(); jq('#error_man_latitude').text(""); jq('#error_man_longitude').text(""); } }); jq('#inputfile').change(function() { var mf=jq('#inputfile').val(); var excelfile=mf.match("\.(xls)", "i"); if (excelfile){ //jq('#delim_row').attr('disabled', true); jq('#delim_col').attr('disabled', true); jq('#dec_symb').attr('disabled', false); }else{ //jq('#delim_row').attr('disabled', false); //jq('#delim_row').val('13+10'); jq('#delim_col').attr('disabled', false); jq('#delim_col').val('9'); jq('#dec_symb').attr('disabled', false); } jq('#row1_is_heading').attr('disabled', false); if(jq("#demofile option[value='none']").length !=0){ jq('#demofile option:selected').removeAttr('selected'); jq("#demofile option[value='none']").attr('selected','selected'); } }); // validate uploaded file jq('#startnewjob:file').change(function(){ var inputfile = this.files[0]; name = inputfile.name; size = inputfile.size; type = inputfile.type; //your validation }); jq(document).on("click" ,'#results', function() { jq( "#tabs" ).tabs( "option", "disabled", [ 1,5 ] ); jq("#tabs").tabs( "option", "active", 0 ); jq("#tabs").tabs( "option", "active", 2 ); jq("#jobstable").trigger("reloadGrid"); }); jq(document).on("click" ,'#changelog', function() { var before = jq( "#tabs" ).tabs( "option", "disabled"); jq( "#tabs" ).tabs( "option", "disabled", [ 1 ] ); jq("#tabs").tabs( "option", "active", 5); jq( "#tabs" ).tabs( "option", "disabled", before ); }); jq(document).on("click" ,'img#usecase1', function() { var before = jq( "#tabs" ).tabs( "option", "disabled"); jq("#tabs").tabs( "option", "active", 6); jq( "#tabs" ).tabs( "option", "disabled", before ); }); jq(document).on("click" ,'img#usecase2', function() { var before = jq( "#tabs" ).tabs( "option", "disabled"); jq("#tabs").tabs( "option", "active", 7); jq( "#tabs" ).tabs( "option", "disabled", before ); }); jq(document).on("click" ,'img#usecase3', function() { var before = jq( "#tabs" ).tabs( "option", "disabled"); jq("#tabs").tabs( "option", "active", 8); jq( "#tabs" ).tabs( "option", "disabled", before ); }); jq(document).on("click" ,'img#usecase4', function() { var before = jq( "#tabs" ).tabs( "option", "disabled"); jq("#tabs").tabs( "option", "active", 9); jq( "#tabs" ).tabs( "option", "disabled", before ); }); jq(document).on("click" ,'.lwmanual', function() { var before = jq( "#tabs" ).tabs( "option", "disabled"); jq("#tabs").tabs( "option", "active", 3); jq( "#tabs" ).tabs( "option", "disabled", before ); }); jq(document).on("click" ,'#reloadjobs', function() { jq("#jobstable").trigger("reloadGrid"); }); jq(document).on("click" ,'#buttonback', function() { jq( "#tabs" ).tabs( "option", "disabled", [ 1,5 ] ); jq( "#tabs" ).tabs( "option", "active", 0 ); jq('#showerror4').html(""); }); jq(document).on("click" ,'.ui-icon-close', function() { var wsid = parseInt(jq(this).parent().attr("wsid"),10); var wsoption = jq(this).parent().attr("wsoption"); if(Object.size(selectedsrv) == 1){ // jq('#file_error_msg').text("Please deselect Taxon match to remove the last taxon match service."); for(var i=0;i('+txt+')'); }else{ item.attr("class","ispresent"); var txt = item.find('select[id^="dupl_"] option').eq(0).text(); item.append('('+txt+')'); } item.find('select[id^="dupl_"]').remove(); // jq("#duplicates").hide(); => needs a check if there are no other duplicates and presenentconcats }else{ item.find('select[id^="dupl_"] option[value^="input_'+number+'"]').remove(); } }else //add the chosen column to the duplicate list if(item.find("span").eq(0).text().toLowerCase().trim() == selected.toLowerCase().trim()){ item.find('select[id^="dupl_"]').find("option[selected=\"selected\"]").removeAttr("selected"); item.find('select[id^="dupl_"]').append(""); } }else if(item.attr("class") == "ispresent"){ if(item.find("span").eq(0).text().toLowerCase().trim() == prevselected[number].toLowerCase().trim()){ jq("#missing").text("! There are missing fields in your concatenated webservices."); jq("#missing").show(); item.attr("class","isnotpresent"); item.find("span").eq(1).remove(); //will probably need a check if it doesn't exceed the max elements in the list. in theory this isn't possible but still. notpresent++; }else if(item.find("span").eq(0).text().toLowerCase().trim() == selected.toLowerCase().trim()){ item.attr("class","isduplicate"); jq("#duplicates").text("! There are duplicate fields present, please choose which columns you want to use."); var info = item.attr("info"); var opttxt = item.find('span').eq(1).text().replace(/\(|\)/g, ''); var columnNumberOptTxt=FindTrailingNumbers(opttxt); var optval = "input_"+columnNumberOptTxt; item.find("span").eq(1).remove(); item.append(''); item.find('select[id^="dupl_"]').append(""); item.find('select[id^="dupl_"]').append(""); } }else if(item.attr("class") == "ispresentconcat"){ if(item.find("span").eq(0).text().toLowerCase().trim() == selected.toLowerCase().trim()){ item.attr("class","isduplicate"); jq("#duplicates").text("! There are duplicate fields present, please choose which columns you want to use."); var info = item.attr("info"); var opttxt = item.find('span').eq(1).text().replace(/\(|\)/g, ''); var optval = item.find('span').eq(1).attr("value"); item.find("span").eq(1).remove(); item.append(''); item.find('select[id^="dupl_"]').append(""); item.find('select[id^="dupl_"]').append(""); } }else if(item.attr("class") == "isnotpresent"){ //notpresent++; not needed. TBD if(item.find("span").eq(0).text().toLowerCase().trim() == selected.toLowerCase().trim()){ item.attr("class","ispresent"); item.append('(column '+number+')'); notpresent--; if(notpresent == 0){ jq("#missing").hide(); } } } }); } ); //put the focus somewhere else so that the focus event can trigger again. jq("#ui-id-1").focus(); }); jq(document).on("click" ,'#rerun', function() { jq(this).attr("disabled","disabled"); jq.ajax({ type: "GET", url:"/dataservices/ajaxserver.php?option=rerun&&rerun="+jq(this).val() }).done(function( data , status , jqxhr) { if (data.slice(0,2)=="OK") { //removed trigger no action required }else { jq("#showmatch").attr("disabled", false); jq('#showerror4').html(data); jq( "#tabs" ).tabs( "option", "disabled", [ 0,5 ] ); jq("#tabs").tabs( "option", "active", 1 ); } jq("#showmatch").html('start'); }); }); /* jq(document).on("click" ,'#rerun', function() { jq(this).attr("disabled","disabled"); jq.ajax({ type: "GET", url:"/dataservices/ajaxserver.php?option=rerun&&rerun="+jq(this).val() }).done(function( data , status , jqxhr) { if (data.slice(0,2)=="OK") { //removed trigger no action required }else { jq("#showmatch").attr("disabled", false); jq('#showerror4').html(data); jq( "#tabs" ).tabs( "option", "disabled", [ 0,5 ] ); jq("#tabs").tabs( "option", "active", 1 ); } jq("#showmatch").html('start'); }); }); */ /****** form submit ******/ // clicked on start jq(document).on("click" ,'#showmatch', function() { var colnames=Array(); var mandcolnames=Array(); var unicolnames=Array(); var notfound=Array(); var submitform=true; var cntcolnames; jq('#showerror4').html(""); if (!(jq('#coln').val()==null || jq('#coln').val()=='')) { jq('form#frmShowCol select').each(function(){ if (jq(this).attr('name').indexOf('colname')==0){ if(!( jq(this).val()==null || typeof(jq(this).val())=="undefined" || jq(this).val()=='')) colnames.push(jq(this).val()); } }); //check if mandatory columnnames exists mandcolnames=jq('#coln').val().split(", "); jq.each(mandcolnames, function(index, value) { if (jq.inArray(value, colnames)==-1) notfound.push(value); }); if (notfound.length>0){ jq('#showerror4').append("Missing required fields: " + notfound.join(", ") + "
"); submitform=false; } //check if columnnames are unique cntcolnames=colnames.length; unicolnames = jq.unique(colnames); if (unicolnames.length!=cntcolnames){ jq('#showerror4').append("Some fields exist more than once!" + "
" ); submitform=false; } } jq('.concat_list').children().each(function(column){ var notfound = Array(); jq.each( jq(this), function( key , value){ var item = jq(this); if(item.attr("class") == "isnotpresent"){ notfound.push(item.text()); } }); if (notfound.length>0){ jq('#showerror4').append("Missing required fields: " + notfound.join(", ") + "
"); submitform=false; } }); if (submitform===true) { jq("#showmatch").html(''); jq("#showmatch").attr("disabled", true); jq.ajax({ type: "POST", url:"/dataservices//newjob_request.php", data: jq('#frmShowCol').serialize(), async:true }).done(function( data , status , jqxhr) { if (data=="") { //removed trigger. }else { jq("#showmatch").attr("disabled", false); jq('#showerror4').html(data); jq( "#tabs" ).tabs( "option", "disabled", [ 0,5 ] ); jq("#tabs").tabs( "option", "active", 1 ); } jq("#showmatch").html('start'); }); jq( "#contenttab4" ).html("
Your job is in progress.
If there are validation errors, they will appear on top.

To submit another job, click on the button 'newjob'. To view all jobs, click on the button 'results'.\

  "); } }); //clicked on next jq(document).on("submit" ,'#startnewjob', function() { var servsgeoids=[]; var geolayernames=[]; var wsids=[]; var submitform=true; jq('#file_error_msg').html(""); s = jq("#servicetable").jqGrid('getGridParam','selarrrow'); if (s.length>0){ var wsjson = new Object; for(var j = 0; j"); } var inputfile = jq('#inputfile').val(); if (!inputfile.length && jq('#demofile').val()=="none"){ submitform = false; jq('#file_error_msg').append("Filename can not be empty! Use demofile or upload file!
"); }else if(inputfile){ var dot = inputfile.lastIndexOf("."); if (dot == -1) { submitform = false; jq('#file_error_msg').append("Invalid filename!
"); }else{ var extension = inputfile.substr(dot+1,inputfile.length); //var allowedext= new Array("xls","xlsx","txt"); var allowedext= new Array("txt","csv","xls","xlsx"); if (!(jq.inArray(extension, allowedext)>-1)){ submitform = false; jq('#file_error_msg').append("Invalid extension!
"); } } } if (jq('#delim_col').val()==jq('#dec_symb').val()){ jq('#file_error_msg').append("The decimal symbol has to be different from the row and column delimiter!
"); submitform=false; } if(submitform===true){ var formdata_available=true; jq("#ajax").val("true"); try{formData = new FormData(jq('#startnewjob')[0]);} catch(err){ formdata_available=false; } if(formdata_available){ submitform=false; jq('progress').show(); jq.ajax({ type: "POST", url: "/dataservices//contenttab1_matchcol.php", xhr: function() { // custom xhr var myXhr = jq.ajaxSettings.xhr(); if(myXhr.upload){ // check if upload property exists myXhr.upload.addEventListener('progress',progressHandlingFunction, false); // for handling the progress of the upload } return myXhr; }, // data: jq('#startnewjob').serialize(), data: formData, cache: false, contentType: false, processData: false }).done(function( msg , status , jqxhr) { if(msg.slice(0,5)=="error"){ jq('#showerror').html(msg.slice(5)); jq('#file_error_msg').html(msg.slice(5)); jq('progress').css("background-color","red"); }else if(msg.slice(0,6)=="
"){ // this is only the case when xdebug is on. jq('#showerror').html(msg.slice(5)); jq('#file_error_msg').html(msg.slice(5)); jq('progress').css("background-color","red"); }else{ jq('#showerror').html(""); jq('#file_error_msg').html(""); jq('progress').hide(); jq( "#contenttab4" ).html(msg); jq( "#tabs" ).tabs( "option", "active", 1 ); jq( "#tabs" ).tabs( "option", "disabled", [ 1,5 ] ); } }); } }else{ jq('#file_error_msg').show(); jq('#file_error_msg').animate({ scrollTop: 0 }, 0); } return submitform; }); /*** table creation (jqrid)***/ // creation servicetable on content tab new job jq("#servicetable").jqGrid({ url:'/dataservices/ajaxserver.php?option=services', datatype: 'xml', mtype: 'GET', colNames:['Servicetype','uniqueid','serviceid','gislayerid', 'Name','wsoption','servicecategory','servicecategoryFull','Source', 'Description & webservice information','Environment','Status','Manditory columns','UUID', 'metaurl','imisdasID','parent'], colModel:[{name:'Servicetype',index:'servicetype', width:75, xmlmap:'servicetype', hidden:true}, // {name:'uniqueid',index: 'uniqueid', width:75,xmlmap:'uniqueid', hidden:true}, {name:'id',index: 'id', width:75,xmlmap:'uniqueid', hidden:true}, {name:'serviceid',index: 'serviceid', width:75,xmlmap:'serviceid', hidden:true}, {name:'gislayerid',index: 'gislayerid', width:75,xmlmap:'gislayerid', hidden:true}, {name:'name',index:'name', width:300,xmlmap:'name'}, {name:'wsoption',index:'wsoption', width:150,xmlmap:'wsoption', hidden:true}, {name:'servicecategory',index:'servicecategory', width:100,xmlmap:'servicecategory', hidden:true}, {name:'servicecategoryFull',index:'servicecategoryFull', width:100,xmlmap:'servicecategoryFull', hidden:true}, {name:'Source',index:'Source', width:150, formatter: metalinkformat}, {name:'Description & webservice information',index:'description',xmlmap:'description', width:450,formatter:FormatInfo}, {name:'Environment',index:'environment', width:90,xmlmap:'environment',align:'center', hidden:true}, {name:'Status',index:'status', xmlmap:'status',align:'center', hidden:true}, {name:'Manditory columns',index:'mandcol',xmlmap:'mandcol',width:250, hidden:true}, {name:'UUID',index:'UUID', width:300,xmlmap:'UUID', hidden:true}, {name:'metaurl',index:'metaurl', width:300,xmlmap:'metaurl', hidden:true}, {name:'imisdasID',index:'imisdasID', width:300,xmlmap:'imisdasID', hidden:true}, {name:'parent',index:'parent',xmlmap:'parent', hidden:true} ], rowNum:100, rowList:[50,100,150], loaded:true, height: 'auto', sortname: 'servicetype', viewrecords: true, sortorder: "desc", xmlReader: {root : "ResultSet", total: "ResultSet>totalRecords", row: "Result", repeatitems: false, id: "uniqueid"}, multiselect: true, grouping: true, groupingView : {groupField: ['servicecategoryFull'], groupColumnShow : [false], groupText : ['{0}'], groupCollapse : true, groupOrder: ['asc'], groupSummary : [false], groupDataSorted : true}, onCellSelect: function (rowid,iCol,cellcontent,e){ var coldescrpid=getColumnSrcIndexByName(jq("#servicetable"),'Description & webservice information'); if (iCol==coldescrpid){ jq(function() { jq( "#dialog-info" ).dialog({ modal: true }); var wstype=jq("#servicetable").jqGrid('getCell',rowid,'Servicetype'); if (wstype=='ws') wsid=jq("#servicetable").jqGrid('getCell',rowid,'serviceid'); else wsid= wsid=jq("#servicetable").jqGrid('getCell',rowid,'gislayerid') ; jq.ajax({ url:'/dataservices/ajaxserver.php?option=wsinfo&wstype='+wstype+'&wsid='+wsid , dataType: "xml", beforeSend: function (data) { jq("#infocontent").html(""); }, success: function (data) { jq(data).find('Result').each(function(){ var info= jq(this).find('description').text(); jq("#infocontent").html(info); }) } }) }); } }, onSelectRow: function (rowid,status,e){ var name = jq(this).getCell(rowid,'name'); var serviceid= jq(this).getCell(rowid,'serviceid'); if (serviceid==5){ var wsoption = jq(this).getCell(rowid,'gislayerid'); }else{ var wsoption = jq(this).getCell(rowid,'wsoption'); } var id = jq(this).getCell(rowid,'id'); var stat = jq(this).getCell(rowid,'Status'); var parents = new Object(); //make sure the size of the size of the selected services is correct(parents and children). var selectedsrvSize = Object.size(selectedsrv); var multisrvsize=0; if( typeof taxonservices != 'undefined' && taxonservices instanceof Array ){ for(var i = 0;i<=taxonservices.length;i++){ if( typeof taxonservices[i] != 'undefined' && taxonservices[i] instanceof Array ){ // set the parent id in an array parents[i] = "parent" ; multisrvsize = multisrvsize +taxonservices[i].length; } } } if(status){ // don't allow to move services around selectedsrv[selectedsrvSize] = {"name" : name , "serviceid" : serviceid,"id" : id, "status" : "status service : "+stat , "wsoption" : wsoption } ; }else{ // delete item from list. jq('#file_error_msg').html(""); jq('#file_error_msg').html(""); if(parents[id] == "parent"){ for(var i = 0;itotalRecords", row: "Result", repeatitems: false, id: "jobid" // ,subgrid: {root: "ResultSet", row: "Result",repeatitems: false} }, onCellSelect: function (rowid,iCol,cellcontent,e){ var coldescrpid = jobtablecoln.indexOf("share"); var token=jq("#sharebutton_"+rowid).attr("value"); if (token !=0 && typeof token !== 'undefined' ) { if (iCol==coldescrpid){ jq(function() { jq("#showlink").dialog({ modal: true, width: 750, buttons: { "copyButton": { text: "Copy", id: "copybutton_"+rowid, click: function() { } } } }); new Clipboard("#copybutton_" + rowid); jq("#copybutton_" + rowid).attr("data-clipboard-target", "#copylink_"+rowid); fileurl='www.emodnet.eu/dataservices/passfile.php?filetype=resultfile&token='+ token + '&jobid='+rowid; jq("#linktext").html(''); }); } } } }); jQuery("#jobstable").jqGrid('navGrid',"#jobstable",{add:false,edit:false,del:false}); if (typeof(stbl[0])!=="undefined") jq("#cb_"+stbl[0].id).hide(); /****** functions ******/ function usedemo () { if (jq('#demofile').val()!='none'){ jq('#delim_row').val('13+10'); jq('#delim_row').attr('disabled', true); jq('#delim_col').val('9'); jq('#delim_col').attr('disabled', true); jq('#dec_symb').val('46'); jq('#dec_symb').attr('disabled', true); //jq('#inputfile').attr('disabled',true); jq('#row1_is_heading').prop('checked',true); jq('#row1_is_heading').attr('disabled', true); jq('#inputfile').val(''); jq('#scheme').val('LF'); jq('#scheme').attr('disabled', true); jq('#viewfile').show(); jq('#viewfile').attr('href', '/dataservices/passfile.php?filetype=example&name='+jq('#demofile').val()); }else{ jq('#delim_row').attr('disabled', false); jq('#delim_col').attr('disabled', false); jq('#dec_symb').attr('disabled', false); jq('#inputfile').attr('disabled',false); jq('#row1_is_heading').prop('checked',true); jq('#row1_is_heading').attr('disabled', false); jq('#scheme').val('LF'); jq('#scheme').attr('disabled', false); jq('#viewfile').hide(); } } var getColumnSrcIndexByName = function(grid,columnName) { var cm = jq("#servicetable").jqGrid('getGridParam','colNames'), i=0, index=0, l=cm.length, cmName; // var cm = grid.jqGrid('getGridParam','colModel'), while (i'+selectedsrv[k]["name"]+''); k++; } } function rewritecoordList(){ jq( "#coordlist" ).empty(); var k=0; for (key in man_coordinates) { jq( "#coordlist" ).append('
  • '+man_coordinates[k][0]+' '+man_coordinates[k][1]+'
  • '); //console.log("coord list : "+man_coordinates[k][0]+man_coordinates[k][1]); k++; } } //function to change the rank of a webservice function moved(){ var list= jq('#sortable li'); var moved =false; list.each(function(i){ if(jq(this).attr("id")!= 'ws_'+i) moved=true; }); //execute only if moved (not when added) if(moved){ list.each(function(i){ jq(this).attr("id","ws_"+i); selectedsrv[i] = {"name" : jq(this).text() , "serviceid" : jq(this).attr("wsid"),"status" : jq(this).attr("title"),"wsoption" : jq(this).attr("wsoption")} ; }); } } function imageFormat(cellvalue, options, rowObject ){ var stat='' switch (cellvalue) { case "1": //imgsrs=''; stat="pending..."; break; case "2": //imgsrs=''; stat="done"; break; case "3": //imgsrs=''; stat="error"; break; case "0": case "4": //imgsrs=''; stat="wait"; break; } return stat; } function giveShareLink (cellvalue, options, rowObject){ var link=''; var status=jq(rowObject).find("jobstatus").text(); if (status==2 && cellvalue!=0){ link=''; } return link; } function resultfileformat (cellvalue, options, rowObject){ var link=''; var fn=cellvalue; var jobid=jq(rowObject).find("jobid").text(); var field = options["colModel"]["index"]; var userid=jq(rowObject).find("userid").text(); var status=jq(rowObject).find("jobstatus").text(); if(status==1 || status==4){ //var link=''; //todo contextuate links below link=''+fn+''; }else if((status==2 || status==3) && (field=="inputfile")){ if (status==2) link=''+fn+''; else link=''+fn+''; }else if((status==2 || status==3) && (field=="resultfile")){ if (status==2) link=''+fn+''; else link=''; } else if((status==2 || status==3)&& field=="resultreport"){ fn = fn . substring(fn . indexOf("_") + 1); var extention = fn . substring(fn . indexOf(".")); fn = fn . substring(0, fn . indexOf(".")); fn = "results_" + fn + "_" + jobid + extention; if (status==2) link='result'; else link='result'; }else if (status==3){ link=''; } return link; } function metalinkformat (cellvalue, options, rowObject ){ var metaurl=jq(rowObject).find("metaurl").text(); var uuid=jq(rowObject).find("UUID").text(); var imisdasid=jq(rowObject).find("imisdasid").text(); var source=jq(rowObject).find("source").text(); if(metaurl.length>0){ var linkinfo=metaurl; /* }else if(uuid.length>0){ var linkinfo="layermeta.php?uuid=" + uuid; }else if(imisdasid.length>0){ var linkinfo="imis.php?"+"module=dataset&dasid=" + imisdasid; */ } if (typeof(linkinfo)!=='undefined'){ var linkinfo=" "+ source +""; }else{ var linkinfo=source; } return linkinfo; } function progressHandlingFunction(e){ if(e.lengthComputable){ jq('progress').attr({value:e.loaded,max:e.total}); } } function imageFormatmt(cellvalue, options, rowObject){ var imgsrs='' switch (cellvalue) { case "1": imgsrs=''; break; case "0": imgsrs=''; break; } return imgsrs; } function FormatInfo(cellvalue, options, rowObject){ var descrshort=''; if (typeof cellvalue!=='undefined'){ if (cellvalue.length>100){ descrshort=cellvalue.substring(0,100) + "... Read more" ; }else{ descrshort=cellvalue; } } return descrshort; } function FindTrailingNumbers(textToFind,decimalsToFind){ decimalsToFind = typeof decimalsToFind !== 'undefined' ? decimalsToFind : 3; var number =""; //check for number with 3 or less characters for (var i = decimalsToFind; i > 0; i--) { var testCharacter = textToFind.charAt(textToFind.length-i); testCharacter = parseInt(testCharacter); if(!isNaN(testCharacter)){ number=number + testCharacter; } } if(isNaN(number))number="NaN"; return number; } })