-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·303 lines (249 loc) · 19.6 KB
/
index.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
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<head>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="header-top">
<img src="Logo.png" alt="logo" />
<h1>
BalanceBias<br>
</h1>
<h2>
HOW TRUMP IS IT?
</h2>
</div>
<div class="wrapper"id="tfheader">
<!-- HTML for SEARCH BAR -->
<!-- <form id="tfnewsearch" method="get" action="http://www.bing.com/news" target="_blank">
<input type="text" class="tftextinput" name="q" size="21" maxlength="120" id="userInput">
<input type="submit" value="Search Bing" class="button">
</form>
-->
<!-- <form id="form" onsubmit="return false;">
<input type="text" id="userInput" />
<input type="submit" onclick="getUserInput()" />
</form> -->
<input type="text" id="userInput" />
<button class="button" onclick="setTopic()">Button Search</button>
<div class="tfclear"></div>
<!-- HTML for slider -->
<input type="range" id="myRange" min="0" max="1" value=".5" align="middle" step="0.001" width="250"/>
<br>
<button class="button" onclick="myFunction()">Submit</button>
<!-- saves user input -->
</div>
<!-- The tiles -->
<div class="tile" id="1">
<div class =content >
<p><a href="http://www.yahoo.com/">Yahoo</a></p>
</div>
</div>
<div class=tile id="2">
<div class = content>
<p><a href="http://www.yahoo.com/">Yahoo</a></p>
</div>
</div>
<div class=tile id="3">
<div class = content>
<p><a href="http://www.wsj.com/">Wall Street Journal</a></p>
</div>
</div>
<div class=tile id="4">
<div class = content>
<p><a href="http://www.cnn.com/">CNN</a></p>
</div>
</div>
<div class=tile id="5">
<div class = content>
<p><a href="http://www.nytimes.com/">The New York Times</a></p>
</div>
</div>
<div class=tile id="6">
<div class = content>
<p><a href="http://www.foxnews.com/">Fox News</a></p>
</div>
</div>
<div class=tile id="7">
<div class = content>
<p><a href="http://www.bbc.com/">BBC</a></p>
</div>
</div>
<div class=tile id="8">
<div class = content>
<p><a href="http://www.msnbc.com/">MSNBC</a></p>
</div>
</div>
<div class=tile id="9">
<div class = content>
<p><a href="http://www.theatlantic.com/">The Atlantic</a></p>
</div>
</div>
<div class=tile id="10">
<div class = content>
<p><a href="http://www.washingtonpost.com/">Washington Post</a></p>
</div>
</div>
<script>
var gayrights = {"Inputs":
[
{"id":"1","fscore":"0.6039353329347825","visibility":"visible", "url":"http://www.heraldsun.com/news/n-c-pride-annual-lgbt-festival-draws-thousands-to-durham/article_440994f6-649a-11e5-8958-fb7d25205116.html","t":"N.C. PRIDE: Annual LGBT festival draws thousands to Durham","news_source":"The Herald Sun"},
{"id":"2","fscore":"0.3310558909","visibility":"visible", "url":"http://www.usatoday.com/story/news/nation-now/2015/09/14/florida-marriage-licenses-gender-neutral/72264194/","t":"Fla. marriage licenses become gender-neutral","news_source":"USA Today"},
{"id":"3","fscore":"0.37754251056","visibility":"visible", "url":"http://www.bupipedream.com/opinion/57958/dont-forget-the-queer-in-lgbtq/","t":"Don’t forget the queer in LGBTQ","news_source":"Pipe Dream"},
{"id":"4","fscore":"0.37754251056","visibility":"visible", "url":"http://www.wtxl.com/news/marriage-ruling-spurs-change-in-car-boat-title-paperwork/article_542b4f02-6236-11e5-9d55-3fed35f5710b.html","t":"Marriage Ruling Spurs Change in Car, Boat Title Paperwork","news_source":"WTXL tv"},
{"id":"5","fscore":"0.3027086875","visibility":"visible", "url":"http://www.times-herald.com/Local/20150924FrontSameSexMarriage12inches","t":"Same Sex Marriage Ruling Compliance Help Offered","news_source":"Times-Herald"},
{"id":"6","fscore":"-1","visibility":"visible", "url":"http://www.thedailybeast.com/cheats/2015/09/18/cruz-dad-backs-kim-davis.html","t":"Cruz’s Dad: Gay Marriage From ‘Devil’","news_source":"The Daily Beast"},
{"id":"7","fscore":"0.437666925","visibility":"visible", "url":"http://www.allmediany.com/news/55394-the-fight-for-same-sex-marriage-in-australia-isn039t-over","t":"The Fight For Same-Sex Marriage In Australia Isn't Over","news_source":"Allmediany"},
{"id":"8","fscore":"0.35831654285","visibility":"visible", "url":"http://www.wtsp.com/story/news/local/florida/2015/09/14/fl-marriage-licenses--now--gender-neutral/72249450/","t":"FL marriage licenses will now be gender-neutral","news_source":"WTSP Tampa Bay"},
{"id":"9","fscore":"0.49159860727","visibility":"visible", "url":"http://www.cleveland.com/opinion/index.ssf/2015/09/gay_marriage_plaintiff_lawyers.html","t":"Gay marriage plaintiff lawyers should be paid - but not enriched: editorial","news_source":"Cleveland News"},
{"id":"10","fscore":"0.37754251056","visibility":"visible", "url":"http://www.keloland.com/newsdetail.cfm/south-dakota-to-pay-242k-in-gay-marriage-fees/?id=185436","t":"South Dakota To Pay $242K In Gay Marriage Fees","news_source":"Keloland Television"}
]};
var guncontrol = {"Inputs":
[
{"id":"1","fscore":"0.39606466706","visibility":true, "url":"http://www.nydailynews.com/news/politics/cuomo-urges-dems-shut-government-gun-control-law-article-1.2375628"},
{"id":"2","fscore":"0.3960256048","visibility":true, "url":"http://www.newsmax.com/Newsfront/cuomo-national-gun-control/2015/09/26/id/693471/"},
{"id":"3","fscore":"-1","visibility":true, "url":"http://www.newsday.com/news/new-york/cuomo-eulogizing-slain-aide-carey-gabay-calls-for-stronger-gun-control-laws-1.10892993"},
{"id":"4","fscore":"0.39221960307","visibility":true, "url":"http://www.guns.com/2015/09/26/live-feed-2015-gun-rights-policy-conference/"},
{"id":"5","fscore":"0.40637746769","visibility":true, "url":"http://mtstandard.com/news/local/proposed-missoula-gun-sale-rule-sparks-legal-debate/article_f3aff593-3383-523d-a504-2f6c3c6b05df.html"},
{"id":"6","fscore":"0.41508247","visibility":true, "url":"http://www.examiner.com/article/despite-faults-boehner-recently-nailed-it-on-gun-control-and-cdc"},
{"id":"7","fscore":"0.46793525945","visibility":true, "url":"http://www.cnn.com/2015/09/21/health/gun-laws-youth-carrying/index.html"},
{"id":"8","fscore":"0.41629485543","visibility":true, "url":"http://www.ocregister.com/articles/gun-684698-women-dix.html"},
{"id":"9","fscore":"0.47008433333","visibility":true, "url":"http://nypost.com/2015/09/26/cuomo-mourns-carey-gabay-at-funeral-demands-gun-control/"},
{"id":"10","fscore":"0.70827955333","visibility":true, "url":"http://www.thedailybeast.com/cheats/2015/09/26/cuomo-calls-for-gun-control-in-eulogy.html"},
]};
var iran = {"Inputs":
[
{"id":"1","fscore":"0.60534040371","visibility":"visible", "url":"http://www.timesofisrael.com/rouhani-meets-with-american-ceos-seeks-iran-investment/", "title":"Rouhani meets with American CEOs, seeks Iran investment", "news_source":"The Times of Israel"},
{"id":"2","fscore":"0.55334596707","visibility":"visible", "url":"http://www.desertsun.com/story/opinion/contributors/2015/09/26/valley-voice-senator-stone-iran-deal/72829704/", "title":"Valley Voice: Iran deal makes for more dangerous world", "news_source":"Desert Sun"},
{"id":"3","fscore":"0.6032170328","visibility":"visible", "url":"http://www.inklingsnews.com/c/2015/09/26/the-iranian-nuclear-deal-is-a-recipe-for-disaster/", "title":"The Iranian Nuclear Deal is a recipe for disaster", "news_source":"Inklings News"},
{"id":"4","fscore":"0.43144953583","visibility":"visible", "url":"http://www.israelnationalnews.com/News/News.aspx/201098", "title":"Gantz: There Are 'Positive Things' in Iran Deal", "news_source":"Israel National News"},
{"id":"5","fscore":"0.21325255","visibility":"visible", "url":"http://www.telesurtv.net/english/news/Irans-Rouhani-Says-Normal-Ties-With-US-Long-Way-Off-20150926-0002.html", "title":"Iran's Rouhani Says Normal Ties With US Long Way Off", "news_source":"Telesur TV"},
{"id":"6","fscore":"0.57374760315","visibility":"visible", "url":"http://www.eurasiareview.com/26092015-where-does-oman-and-irans-pipeline-leave-saudi-arabia-analysis/", "title":"Where Does Oman And Iran’s Pipeline Leave Saudi Arabia? – Analysis", "news_source":"Eurasia Review"},
{"id":"7","fscore":"0.57374760315","visibility":"visible", "url":"http://www.kcci.com/politics/john-kerry-meets-with-irans-foreign-minister/35503212", "title":"John Kerry meets with Iran's foreign minister", "news_source":"KCCI Des Moines"},
{"id":"8","fscore":"0.58048895947","visibility":"visible", "url":"http://uk.reuters.com/article/2015/09/26/uk-un-assembly-iran-haj-idUKKCN0RQ0IV20150926", "title":"At U.N., Iran's Rouhani calls for investigation into haj crush", "news_source":"Reuters"},
{"id":"9","fscore":"-1","visibility":"visible", "url":"http://www.wsj.com/articles/kerry-discusses-syria-yemen-crises-with-irans-zarif-1443288156", "title":"Kerry Presses for Political Solution to Syrian Conflict", "news_source":"Wall Street Journal"},
{"id":"10","fscore":"-1","visibility":"visible", "url":"http://gulfnews.com/news/mena/syria/obama-administration-wants-to-talk-to-iran-about-syria-1.1590194", "title":"Obama administration wants to talk to Iran about Syria", "news_source":"Gulf News"}
]};
var obamacare = {"Inputs":
[
{"id":"1","fscore":"-1","visibility":"visible", "url":"http://www.fool.com/investing/general/2015/09/26/why-more-than-two-thirds-of-obamacare-enrollees-op.aspx", "title":"Why More Than Two-Thirds of Obamacare Enrollees Opt for a Silver Plan", "news_source":"The Motley Fool"},
{"id":"2","fscore":"0.59934413125","visibility":"visible", "url":"http://dailycaller.com/2015/09/25/is-obamacare-officially-a-money-laundering-scheme/", "title":"Is Obamacare Officially A Money Laundering Scheme?", "news_source":"Daily Caller"},
{"id":"3","fscore":"0.55756989473","visibility":"visible", "url":"http://news.heartland.org/editorial/2015/09/26/obamacare-waste-continues-pile", "title":"Obamacare Waste Continues to Pile Up", "news_source":"Heartlander Magazine"},
{"id":"4","fscore":"0.49969899113","visibility":"visible", "url":"http://news.investors.com/politics/092515-772752-why-house-gop-obamacare-lawsuit-is-huge-deal.htm", "title":"House Suit May End N.Y. ObamaCare Plan, State Waivers", "news_source":"Investor's Business Daily"},
{"id":"5","fscore":"0.45761819285","visibility":"visible", "url":"http://www.cnn.com/2015/09/24/politics/pope-meets-little-sisters-of-the-poor-obamacare/index.html", "title":"Pope meets with nuns fighting Obamacare", "news_source":"CNN"},
{"id":"6","fscore":"-1","visibility":"visible", "url":"http://townhall.com/columnists/larrykudlow/2015/09/26/the-shutdown-message-n2057184", "title":"Every Now and Then, the GOP Should Disrupt the Status Quo", "news_source":"Townhall"},
{"id":"7","fscore":"0.44063547758","visibility":"visible", "url":"http://nymag.com/daily/intelligencer/2015/09/obamacare-haters-freaking-out-over-new-report.html", "title":"Obamacare Haters Freaking Out Over New Report", "news_source":"New York Magazine"},
{"id":"8","fscore":"-1","visibility":"visible", "url":"http://thehill.com/policy/healthcare/255003-non-profit-obamacare-plan-in-ny-shut-down", "title":"Another ObamaCare nonprofit bites the dust", "news_source":"The Hill"},
{"id":"9","fscore":"0.3945609","visibility":"visible", "url":"http://www.inquisitr.com/2444417/pope-francis-vs-obamacare-religious-leader-supports-lawsuit-during-unscheduled-visit-to-convent/", "title":"Pope Francis vs Obamacare: Religious Leader Supports Lawsuit During Unscheduled Visit to Convent", "news_source":"Inquisitr"},
{"id":"10","fscore":"0.39489064722","visibility":"visible", "url":"http://www.peoplespunditdaily.com/policy/2015/09/25/obamacare-is-still-a-disaster/", "title":"Obamacare is Still a Disaster", "news_source":"People's Pundit Daily"},
]};
var tax = {"Inputs":
[
{"id":"1","fscore":"0.47279974294","visibility":"visible", "url":"http://www.chicagobusiness.com/article/20150921/BLOGS02/150929994/progressive-caucus-pushes-new-property-tax-relief-plan-as-cps-tax-hike-begins-to-move","title":"Progressive Caucus pushes new property-tax-relief plan as CPS tax hike begins to move", "news_source":"Chicago Business"},
{"id":"2","fscore":"0.47657541","visibility":"visible", "url":"http://chicago.suntimes.com/chicago-politics/7/71/977415/progressive-caucus-outlines-property-tax-rebate-plan","title":"Progressive Caucus outlines property tax rebate plan", "news_source":"Chicago Sun Times"},
{"id":"3","fscore":"0.57007525733","visibility":"visible", "url":"http://www.commdiginews.com/politics-2/hillarys-progressive-tax-plans-paid-for-by-the-middle-class-48773/","title":"Hillary’s progressive tax plans – paid for by the middle class", "news_source":"Communities Digital News"},
{"id":"4","fscore":"0.57007525733","visibility":"visible", "url":"http://blogs.wsj.com/economics/2015/09/24/the-wealthiest-households-claim-90-of-tax-credits-for-buying-electric-cars/","title":"The Wealthiest Households Claim 90% of Tax Credits for Buying Electric Cars", "news_source":"Wall Street Journal"},
{"id":"5","fscore":"0.54695247171","visibility":"visible", "url":"http://www.financialbuzz.com/hawaii-languishes-at-bottom-of-us-tax-system-335157","title":"Hawaii Languishes at Bottom of US Tax System", "news_source":"Financial Buzz"},
{"id":"6","fscore":"-1","visibility":"visible", "url":"http://www.wsj.com/articles/tax-evasions-bite-from-the-ancient-world-to-modern-days-1443028212","title":"Tax Evasion’s Bite, From the Ancient World to Modern Days", "news_source":"Wall Street Journal"},
{"id":"7","fscore":"0.38497591807","visibility":"visible", "url":"http://www.vox.com/2015/9/16/9342703/ben-carson-donald-trump-debate","title":"Ben Carson: Progressive taxation is socialism. Donald Trump: No it isn't.", "news_source":"Vox"},
{"id":"8","fscore":"0.42452675833","visibility":"visible", "url":"http://www.nystateofpolitics.com/2015/09/wfps-lipton-dont-lash-tax-cut-to-minimum-wage/","title":"WFP’s Lipton: Don’t Lash Tax Cut To Minimum Wage", "news_source":"NY State of Politics"},
{"id":"9","fscore":"0.49072530175","visibility":"visible", "url":"http://www.baconsrebellion.com/2015/09/is-virginias-tax-code-really-the-35th-most-unfair.html","title":"Virginia’s Tax Code the 35th Most “Unfair”", "news_source":"Bacon's Rebellion"},
{"id":"10","fscore":"0.48775885","visibility":"visible", "url":"http://www.oregonlive.com/mapes/index.ssf/2015/09/oregons_tax_system_among_faire.html","title":"Oregon's tax system among fairest in country, survey claims", "news_source":"The Oregonian"}
]};
function getUserInput() {
// var input = document.getElementById("userInput").value;
console.log(document.getElementById("userInput").value);
return document.getElementById("userInput").value;;
}
<!-- gets slider value and compares -->
function myFunction() {
var x = document.getElementById("myRange").value;
console.log("The slide has a value of " + x);
return x;
}
var sliderVal = myFunction();
var currentTopic = null;
function setTopic() {
console.log("setTopic() is called");
// reset all articles to visible
for (var i = 0; i < gayrights.Inputs.length; i++) {
console.log("url = " + gayrights.Inputs[i].url);
gayrights.Inputs[i].visibility = "visible";
// document.getElementById(i).styles.visibility = "visible";
// document.getElementById(gayrights.Inputs[i].id).href = "https://www.google.com";//gayrights.Inputs[i].url;
// document.getElementById(gayrights.Inputs[i].id).href = gayrights.Inputs[i].url;
document.getElementById(gayrights.Inputs[i].id).innerHTML = gayrights.Inputs[i].t;
document.getElementById(gayrights.Inputs[i].id).href = gayrights.Inputs[i].url;
document.getElementById(gayrights.Inputs[i].id).setAttribute('href', "http://facebook.com");
document.getElementById(gayrights.Inputs[i].id).target = "_blank";
}
for (var i = 0; i < guncontrol.Inputs.length; i++) {
guncontrol.Inputs[i].visibility = "visible";
document.getElementById(i).styles.visibility = "visible";
document.getElementById(guncontrol.Inputs[i].id).html(guncontrol.Inputs[i].url);
document.getElementById(guncontrol.Inputs[i].id).innerHTML(guncontrol.Inputs[i].title);
}
for (var i = 0; i < iran.Inputs.length; i++) {
iran.Inputs[i].visibility = "visible";
document.getElementById(i).styles.visibility = "visible";
document.getElementById(iran.Inputs[i].id).html(iran.Inputs[i].url);
document.getElementById(iran.Inputs[i].id).innerHTML(iran.Inputs[i].title);
}
for (var i = 0; i < obamacare.Inputs.length; i++) {
obamacare.Inputs[i].visibility = "visible";
document.getElementById(i).styles.visibility = "visible";
document.getElementById(obamacare.Inputs[i].id).html(obamacare.Inputs[i].url);
document.getElementById(obamacare.Inputs[i].id).innerHTML(obamacare.Inputs[i].title);
}
for (var i = 0; i < tax.Inputs.length; i++) {
tax.Inputs[i].visibility = "visible";
document.getElementById(i).styles.visibility = "visible";
document.getElementById(tax.Inputs[i].id).html(tax.Inputs[i].url);
document.getElementById(tax.Inputs[i].id).innerHTML(tax.Inputs[i].title);
}
//based on user input set topic, reset visibilities
if (getUserInput() === "gay rights") {
for (var i = 0; i < gayrights.Inputs.length; i++) {
if (sliderVal != gayrights.Inputs[i].fscore) {
gayrights.Inputs[i].visibility = "hidden";
document.getElementById(i).styles.visibility="hidden";
}
}
`currentTopic = gayrights;
} else if (getUserInput() === "gun control") {
for (var i = 0; i < guncontrol.Inputs.length; i++) {
if (sliderVal != guncontrol.Inputs[i].fscore) {
guncontrol.Inputs[i].visibility = "hidden";
document.getElementById(i).styles.visibility="hidden";
}
}
currentTopic = guncontrol;
} else if (getUserInput() === "iran") {
for (var i = 0; i < iran.Inputs.length; i++) {
if (sliderVal != iran.Inputs[i].fscore) {
iran.Inputs[i].visibility = "hidden";
document.getElementById(i).styles.visibility="hidden";
}
}
currentTopic = iran;
} else if (getUserInput() === "obamacare") {
for (var i = 0; i < obamacare.Inputs.length; i++) {
if (sliderVal != obamacare.Inputs[i].fscore) {
obamacare.Inputs[i].visibility = "hidden";
document.getElementById(i).styles.visibility="hidden";
}
}
currentTopic = obamacare;
} else if (getUserInput() === "tax") {
for (var i = 0; i < tax.Inputs.length; i++) {
if (sliderVal != tax.Inputs[i].fscore) {
tax.Inputs[i].visibility = "hidden";
document.getElementById(i).styles.visibility="hidden";
}
}
currentTopic = tax;
}
return currentTopic;
}
</script>
</body>
</html>