diff --git a/src/edu/stanford/nlp/pipeline/StanfordCoreNLPServer.java b/src/edu/stanford/nlp/pipeline/StanfordCoreNLPServer.java index b83e165d36..1c81dda316 100644 --- a/src/edu/stanford/nlp/pipeline/StanfordCoreNLPServer.java +++ b/src/edu/stanford/nlp/pipeline/StanfordCoreNLPServer.java @@ -1791,6 +1791,8 @@ public void run(Optional> basicAuth, withAuth(server.createContext(uriContext+"/corenlp-brat.cs", new FileHandler("edu/stanford/nlp/pipeline/demo/corenlp-brat.css", "text/css")), basicAuth); withAuth(server.createContext(uriContext+"/corenlp-parseviewer.js", new FileHandler("edu/stanford/nlp/pipeline/demo/corenlp-parseviewer.js", "application/javascript")), basicAuth); + withAuth(server.createContext(uriContext+"/style-vis.css", new FileHandler("edu/stanford/nlp/pipeline/demo/style-vis.css", "text/css")), basicAuth); + withAuth(server.createContext(uriContext+"/static/fonts/Astloch-Bold.ttf", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/Astloch-Bold.ttf", "font/ttfx")), basicAuth); withAuth(server.createContext(uriContext+"/static/fonts/Liberation_Sans-Regular.ttf", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/LiberationSans-Regular.ttf", "font/ttf")), basicAuth); withAuth(server.createContext(uriContext+"/static/fonts/PT_Sans-Caption-Web-Regular.ttf", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/PTSansCaption-Regular.ttf", "font/ttf")), basicAuth); @@ -1798,6 +1800,7 @@ public void run(Optional> basicAuth, withAuth(server.createContext(uriContext+"/annotation_log.js", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/annotation_log.js", "application/javascript")), basicAuth); withAuth(server.createContext(uriContext+"/configuration.js", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/configuration.js", "application/javascript")), basicAuth); withAuth(server.createContext(uriContext+"/dispatcher.js", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/dispatcher.js", "application/javascript")), basicAuth); + withAuth(server.createContext(uriContext+"/head.load.min.js", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/head.load.min.js", "application/javascript")), basicAuth); withAuth(server.createContext(uriContext+"/jquery.svg.min.js", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/jquery.svg.min.js", "application/javascript")), basicAuth); withAuth(server.createContext(uriContext+"/jquery.svgdom.min.js", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/jquery.svg.min.js", "application/javascript")), basicAuth); withAuth(server.createContext(uriContext+"/url_monitor.js", new BytesFileHandler("edu/stanford/nlp/pipeline/demo/url_monitor.js", "application/javascript")), basicAuth); diff --git a/src/edu/stanford/nlp/pipeline/demo/head.load.min.js b/src/edu/stanford/nlp/pipeline/demo/head.load.min.js new file mode 100644 index 0000000000..8a561cd2d9 --- /dev/null +++ b/src/edu/stanford/nlp/pipeline/demo/head.load.min.js @@ -0,0 +1,8 @@ +/** + Head JS The only script in your + Copyright Tero Piirainen (tipiirai) + License MIT / http://bit.ly/mit-license + Version 0.9 + + http://headjs.com +*/(function(a){var b=a.documentElement,c,d,e=[],f=[],g={},h={},i=a.createElement("script").async===true||"MozAppearance"in a.documentElement.style||window.opera;var j=window.head_conf&&head_conf.head||"head",k=window[j]=window[j]||function(){k.ready.apply(null,arguments)};var l=0,m=1,n=2,o=3;i?k.js=function(){var a=arguments,b=a[a.length-1],c=[];t(b)||(b=null),s(a,function(d,e){d!=b&&(d=r(d),c.push(d),x(d,b&&e==a.length-2?function(){u(c)&&p(b)}:null))});return k}:k.js=function(){var a=arguments,b=[].slice.call(a,1),d=b[0];if(!c){f.push(function(){k.js.apply(null,a)});return k}d?(s(b,function(a){t(a)||w(r(a))}),x(r(a[0]),t(d)?d:function(){k.js.apply(null,b)})):x(r(a[0]));return k},k.ready=function(a,b){if(a=="dom"){d?p(b):e.push(b);return k}t(a)&&(b=a,a="ALL");var c=h[a];if(c&&c.state==o||a=="ALL"&&u()&&d){p(b);return k}var f=g[a];f?f.push(b):f=g[a]=[b];return k},k.ready("dom",function(){c&&u()&&s(g.ALL,function(a){p(a)}),k.feature&&k.feature("domloaded",true)});function p(a){a._done||(a(),a._done=1)}function q(a){var b=a.split("/"),c=b[b.length-1],d=c.indexOf("?");return d!=-1?c.substring(0,d):c}function r(a){var b;if(typeof a=="object")for(var c in a)a[c]&&(b={name:c,url:a[c]});else b={name:q(a),url:a};var d=h[b.name];if(d&&d.url===b.url)return d;h[b.name]=b;return b}function s(a,b){if(a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c div { + display: table-cell; + vertical-align: middle; +} +.center_wrapper > div > div { + /* match jQuery UI .ui-widget-content color */ + color: #2e6e9e; + margin-left: auto; + margin-right: auto; + width: 30em; + font-size: 12px; + font-family: 'Liberation Sans', Verdana, Arial, Helvetica, sans-serif; +} +.center_wrapper > div > div h1 { + text-align: center; + font-size: 14px; +} +#no_svg_wrapper { + display: none; +} + +svg { + width: 100%; + height: 1px; + border: 1px solid #7fa2ff; + font-size: 15px; + /* font-size: 14px; */ +} +svg.reselect { + border: 1px solid #ff3333; +} + +/* "basic" font */ +text { + font-size: 13px; + font-family: 'Liberation Sans', Verdana, Arial, Helvetica, sans-serif; +} + +@-webkit-keyframes pulse { + 0% { color: #9999ff; margin-top: 0; } + 50% { color: #ffffff; margin-top: 7px; } + 100% { color: #9999ff; margin-top: 0; } +} + +path { + pointer-events: none; +} + +/* "basic" font */ +.span text { + /* font-size: 10.5px; */ + font-size: 10px; + text-anchor: middle; + font-family: 'PT Sans Caption', sans-serif; + pointer-events: none; +} + +/* this should likely match span font */ +.span_type_label { + font-size: 11px; + font-family: 'PT Sans Caption', sans-serif; +} +/* this should likely match arc font */ +.arc_type_label { + font-size: 11px; + font-family: 'PT Sans Caption', sans-serif; +} +.attribute_type_label .ui-button-text { + font-size: 11px; + font-family: 'PT Sans Caption', sans-serif; +} + +.span rect { + stroke-width: 0.75; +} + +.glyph { + fill: #444444; + font-family: sans-serif; + font-weight: bold; +} +.attribute_warning { + stroke: red; +} + +.span rect.False_positive { + stroke: #ff4141; + stroke-width: 2; +} + +.shadow_True_positive { + fill: #00ff00; +} + +.shadow_False_positive { + fill: #ff4141; +} + +#commentpopup.comment_False_positive { + background-color: #ff4141; +} + +.span rect.False_negative { + stroke: #c20000; + fill: #ffffff; + stroke-width: 2; +} + +.shadow_False_negative { + fill: #c20000; +} + +#commentpopup.comment_False_negative { + background-color: #c20000; +} + +.span rect.AnnotationError { + stroke-width: 1; +} + +.shadow_AnnotationError { + fill: #ff0000; +} + +#commentpopup.comment_AnnotationError { + background-color: #ff7777; +} + +.span rect.AnnotationWarning { + stroke-width: 1; +} + +.shadow_AnnotationWarning { + fill: #ff8800; +} + +#commentpopup.comment_AnnotationWarning { + background-color: #ff9900; +} + +.shadow_AnnotatorNotes { + /* fill: #00cc00; */ + fill: #3ab7ee; +} +#commentpopup.comment_AnnotatorNotes { + /* background-color: #00cc00; */ + /* background-color: #DAF7DC; */ + background-color: #d7e7ee; +} + +.shadow_Normalized { + /* fill: #00cc00; */ + fill: #3aee37; +} +#commentpopup.comment_Normalized { + /* background-color: #00cc00; */ + /* background-color: #DAF7DC; */ + background-color: #d7eee7; +} +rect.Normalized { + stroke-width: 1.5; +} + +.shadow_AnnotationIncomplete { + fill: #aaaaaa; +} +.span rect.AnnotationIncomplete { + stroke: #002200; + stroke-width: 0.5; + fill: #ffffff; +} +#commentpopup.comment_AnnotationIncomplete { + background-color: #ffff77; +} + +.shadow_AnnotationUnconfirmed { + fill: #eeeeee; +} +.span rect.AnnotationUnconfirmed { + stroke: #002200; + stroke-width: 0.5; + opacity : 0.5; +} +#commentpopup.comment_AnnotationUnconfirmed { + background-color: #ddddff; +} + +.span rect.True_positive { + /* stroke: #007700; */ +} + +rect.shadow_EditHighlight { + fill: #ffff99; +} +.shadow_EditHighlight_arc { + stroke: #ffff99; +} + +.span path { + fill: none; +} + +.span path.curly { + /* 'stroke' def here blocks 'stroke' set in JS..? */ + /* stroke: grey; */ + stroke-width: 0.5; +} + +.span path.boxcross { + stroke: black; + opacity: 0.5; +} + +.arcs path { + stroke: #989898; + fill: none; + stroke-width: 1; +} + +.arcs .highlight path { + stroke: #000000; + stroke-width: 1.5; + opacity: 1; +} +.arcs .highlight text { + stroke: black; + fill: black; + stroke-width: 0.5; +} +.span.highlight rect { + stroke-width: 2px; +} +.span rect.reselect { + stroke-width: 2px; +} +.span rect.reselectTarget { + stroke-width: 2px; +} +.arcs .reselect path { + stroke-width: 2px; + stroke: #ff0000 !important; +} +.arcs .reselect text { + fill: #ff0000 !important; +} + +.span rect.badTarget { + stroke: #f00; +} + +.arcs text { + font-size: 9px; + text-anchor: middle; + font-family: 'PT Sans Caption', sans-serif; + /* dominant-baseline: central; */ + cursor: default; +} + +.background0 { + stroke: none; + fill: #ffffff; +} + +.background1 { + stroke: none; + fill: #eeeeee; +} + +.backgroundHighlight { + stroke: none; + fill: #ffff99; +} + +.sentnum text { + fill: #999999; + text-anchor: end; +} + +.sentnum path { + stroke: #999999; + stroke-width: 1px; +} + +.span_cue { + fill: #eeeeee !important; +} + +.drag_stroke { + stroke: black; +} +.drag_fill { + fill: black; +} + + +.dialog { + display: none; +} +#span_free_div, #arc_free_div { + float: left; +} +fieldset { + /* match relevant parts of jQuery UI .ui-widget-content */ + border: 1px solid #a6c9e2; + /* round corners, same as jQuery UI .ui-corner-all */ + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + /* to prevent border from running into legend */ + margin-top: 5px; +} +fieldset legend { + font-weight: bold; + font-size: 90%; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background-color: #70a8d2; + color: white; + padding-left: 0.5em; + padding-right: 0.5em; +} +.label-like { + /* for UI consistency, this should match the "fieldset legend" style; + sorry about the duplication. */ + font-family: monospace; + font-weight: bold; + font-size: 90%; + /* match jQuery UI .ui-widget-content color */ + color: #2e6e9e; +} + +.accesskey { + text-decoration: underline; +} + + +.shadow { + -moz-box-shadow: 5px 5px 5px #444444; + -webkit-box-shadow: 5px 5px 5px #444444; + box-shadow: 5px 5px 5px #444444; +} + +#span_selected, #arc_origin, #arc_target { + font-weight: bold; +} + +#commentpopup { + font-family: 'Liberation Sans', Verdana, Arial, Helvetica, sans-serif; + position: fixed; + top: 0; + left: 0; + opacity: 0.95; + padding: 10px; + display: none; + border: 1px outset #000000; + background-color: #f5f5f9; + /* background-color: #d7e7ee; */ + /* background-color: #eeeeee; */ + color: #000000; + z-index: 20; + -moz-box-shadow: 5px 5px 5px #aaaaaa; + -webkit-box-shadow: 5px 5px 5px #aaaaaa; + box-shadow: 5px 5px 5px #aaaaaa; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + max-width: 80%; +} +#more_info_readme { + height: 350px; +} +#readme_container { + position: relative; +} +#more_readme_button { + padding: 2px 5px; + position: absolute; + top: -2px; + right: -2px; +} + +.comment_id { + vertical-align: top; + float:right; + font-size: 75%; + font-family: monospace; + color: #333333; +} +.comment_type { + /* font-weight: bold; */ +} +.comment_text { + font-weight: bold; +} +.comment_type_id_wrapper { + /* padding for floating ID */ + padding-right: 2em; +} +.norm_info_label { + font-weight: bold; + font-size: 80%; +} +.norm_info_value { + font-size: 80%; +} +.norm_info_img { + float: right; + margin-left: 1em; +} + +#search_form select { + width: 100%; /* deal with overflowing selectboxes */ +} + +.scroll_fset { + height: 200px; +} +.scroll_fset fieldset { + height: 100%; + overflow-x: hidden; + overflow-y: hidden; +} +/* HACK to display properly */ + .scroll_fset { + margin-bottom: 2.5em; + } + .scroll_fset fieldset { + padding-bottom: 2em; + } +/* end HACK */ +.scroll_fset div.scroller { + overflow: auto; + width: 100%; + height: 100%; +} + +#span_highlight_link, #arc_highlight_link, #viewspan_highlight_link { + float: right; +} + +.unselectable { + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + -o-user-select: none; + user-select: none; + cursor: default; +} +@font-face { + font-family: 'Liberation Sans'; + font-style: normal; + font-weight: normal; + src: local('Liberation Sans'), local('Liberation-Sans'), url('static/fonts/Liberation_Sans-Regular.ttf') format('truetype'); +} +@font-face { + font-family: 'PT Sans Caption'; + font-style: normal; + font-weight: normal; + src: local('PT Sans Caption'), local('PTSans-Caption'), url('static/fonts/PT_Sans-Caption-Web-Regular.ttf') format('truetype'); +} + +/* Apple iPad, iPhone, iPod */ + +* { + -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-text-size-adjust: none; + select: none; +} + +.span rect.AddedAnnotation { + stroke: #ff4141; + stroke-width: 2; +} +.shadow_AddedAnnotation { + fill: #ff4141; +} +#commentpopup.comment_AddedAnnotation { + background-color: #ffcccc; +} +.span rect.MissingAnnotation { + stroke: #ffffff; + stroke-width: 2; +} +.shadow_MissingAnnotation { + fill: #ff4141; + opacity: 0.3; +} +#commentpopup.comment_MissingAnnotation { + background-color: #ffcccc; +} +.span rect.MissingAnnotation + text { + opacity: 0.5; +} +.span rect.ChangedAnnotation { + stroke: #ffff99; + stroke-width: 2; +} +.shadow_ChangedAnnotation { + fill: #ff4141; +} +#commentpopup.comment_ChangedAnnotation { + background-color: #ffcccc; +} diff --git a/src/edu/stanford/nlp/pipeline/webapp/CoreNLPServlet.java b/src/edu/stanford/nlp/pipeline/webapp/CoreNLPServlet.java index 0bd853b5f3..3eaa9d4283 100644 --- a/src/edu/stanford/nlp/pipeline/webapp/CoreNLPServlet.java +++ b/src/edu/stanford/nlp/pipeline/webapp/CoreNLPServlet.java @@ -188,7 +188,7 @@ public void outputVisualise(PrintWriter out, Annotation annotation) // Include the Javascript libraries necessary to run brat. out.println(""); + "head.load.min.js\">"); // Main Javascript that hooks into all that we have introduced so far. out.println("");