-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex-ng.html
133 lines (101 loc) · 4.43 KB
/
index-ng.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html ng-app>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>leDashboard</title>
<link rel="shortcut icon" href="dist/img/favicon.ico">
<link rel="stylesheet" type="text/css" href="dist/style/css/flick/jquery-ui-1.10.3.custom.min.css">
<!-- CSS includes -->
<link rel="stylesheet" href="dist/style/screen.css">
<script src="lib/jquery/jquery-2.0.3.js"></script>
<script src="lib/angular/angular.js"></script>
<script src="lib/underscore/underscore-min.js"></script>
<script type="text/javascript">
var FeedController = function( $scope, $http ){
$http.get( 'read_feed_config.php' ).success(function( data ){
$scope.feeds = data;
for( feed in data ){
//console.log( data[ feed ] )
}
});
$scope.reload = function(){
console.log( "reload: " + this.feed.feedUrl );
};
$scope.load = function(){
$http.post( 'get_feed.php', {
"feed_id": this.feed.id,
"feed_url": this.feed.feedUrl
} ).success( function(data){
console.log( data );
});
};
};
var FeedItemsController = function( $scope, $http ){
// default vars
$scope.isOpen = false;
// load items per feed
$http.post( 'get_feed.php',
{
"feed_id": $scope.feed.id,
"feed_url": $scope.feed.feedUrl
},
{
/*
* HINT from http://stackoverflow.com/questions/11442632/how-can-i-make-angular-js-post-data-as-form-data-instead-of-a-request-payload
*/
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
transformRequest: function(obj) {
var str = [];
for(var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
}
).success( function(data){
$( '#' + $scope.feed.id + ' .loading' ).removeClass( 'loading' );
$scope.feeditems = data.data;
});
// controller functions
$scope.toggle = function(){
$scope.isOpen = $scope.isOpen ? false : true;
};
$scope.display = function(){
//console.log( this.item.isOpen );
return $scope.isOpen ? " open " : " close ";
};
};
</script>
</head>
<body>
<header>
<h1><img src="dist/img/dashboard.png"> leDashboard</h1>
<div class="menu">
<button class="reload_all ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" role="button" aria-disabled="false"><span class="ui-button-icon-primary ui-icon ui-icon-refresh"></span><span class="ui-button-text">reload all</span></button>
<button class="add_feed ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" role="button" aria-disabled="false"><span class="ui-button-icon-primary ui-icon ui-icon-plusthick"></span><span class="ui-button-text">Add Feed</span></button>
<button class="settings ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" role="button" aria-disabled="false"><span class="ui-button-icon-primary ui-icon ui-icon-wrench"></span><span class="ui-button-text">Settings</span></button>
<button class="logout ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary" role="button" aria-disabled="false"><span class="ui-button-icon-primary ui-icon ui-icon-power"></span><span class="ui-button-text">Logout The mighty Administrator</span></button>
</div>
</header>
<section id="feeds" ng-controller="FeedController">
<div class="feed" id="{{feed.id}}" ng-repeat="feed in feeds">
<span class="buttons">
<button ng-click="reload()">reload</button>
</span>
<h2><a href="{{feed.url}}" target="_blank">{{feed.title}}</a></h2>
<div class="loading">
<ul ng-controller="FeedItemsController">
<li ng-repeat="item in feeditems" ng-class="display">
<i ng-click="toggle();"></i>
<a href="{{item.permalink}}">{{item.title}}</a>
<p>{{item.description}}</p>
</li>
</ul>
</div>
</div>
</section>
<footer>
<p>2012, <a href="http://campino2k.de/">Christian Jung</a> | Fork me on <a href="http://github.com/campino2k/leDashboard">Github</a> | Dashboard Icon <a href="http://creativecommons.org/licenses/by/3.0/">CC-BY</a> from <a href="http://www.doublejdesign.co.uk/products-page/icons/super-mono-icons/">Double-J Design's "Super Mono" Iconset</a></p>
</footer>
</body>
</html>