Major redesign of JS and Sass assets
diff --git a/public/js/demo/all.html b/public/js/demo/all.html
new file mode 100644
index 0000000..aba76c4
--- /dev/null
+++ b/public/js/demo/all.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS demo</title>
+ <meta charset="utf-8" />
+ <script src="../lib/dagre/dagre.min.js"></script>
+ <script src="../src/util.js"></script>
+ <script src="../src/match.js"></script>
+ <script src="../src/menu.js"></script>
+ <script src="../src/matchInfo.js"></script>
+
+ <script src="./all.js"></script>
+
+ <link type="text/css" rel="stylesheet" href="../../css/build/kalamar.css" />
+ </head>
+ <body>
+ <div id="kalamar-bg"></div>
+ <header>
+ <a href="/" class="logo"><h1><span>KorAP - Corpus Analysis Platform</span></h1></a>
+ <form autocomplete="off" action="/kalamar">
+ <div id="searchbar">
+ <input type="search"
+ placeholder="Find ..."
+ name="q"
+ id="q-field"
+ autofocus="autofocus" />
+ <button type="submit"><span>Go</span></button>
+<!--
+ <i class="fa fa-arrow-circle-down show-hint" onclick="hint.popUp()"></i>
+-->
+ </div>
+ with <span class="select">
+<!-- Change this to js-menu -->
+ <select name="ql" id="ql-field">
+ <option value="poliqarp">Poliqarp</option>
+ <option value="cosmas2">Cosmas II</option>
+ <option value="annis">Annis</option>
+ <option value="cql">CQL v1.2</option>
+ </select>
+ </span>
+ <div id="button-right">
+ <input type="checkbox"
+ value="1"
+ name="cutoff"
+ class="checkbox"
+ id="q-cutoff-field" />
+ <label for="q-cutoff-field"><span></span>Glimpse</label>
+
+ <!-- Todo: open tutorial - like openTutorial() -->
+ <a href="/about" title="Tutorial" class="tutorial"><span>Tutorial</span></a>
+
+ </div>
+ </form>
+ </header>
+ <main>
+ <div class="resultinfo">
+ <div id="pagination">
+ <a rel="prev"><span><span><</span></span></a>
+ <a rel="self"><span>1</span></a>
+ <a href="#2"><span>2</span></a>
+ <a href="#3"><span>3</span></a>
+ <a class="ellipsis"><span><span>...</span></span></a>
+ <a href="#52230"><span>52230</span></a>
+ <a rel="next" href="#2"><span><span>></span></span></a>
+ </div>
+ <p class="found">Found <span id="total-results">unknown amount of matches</span> in 59.93ms</p>
+ </div>
+
+ <div id="search">
+ <ol class="align-left">
+ <li data-corpus-id="WPD"
+ data-doc-id="WWW"
+ data-text-id="03313"
+ data-match-id="p102-103"
+ data-available-info="base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans"
+ id="WPD-WWW.03313-p102-103">
+ <div>
+ <div class="snippet startMore endMore"><span class="context-left">In diesem Beispiel ist zu sehen, dass die beiden Variablen a und b lediglich ihre Werte an die Funktion </span><span class="match">test</span><span class="context-right"> übergeben, aber im Gegensatz zu einem Referenzparamter dabei unverändert bleiben.</span></div>
+ <!-- only inject via javascript! -->
+ </div>
+ <p class="ref"><strong>Wertparameter</strong> by Hubi,Zwobot,4; published on 2005-03-28 as WWW.03313 (WPD)</p>
+ <!-- only inject via javascript! -->
+ <!--
+ <ul class="action right">
+ <li class="close" title="Close"><a href="#">Close hit<i class="fa fa-toggle-up"></i></a></li>
+ <li class="open" title="Open in new tab"><a href="#WPD-WWW.03313-p102-103" target="_blank"><i class="fa fa-external-link-square"></i></a></li>
+ <li onclick="showTable(this)" title="Annotations"><i class="fa fa-info-circle"></i></li>
+ </ul>
+-->
+ </li>
+ <li data-corpus-id="WPD"
+ data-doc-id="FFF"
+ data-text-id="01460"
+ data-match-id="p119-120"
+ data-available-info="base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans"
+ id="WPD-FFF.01460-p119-120">
+ <div>
+ <div class="snippet startMore endMore"><span class="context-left">Der Fehler unterläuft häufig bei der direkten Übersetzung aus dem Englischen, wenn im originalen Ausdruck die beiden Wortteile verschiedene Wörter sind und sich das Adjektiv wahlweise auf das erste oder zweite Wort bezieht. Ein Beispiel ist multiples Testproblem für multiple </span><span class="match">test</span><span class="context-right"> problem.</span></div>
+ <div class="tokenInfo"></div>
+ </div>
+ <p class="ref"><strong>Fehlbezogenes Adjektiv</strong> by Joni2,Peterlustig,BWBot; published on 2005-03-28 as FFF.01460 (WPD)</p>
+ <ul class="action right">
+ <li class="close" title="Close"><a href="#"><i class="fa fa-toggle-up"></i></a></li>
+ <li class="open" title="Open in new tab"><a href="#WPD-FFF.01460-p119-120" target="_blank"><i class="fa fa-external-link-square"></i></a></li>
+ <li onclick="showTable(this)" title="Annotations"><i class="fa fa-info-circle"></i></li>
+ </ul>
+ </li>
+
+ <li data-corpus-id="WPD"
+ data-doc-id="HHH"
+ data-text-id="06056"
+ data-match-id="p2564-2565"
+ data-available-info="base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans"
+ id="WPD-HHH.06056-p2564-2565">
+ <div>
+ <div class="snippet startMore endMore"><span class="context-left">HDTV Samples from European (and other) broadcasters and </span><span class="match">test</span><span class="context-right"> transmissions in Europe</span></div>
+ <div class="tokenInfo"></div>
+ </div>
+ <p class="ref"><strong>High Definition Television</strong> by ArtMechanic,TheK,Andreas -horn- Hornig; published on 2005-03-28 as HHH.06056 (WPD)</p>
+ <ul class="action right">
+ <li class="close" title="Close"><a href="#"><i class="fa fa-toggle-up"></i></a></li>
+ <li class="open" title="Open in new tab"><a href="#WPD-HHH.06056-p2564-2565" target="_blank"><i class="fa fa-external-link-square"></i></a></li>
+ <li onclick="showTable(this)" title="Annotations"><i class="fa fa-info-circle"></i></li>
+ </ul>
+ </li>
+ </div>
+ <div id="menu"></div>
+
+ <div class="intro">
+ <p><strong>KorAP</strong> is a new Corpus Analysis Platform, suited for large, multiple annotated corpora and complex search queries independent of particular research questions.</p>
+ <p>This is the new frontend for KorAP, with currently no access to restricted corpora. For full access, please visit the <a href="http://korap.ids-mannheim.de/app">first frontend</a>.</p>
+
+ <p><strong>New to KorAP?</strong> Please check out our <a href="#">tutorial</a>!</p>
+
+ <p>KorAP is developed at the <a href="http://www.ids-mannheim.de">Institute for German Language</a> and funded by the <a href="http://www.leibniz-gemeinschaft.de/en/about-us/leibniz-competition/projekte-2011/2011-funding-line-2/">Leibniz Association</a>. The separated modules are being published as open source at <a href="http://github.com/KorAP">GitHub</a>.</p>
+ </div>
+ <div id="logos">
+ <div>
+ <a href="http://www.ids-mannheim.de/" class="logo"><p id="ids-logo"><span>Developed at the Institute for German Language (IDS)</span></p></a>
+ <a href="http://www.leibniz-gemeinschaft.de/" class="logo"><p id="leibniz-logo"><span>Funded by the Leibniz Association</span></p></a>
+ </div>
+ </div>
+
+ </main>
+ </body>
+</html>
diff --git a/public/js/demo/all.js b/public/js/demo/all.js
new file mode 100644
index 0000000..b0871be
--- /dev/null
+++ b/public/js/demo/all.js
@@ -0,0 +1,168 @@
+var snippet = "<span title=\"cnx/l:meist\">" +
+ " <span title=\"cnx/p:ADV\">" +
+ " <span title=\"cnx/syn:@PREMOD\">" +
+ " <span title=\"mate/l:meist\">" +
+ " <span title=\"mate/p:ADV\">" +
+ " <span title=\"opennlp/p:ADV\">meist</span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ "</span>" +
+ "<span title=\"cnx/l:deutlich\">" +
+ " <span title=\"cnx/p:A\">" +
+ " <span title=\"cnx/syn:@PREMOD\">" +
+ " <span title=\"mate/l:deutlich\">" +
+ " <span title=\"mate/m:degree:pos\">" +
+ " <span title=\"mate/p:ADJD\">" +
+ " <span title=\"opennlp/p:ADJD\">deutlich</span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ "</span>" +
+ "<span title=\"cnx/l:fähig\">" +
+ " <span title=\"cnx/l:leistung\">" +
+ " <span title=\"cnx/p:A\">" +
+ " <span title=\"cnx/syn:@NH\">" +
+ " <span title=\"mate/l:leistungsfähig\">" +
+ " <span title=\"mate/m:degree:comp\">" +
+ " <span title=\"mate/p:ADJD\">" +
+ " <span title=\"opennlp/p:ADJD\">leistungsfähiger</span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ "</span>";
+
+var treeSnippet =
+ "<span class=\"context-left\"></span>" +
+ "<span class=\"match\">" +
+ " <span title=\"xip/c:MC\">" +
+ " <span title=\"xip/c:TOP\">" +
+ " <span title=\"xip/c:PP\">" +
+ " <span title=\"xip/c:PREP\">Mit</span>" +
+ " <span title=\"xip/c:NP\">" +
+ " <span title=\"xip/c:DET\">dieser</span>" +
+ " <span title=\"xip/c:NPA\">" +
+ " <span title=\"xip/c:NOUN\">Methode</span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " <span title=\"xip/c:VERB\">ist</span>" +
+ " <span title=\"xip/c:NP\">" +
+ " <span title=\"xip/c:PRON\">es</span>" +
+ " </span>" +
+ " <span title=\"xip/c:AP\">" +
+ " <span title=\"xip/c:ADV\">nun</span>" +
+ " <span title=\"xip/c:ADJ\">möglich</span>" +
+ " </span>" +
+ " <span title=\"xip/c:ADV\">z. B.</span>" +
+ " <span title=\"xip/c:NPA\">" +
+ " <span title=\"xip/c:NP\">" +
+ " <span title=\"xip/c:NOUN\">Voice</span>" +
+ " </span>" +
+ " </span>" + "(" +
+ " <span title=\"xip/c:INS\">" +
+ " <span title=\"xip/c:NPA\">" +
+ " <span title=\"xip/c:NP\">" +
+ " <span title=\"xip/c:NOUN\">Sprache</span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" + ")" +
+ " <span title=\"xip/c:VERB\">bevorzugt</span>" +
+ " <span title=\"xip/c:PP\">" +
+ " <span title=\"xip/c:PREP\">in</span>" +
+ " <span title=\"xip/c:NP\">" +
+ " <span title=\"xip/c:PRON\">der</span>" +
+ " </span>" +
+ " <span title=\"xip/c:NPA\">" +
+ " <span title=\"xip/c:NP\">" +
+ " <span title=\"xip/c:NOUN\">Bridge</span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " <span title=\"xip/c:INFC\">" +
+ " <span title=\"xip/c:INS\">" +
+ " <span title=\"xip/c:VERB\">weiterzugeben</span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ " </span>" +
+ "</span>" +
+ "<span class=\"context-right\"></span>";
+
+/*
+var available =[
+ 'base/s=spans',
+ 'corenlp/c=spans',
+ 'corenlp/ne=tokens',
+ 'corenlp/p=tokens',
+ 'corenlp/s=spans',
+ 'glemm/l=tokens',
+ 'mate/l=tokens',
+ 'mate/m=tokens',
+ 'mate/p=tokens',
+ 'opennlp/p=tokens',
+ 'opennlp/s=spans',
+ 'tt/l=tokens',
+ 'tt/p=tokens',
+ 'tt/s=spans'
+];
+*/
+/*
+var match = {
+ 'corpusID' : 'WPD',
+ 'docID' : 'UUU',
+ 'textID' : '01912',
+ 'matchID' : 'p121-122'
+};
+*/
+
+var menuContent = [
+ ['cnx/c', 'cnx', 'c'],
+ ['mate/c', 'mate', 'c'],
+ ['base/c', 'base', 'c'],
+ ['xip/c', 'xip', 'c'],
+ ['tt/c', 'tt', 'c']
+];
+
+// Parse and show the table
+// Override getMatchInfo API call
+KorAP.API.getMatchInfo = function(match, callObj) {
+ if (callObj["spans"] !== undefined && callObj["spans"] === true) {
+ return { "snippet": treeSnippet };
+ }
+ else {
+ return { "snippet": snippet };
+ }
+};
+
+/**
+ * Do some things at the beginning.
+ */
+window.onload = function () {
+
+ // Decorate actions
+ KorAP.init();
+
+ var menu = KorAP.MatchTreeMenu.create(
+ undefined,
+ menuContent
+ );
+
+ // Don't hide!!!
+ menu.hide = function () {};
+ document.getElementById('menu').appendChild(menu.element());
+ menu.limit(3);
+ menu.show();
+ menu.focus();
+ /*
+ var e = KorAP.MatchInfo.create(match, available);
+ document.getElementById('WPD-WWW.03313-p102-103').children[0].appendChild(e.element());
+ e.addTree('cnx', 'c');
+ */
+};
diff --git a/public/js/demo/matchInfo.html b/public/js/demo/match.html
similarity index 94%
rename from public/js/demo/matchInfo.html
rename to public/js/demo/match.html
index c79642b..373b0ee 100644
--- a/public/js/demo/matchInfo.html
+++ b/public/js/demo/match.html
@@ -1,14 +1,19 @@
<!DOCTYPE html>
<html>
<head>
- <title>MatchInfo demo</title>
+ <title>Match demo</title>
<meta charset="utf-8" />
<script src="../lib/dagre/dagre.min.js"></script>
<script src="../src/menu.js"></script>
- <script src="../src/matchInfo.js"></script>
- <link type="text/css" rel="stylesheet" href="../../css/font-awesome.min.css"></link>
- <link type="text/css" rel="stylesheet" href="../../css/build/kalamar.css"></link>
- <style type="text/css" rel="stylesheet">
+ <script src="../src/match.js"></script>
+ <link type="text/css"
+ rel="stylesheet"
+ href="../../css/font-awesome.min.css"></link>
+ <link type="text/css"
+ rel="stylesheet"
+ href="../../css/build/kalamar.css"></link>
+ <style type="text/css"
+ rel="stylesheet">
body {
background-color: #ffa500;
@@ -146,7 +151,8 @@
'corpusID' : 'WPD',
'docID' : 'UUU',
'textID' : '01912',
- 'pos' : 'p121-122'
+ 'pos' : 'p121-122',
+ 'available' : available
};
// Parse and show the table
@@ -160,13 +166,14 @@
}
};
-var e = KorAP.MatchInfo.create(match, available);
+var e = KorAP.Match.create(match).open();
document.getElementsByTagName('body')[0].appendChild(e.element());
-
e.addTree('cnx', 'c');
+
+
/*
var t = KorAP.MatchInfo.create(match, available).getTable();
document.getElementsByClassName('matchtable')[0]
diff --git a/public/js/demo/menu.html b/public/js/demo/menu.html
new file mode 100644
index 0000000..985be65
--- /dev/null
+++ b/public/js/demo/menu.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Menu demo</title>
+ <meta charset="utf-8" />
+ <script src="../src/menu.js"></script>
+<!--
+ <link href="../../css/vc.css" rel="stylesheet" type="text/css"></link>
+-->
+ <link href="../../css/build/kalamar.css" rel="stylesheet" type="text/css"></link>
+ <style type="text/css" rel="stylesheet">
+.info {
+ background-color: #ddd;
+ color: black;
+ padding: 1em;
+ font-family: mono;
+}
+body {
+ margin: 0;
+ background-color: #ddd;
+}
+ </style>
+ </head>
+ <body>
+ <div style="position: absolute; background-color: #7ba400; height: 50px; width: 100%;"></div>
+
+ <div id="menu" class="vc"></div>
+
+ <main>
+ <div>
+ <div id="pagination"><a rel="prev"><span><i class="fa fa-caret-left"></i></span></a><a rel="self"><span>1</span></a><a href="/kalamar?q=der+%5Bmate/m%3Dnumber:sg%5D&ql=poliqarp&p=2"><span>2</span></a><a href="/kalamar?q=der+%5Bmate/m%3Dnumber:sg%5D&ql=poliqarp&p=3"><span>3</span></a><span><i class="fa fa-ellipsis-h"></i></span><a href="/kalamar?q=der+%5Bmate/m%3Dnumber:sg%5D&ql=poliqarp&p=52230"><span>52230</span></a><a rel="next" href="/kalamar?q=der+%5Bmate/m%3Dnumber:sg%5D&ql=poliqarp&p=2"><span><i class="fa fa-caret-right"></i></span></a></div>
+ </div>
+ </main>
+
+ <script>
+KorAP.OwnMenuItem = {
+ create : function (params) {
+ return Object.create(KorAP.MenuItem).upgradeTo(KorAP.OwnMenuItem)._init(params);
+ },
+ content : function (content) {
+ if (arguments.length === 1) {
+ this._content = content;
+ };
+ return this._content;
+ },
+
+ // enter or click
+ onclick : function () {
+ console.log(this._name);
+ },
+
+ // right arrow
+ further : function () {
+ console.log("Further: " + this._name);
+ },
+ _init : function (params) {
+ if (params[0] === undefined)
+ throw new Error("Missing parameters");
+
+ this._name = params[0];
+ this._content = document.createTextNode(this._name);
+ this._lcField = ' ' + this.content().textContent.toLowerCase();
+
+ return this;
+ }
+};
+
+KorAP.OwnPrefix = {
+ create : function () {
+ return Object.create(KorAP.MenuPrefix)
+ .upgradeTo(KorAP.OwnPrefix)
+ ._init();
+ },
+ onclick : function () {
+ console.log('Prefix: ' + this.value());
+ }
+}
+
+KorAP.OwnMenu = {
+ create : function (params) {
+ return Object.create(KorAP.Menu)
+ .upgradeTo(KorAP.OwnMenu)
+ ._init(KorAP.OwnMenuItem, KorAP.OwnPrefix, params);
+ }
+};
+
+var menu = KorAP.OwnMenu.create([
+ ['Titel', 'title', 'string'],
+ ['Untertitel', 'subTitle', 'string'],
+ ['Veröffentlichungsdatum', 'pubDate', 'date'],
+ ['Länge', 'length', 'integer'],
+ ['Autor', 'author', 'string'],
+ ['Genre', 'genre', 'string'],
+ ['corpusID', 'corpusID', 'string'],
+ ['docID', 'docID', 'string'],
+ ['textID', 'textID', 'string']
+]);
+
+ document.getElementById('menu').appendChild(menu.element());
+
+ menu.limit(3);
+ menu.show('');
+ menu.focus();
+
+ </script>
+ </body>
+</html>