js/plugins/exportTimeline.js
function () {
      $("#addtrack").css("visibility","hidden");
      var element = document.getElementsByTagName('path')[0];
      element.setAttribute("stroke" , "black"); 
      element.setAttribute("fill" , "none");
      element = document.getElementsByTagName('line');
      for( var i=0 ; i<element.length ; i++)
      {
        element[i].setAttribute("stroke" , "black");
        element[i].setAttribute("fill" , "none");
          
      }
      var svg = document.querySelector(spec.timelineDiv+" svg");
      var serializer = new XMLSerializer();
      var source = serializer.serializeToString(svg);
      var link = document.createElement("a");

      //name spaces
      if(!source.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/)){
          source = source.replace(/^<svg/, '<svg xmlns="http://www.w3.org/2000/svg"');
      }
      if(!source.match(/^<svg[^>]+"http\:\/\/www\.w3\.org\/1999\/xlink"/)){
          source = source.replace(/^<svg/, '<svg xmlns:xlink="http://www.w3.org/1999/xlink"');
      }
      //xml declaration
      source = '<?xml version="1.0" standalone="no"?>\r\n' + source;

      //converting SVG source to URI data scheme.
      var url = "data:image/svg+xml;charset=utf-8,"+encodeURIComponent(source);
      link.download = "clinical-timeline.svg";
      link.href = url;
      link.click();
      $("#addtrack").css("visibility","visible");
    }
function () {
      $("#addtrack").css("visibility","hidden");
      var element = document.getElementsByTagName('path')[0];
      element.setAttribute("stroke" , "black"); 
      element.setAttribute("fill" , "none");
      element = document.getElementsByTagName('line');
      for( var i=0 ; i<element.length ; i++)
      {
        element[i].setAttribute("stroke" , "black");
        element[i].setAttribute("fill" , "none");
          
      }
      var svg = document.querySelector(spec.timelineDiv+" svg");
      var serializer = new XMLSerializer();
      var source = serializer.serializeToString(svg);
      var link = document.createElement("a");

      //name spaces
      if(!source.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/)){
          source = source.replace(/^<svg/, '<svg xmlns="http://www.w3.org/2000/svg"');
      }
      if(!source.match(/^<svg[^>]+"http\:\/\/www\.w3\.org\/1999\/xlink"/)){
          source = source.replace(/^<svg/, '<svg xmlns:xlink="http://www.w3.org/1999/xlink"');
      }
      //xml declaration
      source = '<?xml version="1.0" standalone="no"?>\r\n' + source;

      //converting SVG source to URI data scheme.
      var url = "data:image/svg+xml;charset=utf-8,"+encodeURIComponent(source);
      link.download = "clinical-timeline.svg";
      link.href = url;
      link.click();
      $("#addtrack").css("visibility","visible");
    }
function ( ) { $ ( "#addtrack" ) . css ( "visibility" , "hidden" ) ; var element = document . getElementsByTagName ( 'path' ) [ 0 ] ; element . setAttribute ( "stroke" , "black" ) ; element . setAttribute ( "fill" , "none" ) ; element = document . getElementsByTagName ( 'line' ) ; for ( var i = 0 ; i < element . length ; i ++ ) { element [ i ] . setAttribute ( "stroke" , "black" ) ; element [ i ] . setAttribute ( "fill" , "none" ) ; } var svg = document . querySelector ( spec . timelineDiv + " svg" ) ; var serializer = new XMLSerializer ( ) ; var source = serializer . serializeToString ( svg ) ; var link = document . createElement ( "a" ) ; //name spaces if ( ! source . match ( / ^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg" / ) ) { source = source . replace ( / ^<svg / , '<svg xmlns="http://www.w3.org/2000/svg"' ) ; } if ( ! source . match ( / ^<svg[^>]+"http\:\/\/www\.w3\.org\/1999\/xlink" / ) ) { source = source . replace ( / ^<svg / , '<svg xmlns:xlink="http://www.w3.org/1999/xlink"' ) ; } //xml declaration source = '<?xml version="1.0" standalone="no"?>\r\n' + source ; //converting SVG source to URI data scheme. var url = "data:image/svg+xml;charset=utf-8," + encodeURIComponent ( source ) ; link . download = "clinical-timeline.svg" ; link . href = url ; link . click ( ) ; $ ( "#addtrack" ) . css ( "visibility" , "visible" ) ; }
Exports the clinical-timeline as SVG
Exports the clinical - timeline as SVG