Skip to content
Snippets Groups Projects
Commit f1cc5859 authored by Eike Cochu's avatar Eike Cochu
Browse files

added popover directive, removed unused css rules

added bsPopover directive
added popover to explorer topics
removed unused css rules
merged ellipsis and ellipsize
removed unused helpers
added scrollbar to topics list in explorer
parent e86a9d32
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<pagination total="articlesTotal" page="page" limit="limit" change="changePage" /> <pagination total="articlesTotal" page="page" limit="limit" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<div class="col-md-12"> <div class="col-md-12">
<h3>Similar articles</h3> <h3>Similar articles</h3>
<ul class="list-unstyled" ng-attr-start="{{(page-1)*limit+1}}"> <ul class="list-unstyled" ng-attr-start="{{(page-1)*limit+1}}">
<li ng-repeat="simArticle in article.similarArticles" class="ellipsize"> <li ng-repeat="simArticle in article.similarArticles" class="ellipsis">
<small class="text-muted percent-align" ng-bind-template="({{((1-simArticle.divergence)*100).toFixed(0)}}%)"></small> <small class="text-muted percent-align" ng-bind-template="({{((1-simArticle.divergence)*100).toFixed(0)}}%)"></small>
<a ui-sref="articles.show({id: simArticle.article.id})" ng-attr-title="{{::simArticle.article.title}}" ng-bind="::simArticle.article.title"></a> <a ui-sref="articles.show({id: simArticle.article.id})" ng-attr-title="{{::simArticle.article.title}}" ng-bind="::simArticle.article.title"></a>
</li> </li>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
<ul class="list-unstyled topic-choice"> <ul class="list-unstyled topic-choice">
<li ng-repeat="topic in topics | orderBy:opts.sorttopics | filter:search"> <li ng-repeat="topic in topics | orderBy:opts.sorttopics | filter:search">
<div class="checkbox checkbox-condensed" ng-attr-title="{{::topic.name}}" ng-class="{selected:opts.selectedTopics[topic.id]}"> <div class="checkbox checkbox-condensed" ng-class="{selected:opts.selectedTopics[topic.id]}" bs-popover popover-title="{{::topic.name}}" popover-html="{{::topicPopover(topic)}}">
<input type="checkbox" ng-model="opts.selectedTopics[topic.id]" ng-attr-id="{{::topic.id}}"> <input type="checkbox" ng-model="opts.selectedTopics[topic.id]" ng-attr-id="{{::topic.id}}">
<label class="check" ng-attr-for="{{::topic.id}}"> <label class="check" ng-attr-for="{{::topic.id}}">
<span class="ellipsis" ng-bind="::topic.name"></span> <span class="ellipsis" ng-bind="::topic.name"></span>
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
</ul> </ul>
</div> </div>
<div class="center message-container"> <div class="center message-container">
<div class="wrapper">
<div class="topbar"> <div class="topbar">
<small>Values:</small> <small>Values:</small>
<div class="btn-group"> <div class="btn-group">
...@@ -54,3 +55,4 @@ ...@@ -54,3 +55,4 @@
<div class="message text-muted" ng-show="!topicsSelected">No topic selected</div> <div class="message text-muted" ng-show="!topicsSelected">No topic selected</div>
</div> </div>
</div> </div>
</div>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="col-md-8 text-center"> <div class="col-md-8 text-center">
<h4>Latest articles</h4> <h4>Latest articles</h4>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="ellipsize" ng-repeat="article in latestArticles"> <li class="ellipsis" ng-repeat="article in latestArticles">
<a ui-sref="articles.show({id:article.id})" ng-bind="article.title"></a> <a ui-sref="articles.show({id:article.id})" ng-bind="article.title"></a>
</li> </li>
</ul> </ul>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="col-md-4 text-center"> <div class="col-md-4 text-center">
<h4>Latest topics</h4> <h4>Latest topics</h4>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="ellipsize" ng-repeat="topic in latestTopics"> <li class="ellipsis" ng-repeat="topic in latestTopics">
<a ui-sref="topics.show({id:topic.id})" ng-bind="topic.name"></a> <a ui-sref="topics.show({id:topic.id})" ng-bind="topic.name"></a>
</li> </li>
</ul> </ul>
......
<div class="container" ng-cloak ng-hide="$state.current.name !== 'topics.show.articles'"> <div class="container" ng-cloak ng-hide="$state.current.name !== 'topics.show.articles'">
<div class="row">
<div class="col-md-12">
<div class="page-header"> <div class="page-header">
<h1 ng-bind-template="Articles for topic '{{::topic.name}}'"></h1> <h1 ng-bind-template="Articles for topic '{{::topic.name}}'"></h1>
<table class="item-actions"> <table class="item-actions">
...@@ -9,6 +11,10 @@ ...@@ -9,6 +11,10 @@
</tr> </tr>
</table> </table>
</div> </div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="text-muted"> <div class="text-muted">
Found Found
<ng-pluralize count="articlesTotal||0" when="{0:'no articles',1:'1 article',other:'{} articles'}"></ng-pluralize> in the database. <ng-pluralize count="articlesTotal||0" when="{0:'no articles',1:'1 article',other:'{} articles'}"></ng-pluralize> in the database.
...@@ -27,12 +33,30 @@ ...@@ -27,12 +33,30 @@
</span> </span>
<br> Page <span ng-bind="page||1"></span> of <span ng-bind="maxPage||1"></span>. <br> Page <span ng-bind="page||1"></span> of <span ng-bind="maxPage||1"></span>.
</div> </div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<pagination total="articlesTotal" page="page" limit="limit" change="changePage" /> <pagination total="articlesTotal" page="page" limit="limit" change="changePage" />
<ol ng-attr-start="{{(page-1)*limit+1}}"> </div>
<li ng-repeat="article in articles"> </div>
<div class="row">
<div class="col-md-12">
<table class="table table-hover table-condensed">
<tbody>
<tr ng-repeat="article in articles">
<td>
<a ui-sref="articles.show({id: article.id})" ng-bind="::article.title"></a> <a ui-sref="articles.show({id: article.id})" ng-bind="::article.title"></a>
</li> </td>
</ol> </tr>
<pagination total="articlesTotal" page="page" limit="limit" /> </tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<pagination total="articlesTotal" page="page" limit="limit" change="changePage" />
</div>
</div>
</div> </div>
<div ng-cloak ui-view></div> <div ng-cloak ui-view></div>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<pagination total="topicsTotal" page="page" limit="limit" change="changePage" /> <pagination total="topicsTotal" page="page" limit="limit" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
......
...@@ -49,14 +49,6 @@ ...@@ -49,14 +49,6 @@
<th>ID</th> <th>ID</th>
<td ng-bind="::topic.id"></td> <td ng-bind="::topic.id"></td>
</tr> </tr>
<tr>
<th>Created</th>
<td ng-bind="::topicCreated"></td>
</tr>
<tr>
<th>Last modified</th>
<td ng-bind="::topicModified"></td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Vipra Application * Vipra Application
* Controllers * Controllers
******************************************************************************/ ******************************************************************************/
/* globals angular, Vipra, moment, vis, console, $, prompt, randomColor */ /* globals angular, Vipra, moment, vis, console, $, prompt, randomColor, Highcharts */
(function() { (function() {
"use strict"; "use strict";
...@@ -353,22 +353,33 @@ ...@@ -353,22 +353,33 @@
series.push({ series.push({
name: topic.name, name: topic.name,
data: relevances, data: relevances,
color: topic.color color: topic.color,
topic: topic
}); });
} }
} }
// highcharts configuration // highcharts configuration
$scope.topicSeq = areaRelevanceChart(series, $scope.selectSequence, $scope.opts.chartstyle, $scope.opts.chartstack); $scope.topicSeq = areaRelevanceChart(series, $scope.selectNode, $scope.opts.chartstyle,
$scope.opts.chartstack);
$scope.topicsSelected = series.length; $scope.topicsSelected = series.length;
}; };
$scope.selectSequence = function(node) { $scope.selectNode = function(node) {
$scope.$apply(function() { $scope.$apply(function() {
}); });
}; };
$scope.topicPopover = function(topic) {
return "<table class=\"table table-bordered table-condensed table-nomargin\"><tbody><tr><td>&#956;</td><td>&#963;</td><td>&#8600;</td><td>&#8599;</td><td>&#8605;</td></tr><tr><td>" +
topic.avgRelevance.toFixed(2) + "</td><td>" +
topic.varRelevance.toFixed(2) + "</td><td>" +
topic.fallingRelevance.toFixed(2) + "</td><td>" +
topic.risingRelevance.toFixed(2) + "</td><td>" +
topic.risingDecayRelevance.toFixed(2) + "</td></tr></tbody></table>";
};
$scope.$watchCollection('opts.selectedTopics', $scope.redrawGraph); $scope.$watchCollection('opts.selectedTopics', $scope.redrawGraph);
$scope.$watchGroup(['opts.seqstyle', 'opts.chartstyle', 'opts.chartstack'], $scope.redrawGraph); $scope.$watchGroup(['opts.seqstyle', 'opts.chartstyle', 'opts.chartstack'], $scope.redrawGraph);
} }
...@@ -583,7 +594,7 @@ ...@@ -583,7 +594,7 @@
function($scope, $stateParams, $location, TopicFactory) { function($scope, $stateParams, $location, TopicFactory) {
$scope.opts = { $scope.opts = {
sort: 'name', sort: 'title',
order: '+' order: '+'
}; };
...@@ -667,18 +678,30 @@ ...@@ -667,18 +678,30 @@
spacingLeft: 0, spacingLeft: 0,
spacingRight: 0 spacingRight: 0
}, },
title: { text: '' }, title: {
text: ''
},
xAxis: { xAxis: {
type: 'datetime', type: 'datetime',
title: { text: '' } title: {
text: ''
}
},
yAxis: {
title: {
text: 'Relevance'
}
}, },
yAxis: { title: { text: 'Relevance' } },
tooltip: { tooltip: {
headerFormat: '', headerFormat: '',
pointFormat: '{point.x:%Y}: {point.y:.4f}' pointFormat: '{point.x:%Y}: {point.y:.4f}'
}, },
legend: { enabled: false }, legend: {
credits: { enabled: false }, enabled: false
},
credits: {
enabled: false
},
plotOptions: { plotOptions: {
areaspline: { areaspline: {
fillOpacity: 0.5, fillOpacity: 0.5,
...@@ -694,6 +717,18 @@ ...@@ -694,6 +717,18 @@
clickCallback(e.point); clickCallback(e.point);
} }
} }
},
states: {
hover: {
halo: {
size: 9,
attributes: {
fill: Highcharts.getOptions().colors[2],
'stroke-width': 2,
stroke: Highcharts.getOptions().colors[1]
}
}
}
} }
} }
}, },
...@@ -710,16 +745,24 @@ ...@@ -710,16 +745,24 @@
spacingLeft: 20, spacingLeft: 20,
spacingRight: 20, spacingRight: 20,
}, },
credits: { enabled: false }, credits: {
enabled: false
},
plotOptions: { plotOptions: {
pie: { pie: {
size: '100%', size: '100%',
dataLabels: { enabled: false }, dataLabels: {
enabled: false
},
allowPointSelect: true allowPointSelect: true
} }
}, },
title: { text: '' }, title: {
tooltip: { pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' }, text: ''
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
series: series series: series
}; };
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Vipra Application * Vipra Application
* Directives * Directives
******************************************************************************/ ******************************************************************************/
/* globals angular, console */ /* globals angular, console, $ */
(function() { (function() {
"use strict"; "use strict";
...@@ -120,4 +120,23 @@ ...@@ -120,4 +120,23 @@
}; };
}); });
app.directive('bsPopover', function () {
return {
restrict: 'A',
link: function ($scope, $elem, $attrs) {
$scope.label = $attrs.popoverLabel;
$($elem).popover({
animation: ($attrs.popoverAnimation === 'true') || true,
container: $attrs.popoverContainer || 'body',
content: $attrs.popoverHtml,
delay: parseInt($attrs.popoverDelay || 1000, 10),
html: $attrs.popoverHtml || true,
placement: $attrs.popoverPlacement || 'right',
title: $attrs.popoverTitle,
trigger: $attrs.popoverTrigger || 'hover'
});
}
};
});
})(); })();
...@@ -42,15 +42,6 @@ ...@@ -42,15 +42,6 @@
* Polyfills * Polyfills
*/ */
if (typeof String.prototype.ellipsize === 'undefined')
String.prototype.ellipsize = function(max) {
max = max || 20;
if (this.length > max) {
return this.substring(0, max) + '...';
}
return this;
};
if (typeof String.prototype.multiline === 'undefined') if (typeof String.prototype.multiline === 'undefined')
String.prototype.multiline = function(max) { String.prototype.multiline = function(max) {
return this.split(new RegExp("((?:\\w+ ){" + max + "})", "g")).filter(Boolean).join("\n"); return this.split(new RegExp("((?:\\w+ ){" + max + "})", "g")).filter(Boolean).join("\n");
......
...@@ -13,16 +13,6 @@ a:hover { ...@@ -13,16 +13,6 @@ a:hover {
cursor:pointer; cursor:pointer;
} }
ul.dashed {
list-style: none;
padding: 0;
li:before {
content: "–";
padding-right: 5px;
}
}
.heading { .heading {
height: 125px; height: 125px;
margin: 25px 0; margin: 25px 0;
...@@ -42,12 +32,6 @@ ul.dashed { ...@@ -42,12 +32,6 @@ ul.dashed {
} }
} }
.ellipsize {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.navbar-default { .navbar-default {
.collapse:not(.in) { .collapse:not(.in) {
.navbar-nav > .active { .navbar-nav > .active {
...@@ -75,27 +59,6 @@ ul.dashed { ...@@ -75,27 +59,6 @@ ul.dashed {
margin-bottom: 15px; margin-bottom: 15px;
} }
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 50px;
border-top-width: 1px;
border-top-style: solid;
}
.loading:before {
.overlay;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.1);
content: " ";
}
.graph { .graph {
position: absolute; position: absolute;
top: 50px; top: 50px;
...@@ -181,16 +144,6 @@ ul.dashed { ...@@ -181,16 +144,6 @@ ul.dashed {
} }
} }
.caret.caret-up {
content: "";
border-top: 0;
border-bottom: 4px dashed;
}
.table.table-morecondensed > tbody > tr > td {
padding: 0;
}
.table-fixed { .table-fixed {
table-layout: fixed; table-layout: fixed;
} }
...@@ -216,24 +169,10 @@ ul.dashed { ...@@ -216,24 +169,10 @@ ul.dashed {
} }
} }
.btn-condensed {
padding: 0px 12px;
margin-top: -2px;
}
.topic-share { .topic-share {
width: 75px; width: 75px;
} }
revolve-select, [revolve-select] {
.noselect;
cursor: pointer;
}
#nprogress .spinner {
display: none;
}
.logo { .logo {
&.hover { &.hover {
.logo-shape { .logo-shape {
...@@ -257,14 +196,6 @@ revolve-select, [revolve-select] { ...@@ -257,14 +196,6 @@ revolve-select, [revolve-select] {
outline: none; outline: none;
} }
.fullheight {
height: 100%;
.row > * {
height: 100%;
}
}
.checkbox-condensed { .checkbox-condensed {
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
...@@ -330,6 +261,9 @@ revolve-select, [revolve-select] { ...@@ -330,6 +261,9 @@ revolve-select, [revolve-select] {
.topic-choice { .topic-choice {
position: absolute; position: absolute;
top: 110px;
bottom: 0;
overflow-y: auto;
label { label {
padding-right: 15px; padding-right: 15px;
...@@ -358,22 +292,6 @@ input[type=checkbox], ...@@ -358,22 +292,6 @@ input[type=checkbox],
vertical-align: bottom; vertical-align: bottom;
} }
.btn-groups {
.btn-group:not(:first-child) {
.btn {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
.btn-group:not(:last-child) {
.btn {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
}
.message-container { .message-container {
position: relative; position: relative;
} }
...@@ -401,15 +319,6 @@ input[type=checkbox], ...@@ -401,15 +319,6 @@ input[type=checkbox],
width: 100% !important; width: 100% !important;
} }
.btn-default-none {
&, &:focus, &:hover, &:active {
.noselect;
background: transparent;
cursor: default;
box-shadow: none;
}
}
.table-infos { .table-infos {
th { th {
white-space: nowrap; white-space: nowrap;
...@@ -423,6 +332,12 @@ input[type=checkbox], ...@@ -423,6 +332,12 @@ input[type=checkbox],
vertical-align: text-top; vertical-align: text-top;
} }
.wrapper {
position: relative;
width: 100%;
height: 100%;
}
@-moz-keyframes spin { 100% { -moz-transform: rotateY(360deg); } } @-moz-keyframes spin { 100% { -moz-transform: rotateY(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotateY(360deg); } } @-webkit-keyframes spin { 100% { -webkit-transform: rotateY(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotateY(360deg); transform:rotateY(360deg); } } @keyframes spin { 100% { -webkit-transform: rotateY(360deg); transform:rotateY(360deg); } }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment