diff --git a/vipra-ui/app/html/index.html b/vipra-ui/app/html/index.html index 7fb2f6a650f8505075b622fddc90a3816c046f6f..2a0d0b320f5968179bac173040407c47439c0998 100644 --- a/vipra-ui/app/html/index.html +++ b/vipra-ui/app/html/index.html @@ -36,6 +36,14 @@ <div class="row row-spaced"> <div class="col-md-12"> <input type="text" class="form-control input-lg" placeholder="Search..." ng-model="search" ng-model-options="{debounce:500}"> + <p class="text-right"> + <small> + <a toggle-link target="#advanced">Advanced...</a> + </small> + </p> + <div id="advanced" style="display:none"> + + </div> </div> </div> diff --git a/vipra-ui/app/html/network.html b/vipra-ui/app/html/network.html index 316ed30991ebb8d53ba2637dd744dc7f2e141ea3..9ab1c68438d8bb103b6d2d9a07dd1f8b745eafc0 100644 --- a/vipra-ui/app/html/network.html +++ b/vipra-ui/app/html/network.html @@ -1,4 +1,4 @@ -<div class="fullsize navpadding" vis-graph vis-type="type" ng-model="model"> +<div class="fullsize navpadding" vis-network vis-type="type" ng-model="model"> <div class="graph-legend"> <span style="color:#BBC9D2">Articles</span><br> <span style="color:#DBB234">Topics</span><br> diff --git a/vipra-ui/app/js/controllers.js b/vipra-ui/app/js/controllers.js index a12294d9e9bed738a43e859eea7c71d35e533852..80a436c1bea713b74b853a50be1cfb36d0501cc0 100644 --- a/vipra-ui/app/js/controllers.js +++ b/vipra-ui/app/js/controllers.js @@ -78,7 +78,7 @@ $scope.page = Math.max($stateParams.page || 1, 1); $scope.limit = pageSize; - $scope.sort = Store('sortarticles-' + $state.current.name) || 'date'; + $scope.sort = Store('sortarticles') || 'date'; $scope.reload = function() { ArticleFactory.query({ @@ -148,12 +148,12 @@ * Topic Controllers */ - app.controller('TopicsIndexController', ['$scope', '$stateParams', 'TopicFactory', - function($scope, $stateParams, TopicFactory) { + app.controller('TopicsIndexController', ['$scope', '$stateParams', 'Store', 'TopicFactory', + function($scope, $stateParams, Store, TopicFactory) { $scope.page = Math.max($stateParams.page || 1, 1); $scope.limit = pageSize; - $scope.sort = Store('sorttopics-' + $state.current.name) || 'name'; + $scope.sort = Store('sorttopics') || 'name'; $scope.reload = function() { TopicFactory.query({ @@ -192,12 +192,12 @@ * Word Controllers */ - app.controller('WordsIndexController', ['$scope', '$state', '$stateParams', 'WordFactory', - function($scope, $state, $stateParams, WordFactory) { + app.controller('WordsIndexController', ['$scope', '$state', '$stateParams', 'Store', 'WordFactory', + function($scope, $state, $stateParams, Store, WordFactory) { $scope.page = Math.max($stateParams.page || 1, 1); $scope.limit = 300; - $scope.sort = Store('sortwords-' + $state.current.name) || 'word'; + $scope.sort = Store('sortwords') || 'word'; $scope.reload = function() { WordFactory.query({ diff --git a/vipra-ui/app/js/directives.js b/vipra-ui/app/js/directives.js index 4335de7bdf1eac433ef4d37ae9a37f1d5316c8f7..d4cee45493d788dfcbecdcc7747eb5dac9d00848 100644 --- a/vipra-ui/app/js/directives.js +++ b/vipra-ui/app/js/directives.js @@ -93,6 +93,11 @@ shape: 'dot', borderWidth: 0 }, + edges: { + color: { + highlight: '#f00' + } + }, layout: { randomSeed: 1 }, physics: { barnesHut: { @@ -249,7 +254,7 @@ var target = $($scope.target); if(!target.length) return; var store = $scope.store !== 'false'; - var name = 'hidelink-' + $state.current.name + '-' + $scope.target; + var name = 'hidelink-' + $scope.target; if(store) { var visible = Store(name); if(visible !== null && typeof visible !== 'undefined') @@ -274,4 +279,17 @@ }; }]); + app.directive('toggleLink', function() { + return { + link: function($scope, $elem, $attrs) { + var target = $($attrs.target); + if(target) { + $elem.click(function() { + target.slideToggle(); + }); + } + } + } + }); + })(); \ No newline at end of file diff --git a/vipra-ui/app/js/factories.js b/vipra-ui/app/js/factories.js index c8a744b9237ab1ea2515ad9610e02fd3091a579f..aa0599cc95ecf773e30b01fceb4ab9e9903bde93 100644 --- a/vipra-ui/app/js/factories.js +++ b/vipra-ui/app/js/factories.js @@ -32,9 +32,10 @@ }); }]); - app.factory('Store', function() { + app.factory('Store', ['$state', function($state) { // https://gist.github.com/Fluidbyte/4718380 return function(key, value) { + key += '-' + $state.current.name; var lsSupport = false; // Check for native support @@ -97,6 +98,6 @@ return null; } }; - }); + }]); })(); \ No newline at end of file