From 69ba8ebf2ccad32098b7fce5b248718b1ea69e44 Mon Sep 17 00:00:00 2001 From: Rinke Hoekstra Date: Tue, 22 Jul 2014 10:31:54 +0200 Subject: [PATCH] Now loading scaffold template from a javascript source. The file scaffold.template is now no longer used, but serves as a more convenient way to edit the scaffold that is now stored in a JavaScript variable in scaffold.template.js This solves an issue with cross site origin problems if people tried to use the downloaded full-featured version of PatViz from GitHub and ran it locally (i.e. from a file:/// address). Ugly, but it works. --- index.html | 6 +- js/patents.js | 8 +- scaffold.template | 88 ++++++++-------- scaffold.template.js | 236 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 289 insertions(+), 49 deletions(-) create mode 100644 scaffold.template.js diff --git a/index.html b/index.html index c6436da..3dcd375 100644 --- a/index.html +++ b/index.html @@ -148,7 +148,11 @@ }; - + + + + + diff --git a/js/patents.js b/js/patents.js index 5e61305..77532f5 100644 --- a/js/patents.js +++ b/js/patents.js @@ -501,12 +501,12 @@ function increase(){ function save(){ console.log('save clicked...'); $('#downloadlink').empty(); - $.get('http://data2semantics.github.io/PatViz/scaffold.template',function(data){ + // $.getJSON('http://data2semantics.github.io/PatViz/scaffold.template?callback=?',function(data){ var save_page = $(''); - var $scaffold = $(data); - + //var $scaffold = $(data); + var $scaffold = $(scaffold_template); var data_text = JSON.stringify(data_cache); @@ -533,7 +533,7 @@ function save(){ $("#downloadlink").append("
Download HTML-page
"); $("#downloadlink").append("
Right click the link above, and select 'Save link as...' from the context menu
") - }); + // }); diff --git a/scaffold.template b/scaffold.template index d849a32..77eda60 100644 --- a/scaffold.template +++ b/scaffold.template @@ -1,11 +1,11 @@ Patents Visualizer - + - - + + -" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + " " + + " " + + " " + + "
" + + "
" + + "
" + + "
" + + "
" + + "

Hover over a circle, and information will be shown here...

" + + "
" + + "
" + + "
" + + "
" + + "
" + + "
" + + "
" + + "
" + + "
" + + "" + + " " + + "
" + + "
" + + "
" + + " " + + " " + + "
" + + " PatViz - Patent Collaboration Visualizer, Copyright (c) 2013, Rinke Hoekstra and Loet Leydesdorff
" + + " For more information, please visit the companion website (on PatStat only), or if you would like to run this tool locally, visit our GitHub pages.
" + + "
" + + " " + + " " + + "
" + + "
" + + "
" + + " " + + "" + + " " + + " " + + "" + + "" + + " " + + ""; + \ No newline at end of file