forked from Erkan-Yilmaz/ToS-DR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtopics.html
More file actions
260 lines (242 loc) · 11.2 KB
/
Copy pathtopics.html
File metadata and controls
260 lines (242 loc) · 11.2 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Topics - Terms of Service; Didn't Read</title>
<meta name="description" content="Nobody wants to read the long Terms of Service many websites have. But it is important to understand what they say – these ratings make it easier.">
<meta name="author" content="Unhosted">
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<link rel="shortcut icon" href="img/tosdr-icon-16.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/tosdr-icon-144.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/tosdr-icon-114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/tosdr-icon-72.png">
<link rel="apple-touch-icon-precomposed" href="img/tosdr-icon-57.png">
<script src="js/jquery-1.7.1.min.js"></script>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> <!--http://j.mp/mobileviewport-->
<script>
globalTopicsDictionary = {} ;
function nameFromId(id){
return globalTopicsDictionary[id] || id || "" ;
}
function renderDataPoint(topic, dataPoint) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'points/'+dataPoint+'.json', true);
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
if(xhr.status == 200) {
var obj, badge, icon, sign, service, score, tldr, discussion, terms, privacy, source;
try {
obj = JSON.parse(xhr.responseText);
} catch(e) {
alert('Could not load data for data point '+dataPoint+', sorry! Refreshing the page might sometimes help.');
return;
}
if(obj.tosdr.point == 'good') {
badge = 'badge-success';
} else if(obj.tosdr.point == 'mediocre') {
badge = 'badge-warning';
} else if(obj.tosdr.point == 'alert') {
badge = 'badge-important';
obj.tosdr.score += 100;
} else if(obj.tosdr.point == 'not bad') {
badge = 'badge-neutral';
} else {
badge = '';
}
document.getElementById('point-'+topic+'-'+dataPoint).innerHTML = '<span class="badge '+badge+'">'
+obj.tosdr.score+'</span> '
+'<a class="tldr" data-toggle="collapse" data-target="#collapse-point-'+topic+'-'+dataPoint+'" href="#'+topic+'-'+dataPoint+'">'
+'<img height="24" alt="" title="'+obj.service+'" class="favlogo" src="logo/'+ (obj.service + "").split(",")[0] +'.png">'+obj.name+' <i class="icon icon-chevron-down icon-collapser"></i></a>'
+'<p class="collapse tldr" id="collapse-point-'+topic+'-'+dataPoint+'">'+obj.tosdr.tldr+' <a href="'+obj.discussion+'" target="_blank" class="label context">Discussion</a></p></li>';
}
}
};
xhr.send();
}
var topicObjects = {};
function getTopicObject(name, cb) {
if(topicObjects[name]) {
cb(topicObjects[name]);
} else {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'topics/'+name+'.json', true);
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
if(xhr.status == 200) {
var obj;
try {
obj = JSON.parse(xhr.responseText);
topicObjects[name]=obj;
} catch(e) {
console.log(xhr.responseText);
console.log(JSON.parse(xhr.responseText));
alert('Could not load data for '+name+', sorry! Refreshing the page might sometimes help.');
}
if(obj) {
cb(obj);
}
}
}
};
xhr.send();
}
}
function renderDetails(name, points) {
console.log('renderDetails '+name);
console.log(points);
getTopicObject(name, function(obj) {
if (obj.id && obj.id) globalTopicsDictionary[obj.id] = obj.name ;
document.getElementById('jump-to').innerHTML += '<div class="span3' + ((obj.type === "category")?' categoryLink':'') + '"><a href="#'+name+'">'+obj.name+'</a></div> ';
var header = '<div class="page-header"><h2>'+obj.name+' <small>'+(obj.subtitle||"")+'</small></h2></div>';
var rating;
var ratingText = {
0: "We haven't sufficiently reviewed the terms yet. Please contribute to our group.",
"false": "We haven't sufficiently reviewed the terms yet. Please contribute to our group.",
"A": "The terms of topic pay specific care towards the user and the operator of the topic follows the best practices.",
"B": "The terms of topics are fair towards the user but they could be improved.",
"C": "The terms of topic are okay but some issues need your consideration.",
"D": "The terms of topic are very uneven or there are some important issues that need your attention.",
"E": "We strongly discourage you from signing up to this topic. The terms of topic raise serious concerns."
};
// [FIXME] We don't need ratings for topics. But it would be useful if instead of the class we could display the description.
if(!obj.tosdr) {
obj.tosdr = {rated: false};
}
if(obj.tosdr.rated) {
rating = '';
} else {
rating = '';
}
var description = '';
if(obj.description) {
description = '<div id="'+name+'-description" class="topic-description"><p class="description">'+obj.description;
}
var parent = '</p></div>';
if(obj.parent) {
parent = ' <small>(Category: <a href="#'+obj.parent+'" class="skipToCategory">'+obj.parent+'</a>)</small></p></div>';
}
var issues = '<section class="specificissues"><ul class="tosdr-points row">'
for(var i=0; i<points.length; i++) {
issues += '<li id="point-'+name+'-'+points[i]+'" class="span6 point"></li>';
}
issues += '</ul>';
document.getElementById(name).innerHTML=header+description+parent+issues+
'</section>';
for(var i=0; i<points.length; i++) {
renderDataPoint(name, points[i]);
}
$('.skipToCategory').each(function(){$(this).text(nameFromId($(this).text()))}) ;
});
}
function go() {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'index/topics.json', true);
xhr.onreadystatechange = function() {
if(xhr.readyState==4) {
if(xhr.status==200) {
try {
var topics = JSON.parse(xhr.responseText);
console.log(topics);
var last;
for(var i in topics) {
// document.getElementById('jump-to').innerHTML += '<a href="#'+i+'">'+i+'</a>; ';
}
if(last) {
// document.getElementById('jump-to').innerHTML += '<a href="#'+last+'">'+last+'</a>. ';
} else {
last = i;
}
for(var i in topics) {
if(last) {
document.getElementById('topics-list').innerHTML += '<section id="'+last+'" class="topic"></section>'
+'<section id="'+i+'" class="topic"></section>'
+'</section>';
renderDetails(last, topics[last]);
renderDetails(i, topics[i]);
last=undefined;
} else {
last = i;
}
document.getElementById('popups').innerHTML +=
'<div id="'+i+'-tosdr" class="modal hide tosdr-infos" role="dialog"> </div>';
}
if(last) {
document.getElementById('topics-list').innerHTML += '<section id="'+last+'" class="topic"></section>';
renderDetails(last, topics[i]);
}
} catch(e) {
}
}
}
};
xhr.send();
}
<!--fixme this shuold be automatic-->
</script>
</head>
<body onload="go();" id="topics-html" data-spy="scroll" >
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button"class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="index.html"><img src="img/tosdr-icon-16.png" alt="" style="vertical-align:baseline;margin-right:.5em;" class="logo" />Terms of Service; Didn't Read</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class=""><a href="index.html#services">Ratings by services</a></li>
<li class="active"><a href="#topics">Ratings by topics</a></li>
</ul>
</div>
<div id="remotestorage-connect"></div>
</div>
</div>
</div>
<div class="hero-unit">
<div class="container">
<div class="page-header"><h1>Topics</h1></div>
<p class="description">Compare the Terms of service by topic:</p>
<div id="jump-to" class="row"></div>
<h2>How to read this page</h2>
<p>
Terms of service are divided into small points. Each point gets assigned one or several topics.
That way, we can compare points that relate to the same topic and adjust the scores.
Some topics can also be related to each other, for instance
<a href="#copyright-scope">copyright</a> is a subset of <a href="#ownership">ownership</a>.
</p>
<p>
Each points gets a score (the white figure on the badge). The higher
the score, the more important the point is (and the more it influences the rating of the service).
</p>
<p>
Within each topic, you should be able to compare the scores and discuss them. However keep in mind that:
</p>
<ul>
<li>Scores from one topic are usually irrelevant to scores from another topic</li>
<li>The same clause can have different scores depending on the context of the services it applies to.</li>
</ul>
</div>
</div>
<div class="container" id="tosdr-content" role="main">
<section id="topics">
<div id="topics-list">
</div>
</section>
<!--here come the popups-->
<div id="popups"></div>
<!--"tos": {-->
<!--"terms": "https://flattr.com/terms",-->
<!--"privacy": "https://flattr.com/privacy"-->
<!--},-->
</div> <!-- /container -->
<script src="bootstrap/js/bootstrap-collapse.js"></script>
<!-- <script src="bootstrap/js/bootstrap-modal.js"></script>-->
<script src="bootstrap/js/bootstrap-transition.js"></script>
<!-- <script src="bootstrap/js/bootstrap-typeahead.js"></script>-->
</body>
</html>