|
@@ -66,6 +66,14 @@ app.controller('main', function($scope,$http,$sce) {
|
|
|
q=q.toLowerCase();
|
|
q=q.toLowerCase();
|
|
|
return $scope.keywords.filter(function(e) { return e.toLowerCase().indexOf(q) > -1});
|
|
return $scope.keywords.filter(function(e) { return e.toLowerCase().indexOf(q) > -1});
|
|
|
};
|
|
};
|
|
|
|
|
+ $scope.addKeyword = function(k) {
|
|
|
|
|
+
|
|
|
|
|
+ c=$scope.selected_kw.filter(function(el) { return el.text==k; }).length;
|
|
|
|
|
+ if (c>0)
|
|
|
|
|
+ return;
|
|
|
|
|
+ $scope.selected_kw.push({text:k});
|
|
|
|
|
+ $scope.filter();
|
|
|
|
|
+ };
|
|
|
$scope.getKeywords = function() {
|
|
$scope.getKeywords = function() {
|
|
|
$http.get("/pymnts/keywords").then(
|
|
$http.get("/pymnts/keywords").then(
|
|
|
function(data) {
|
|
function(data) {
|
|
@@ -87,6 +95,17 @@ app.controller('main', function($scope,$http,$sce) {
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
+ $scope.reset = function() {
|
|
|
|
|
+ $scope.mindate=undefined;
|
|
|
|
|
+ $scope.maxdate=undefined;
|
|
|
|
|
+ $scope.site=undefined;
|
|
|
|
|
+ $scope.kw=[];
|
|
|
|
|
+ $scope.minweight="1";
|
|
|
|
|
+ $scope.title=undefined;
|
|
|
|
|
+ $scope.category="-1";
|
|
|
|
|
+ $scope.filter();
|
|
|
|
|
+
|
|
|
|
|
+ };
|
|
|
$scope.filter = function(page) {
|
|
$scope.filter = function(page) {
|
|
|
var kw = $scope.selected_kw.map(function(e){return e.text});
|
|
var kw = $scope.selected_kw.map(function(e){return e.text});
|
|
|
$http.post("/pymnts/articles/",{"mindate":$scope.mindate,
|
|
$http.post("/pymnts/articles/",{"mindate":$scope.mindate,
|