From e322b11ae78e2b6e13861f9779edda19e8793c9d Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 5 Dec 2014 15:22:24 +0100 Subject: [PATCH] v0.8 --- css/custom.css | 18 +++++++++++------- index.html | 24 ++++++++++++------------ js/app.js | 26 +++++++++++++++++--------- manifest.json | 1 - partials/dashboard.html | 32 +++++++++++++++++--------------- partials/settings.html | 41 +++++++++++++++++++++++++---------------- 6 files changed, 82 insertions(+), 60 deletions(-) diff --git a/css/custom.css b/css/custom.css index 0d752a1..4183fdf 100644 --- a/css/custom.css +++ b/css/custom.css @@ -10,31 +10,35 @@ body { #header-bar { background-color:#3C5D70; padding:3px 15px; - height:35px + height:35px; + box-shadow: 1px 2px 2px; + position:relative; + z-index:1; } #header-bar>form { float:left; margin:0; } #header-bar>form>input { - padding:3px; + padding:5px; } .col-xs-2 { padding:0; } -.panel { +.panel-narrow { margin:0; border:0; border-radius:0; } -.panel-heading { - padding:1px 5px; +.panel-default>.panel-heading { + height: 20px; + background-color: #e8e8e8; + padding:3px 5px; font-weight:bold; border:none; border-radius:0; } -.panel-body { - height: 45%; +.panel-narrow-body { overflow-y:auto; padding:0; } diff --git a/index.html b/index.html index 3bfb5be..d0526e7 100644 --- a/index.html +++ b/index.html @@ -7,18 +7,18 @@ -
-
- -
- Settings -
-
+
+
+ +
+ Settings +
+
-
- - - - +
+ + + + diff --git a/js/app.js b/js/app.js index 208a952..92025f5 100644 --- a/js/app.js +++ b/js/app.js @@ -1,9 +1,7 @@ 'use strict'; -//var privateKey = "-FynrgFmtek897_Z93-mME6OwS41XnWHOpKs8zXY8sQ="; var titleLimit = 34; var deliciousURL = "http://feeds.delicious.com/v2/json/" -//var deliciousURL = "https://api.del.icio.us/v2/json/" var app = angular.module('deliciousDashboardApp', ['ngRoute','ngStorage']) .config(function ($routeProvider) { @@ -14,18 +12,28 @@ var app = angular.module('deliciousDashboardApp', ['ngRoute','ngStorage']) }); app.controller('mainCtrl', function($scope, $localStorage, $location) { - $scope.$storage = $localStorage; - if($scope.$storage.favoritetags) { $scope.mytags = $scope.$storage.favoritetags.split(','); } else { $scope.mytags = ['latest']; } + $scope.$storage = $localStorage.$default({ favoritetags: 'latest' }); if (!$scope.$storage.username) { $location.path('/settings'); } +}); + +app.controller('dashboardCtrl', function($scope, $window) { + $scope.mytags = $scope.$storage.favoritetags.split(','); + if($scope.mytags.length > 6) { + $scope.columnheight = ($window.innerHeight - 35) / 2 - 20; + } else { + $scope.columnheight = $window.innerHeight - 55; + }; $scope.titleLimit = titleLimit; - angular.forEach(document.querySelectorAll('.main-search'), function(elem) { elem.focus(); }); }); -app.controller('getLinksCtrl', function($scope,$http) { - if (!$scope.tag) throw new Error("No Tag for LinksController"); - if ($scope.tag == 'latest') { $scope.tag = '' } else { $scope.tag = '/' + $scope.tag }; +app.controller('getLinksCtrl', function($scope, $http) { + if (!$scope.thistag) throw new Error("No Tag for LinksController"); + if ($scope.thistag == 'latest') { $scope.thistag = '' } else { $scope.thistag = '/' + $scope.thistag }; if ($scope.$storage.privatekey) { var privateKey = ';private=' + $scope.$storage.privatekey; } - $http.get(deliciousURL + $scope.$storage.username + $scope.tag + '?count=100' + privateKey).then(function(articlesResponse) { + $http.get(deliciousURL + $scope.$storage.username + $scope.thistag + '?count=100' + privateKey).then(function(articlesResponse) { $scope.links = articlesResponse.data; }) }); + +app.controller('settingsCtrl', function($scope, $http) { +}); diff --git a/manifest.json b/manifest.json index 9bb9365..47641b5 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,6 @@ "manifest_version": 2, // "default_locale": "en", "description": "Displays the links of your favorite tags on the new tab page. Easily searchable + customizeable.", -// "content_security_policy": "script-src 'self' https://ajax.googleapis.com; object-src 'self'", "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", "icons": { "16": "img/deli-16.png", diff --git a/partials/dashboard.html b/partials/dashboard.html index 22d75d5..79cb9a3 100644 --- a/partials/dashboard.html +++ b/partials/dashboard.html @@ -1,16 +1,18 @@ -
-
-
-
{{tag}}
-
- - - - -
- {{link.d}} -
-
-
-
+
+
+
+
+
{{thistag}}
+
+ + + + +
+ {{link.d}} +
+
+
+
+
diff --git a/partials/settings.html b/partials/settings.html index e20a2f2..7b00166 100644 --- a/partials/settings.html +++ b/partials/settings.html @@ -1,23 +1,32 @@ +

Settings

-
- Username - -
-
-
- Private Key - -
-
-
- Favorite Tags - -
- +
+ Username + +
+
+
+ Private API Key + +
+
+
+ Favorite Tags + +

- Back +

+
+

Enter up to 12 favorite tags, separated by commas. 'latest' will give you your latest links.

+

Enter your Delicious API key to get your private links as well. For your API key, go to http://feeds.delicious.com/[your username] and click on "RSS: Private" on the right side. This link includes your API key.

+
+
+

+

+ Back

+