Skip to content
Permalink
Browse files

Add refresh button for collections.

Add frontend proxy.
  • Loading branch information
n1try committed Jan 15, 2020
1 parent b9ed91e commit bb1e851c4d51a2438e087a04fc26f0f48949a377
Showing with 57 additions and 15 deletions.
  1. +5 −1 README.md
  2. +32 −0 package-lock.json
  3. +2 −1 package.json
  4. +13 −4 public/Gruntfile.js
  5. +1 −8 public/app/scripts/controllers/collection.js
  6. +4 −1 public/app/views/collection.html
@@ -6,6 +6,8 @@ Anchr is a useful little helper or toolbox or the like for common tasks on the i

ℹ️ The official hosted version, formerly available at [anchr.io](https://anchr.io), has been **discontinued**. To use Anchr, you will need you own, self-hosted instance from now on.

🛡 This software is not actively maintained anymore. Several dependencies are outdated and potentially vulnerable. We recommend to not expose your Anchr instance to the public internet.

![](https://anchr.io/i/9w5si.png)

## 🗒 What does it do?
@@ -47,7 +49,9 @@ In order to host Anchr on your own, you need a few things.

#### Option 1: Run Natively
##### For development
1. `$ npm start` (from root folder)
1. Run backend `$ npm start` (from root folder)
2. Run frontend `$ grunt serve` (from `public` folder)
3. Go to http://localhost:9000 and enjoy live reload

##### In production
1. `$ npm run build` (to build frontend)

Some generated files are not rendered by default. Learn more.

@@ -37,9 +37,10 @@
"devDependencies": {
"autoprefixer-core": "^5.2.1",
"grunt": "^0.4.5",
"grunt-cli": "^1.2.0",
"grunt-angular-templates": "^0.5.7",
"grunt-cli": "^1.2.0",
"grunt-concurrent": "^1.0.0",
"grunt-connect-proxy": "^0.2.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-connect": "^0.9.0",
@@ -16,7 +16,8 @@ module.exports = function (grunt) {
require('jit-grunt')(grunt, {
useminPrepare: 'grunt-usemin',
ngtemplates: 'grunt-angular-templates',
cdnify: 'grunt-google-cdn'
cdnify: 'grunt-google-cdn',
configureProxies: 'grunt-connect-proxy'
});

// Configurable paths for the application
@@ -80,6 +81,7 @@ module.exports = function (grunt) {
open: true,
middleware: function (connect) {
return [
require('grunt-connect-proxy/lib/utils').proxyRequest,
connect.static('.tmp'),
connect().use(
'/bower_components',
@@ -90,7 +92,7 @@ module.exports = function (grunt) {
connect.static('./app/styles')
),
connect.static(appConfig.app)
];
]
}
}
},
@@ -115,9 +117,15 @@ module.exports = function (grunt) {
open: true,
base: '<%= yeoman.dist %>'
}
}
},
proxies: [{
context: '/api',
host: 'localhost',
port: 3000,
https: false,
xforward: false,
}]
},

// Empties folders to start fresh
clean: {
dist: {
@@ -347,6 +355,7 @@ module.exports = function (grunt) {
grunt.task.run([
'clean:server',
'wiredep',
'configureProxies:server',
'concurrent:server',
'postcss:server',
'connect:livereload',
@@ -8,7 +8,7 @@ angular.module('anchrClientApp')

/* Either id or index! */
$scope.setActiveCollection = function(id, cached) {
if ($scope.data.active === id) return;
if ($scope.data.active === id && cached) return;

function setActive() {
$scope.data.active = id;
@@ -171,13 +171,6 @@ angular.module('anchrClientApp')
return -1;
}

function findCollectionByName(colls, collName) {
for (var i = 0; i < colls.length; i++) {
if (colls[i].name == collName) return i;
}
return -1;
}

function getCollection(colls, collId) {
return colls[findCollection(colls, collId)];
}
@@ -103,7 +103,10 @@ <h4 class="text-primary">Add new link</h4>
<div class="row" ng-if="getCollection(data.active).links.length">
<div class="row">
<div class="col-md-8">
<h4 class="text-primary">My links</h4>
<h4 class="text-primary">
<span>My links</span>
<i class="glyphicon glyphicon-repeat" style="margin-left: 10px; font-size: 14px; cursor: pointer" ng-click="setActiveCollection(data.active, false)"></i>
</h4>
</div>
<div class="col-md-4">
<div class="form-group search-form">

0 comments on commit bb1e851

Please sign in to comment.
You can’t perform that action at this time.