|
226 | 226 | @click.native="$event.stopPropagation()" |
227 | 227 | /> |
228 | 228 |
|
229 | | - <v-footer v-if="!dismissedOld || (!cookiesAllowed && !dismissedCookies)" fixed class="py-1 px-2" style="height: unset;"> |
| 229 | + <v-footer v-if="!dismissedOld || !dismissedCookies" fixed style="height: unset;"> |
230 | 230 | <v-layout column> |
231 | | - <v-flex v-if="!dismissedOld"> |
| 231 | + <v-flex v-if="!dismissedOld" class = "lime accent-1 py-1 px-2"> |
232 | 232 | <v-layout row align-center> |
233 | 233 | <v-flex> |
234 | 234 | Looking for the old courseroad? Visit the old website <a target="_blank" href="https://courseroad.mit.edu/old">here</a> and export your roads! |
|
240 | 240 | </v-flex> |
241 | 241 | </v-layout> |
242 | 242 | </v-flex> |
243 | | - <v-divider v-if="!dismissedOld && !cookiesAllowed && !dismissedCookies" class="ma-1" /> |
244 | | - <v-flex v-if="!cookiesAllowed && !dismissedCookies"> |
| 243 | + <v-divider v-if="!dismissedOld && !dismissedCookies" /> |
| 244 | + <v-flex v-if="!dismissedCookies" class = "lime accent-3 py-1 px-2"> |
245 | 245 | <v-layout row align-center> |
246 | 246 | <v-flex> |
247 | | - This site uses cookies and session storage to store your data and login token. Click OK to consent to the use of cookies. |
| 247 | + This website uses cookies and session storage to store your data and login token, and important features like saving roads will not work without them. |
| 248 | + <span v-if = "cookiesAllowed === undefined">By continuing to use this website or clicking "I accept", you consent to the use of cookies.</span> |
| 249 | + <span v-if = "cookiesAllowed !== undefined">By continuing to use this website, you have consented to the use of cookies, but may opt out by clicking the button to the right.</span> |
248 | 250 | </v-flex> |
249 | 251 | <v-flex shrink> |
250 | | - <v-btn small depressed color="primary" class="ma-1" @click="allowCookies"> |
251 | | - OK |
| 252 | + <v-btn small depressed color="primary" class="ma-1" @click="allowCookies(); dismissCookies();"> |
| 253 | + I accept |
252 | 254 | </v-btn> |
253 | 255 | </v-flex> |
254 | 256 | <v-flex shrink> |
255 | | - <v-btn small icon flat class="ma-1" @click="dismissedCookies = true;"> |
256 | | - <v-icon>close</v-icon> |
| 257 | + <v-btn small depressed class = "ma-1" @click="disallowCookies"> |
| 258 | + Opt out |
257 | 259 | </v-btn> |
258 | 260 | </v-flex> |
259 | 261 | </v-layout> |
@@ -314,7 +316,7 @@ export default { |
314 | 316 | saveWarnings: [], |
315 | 317 | conflictDialog: false, |
316 | 318 | conflictInfo: undefined, |
317 | | - cookiesAllowed: false, |
| 319 | + cookiesAllowed: undefined, |
318 | 320 | searchInput: '', |
319 | 321 | showSearch: false, |
320 | 322 | classInfoStack: [], |
@@ -373,6 +375,8 @@ export default { |
373 | 375 | roads: { |
374 | 376 | handler: function (newRoads, oldRoads) { |
375 | 377 | this.justLoaded = false; |
| 378 | + this.cookiesAllowed = true; |
| 379 | + this.$refs.authcomponent.allowCookies(); |
376 | 380 | if (this.activeRoad !== '') { |
377 | 381 | this.updateFulfillment(); |
378 | 382 | } |
@@ -433,6 +437,10 @@ export default { |
433 | 437 | this.dismissedOld = JSON.parse(this.$cookies.get('dismissedOld')); |
434 | 438 | this.cookiesAllowed = true; |
435 | 439 | } |
| 440 | + if(this.$cookies.isKey('dismissedCookies')) { |
| 441 | + this.dismissedCookies = JSON.parse(this.$cookies.get('dismissedCookies')); |
| 442 | + this.cookiesAllowed = true; |
| 443 | + } |
436 | 444 |
|
437 | 445 | // developer.mit.edu version commented out because I couldn't get it to work. filed an issue to resolve it. |
438 | 446 | // axios.get('https://mit-course-catalog-v2.cloudhub.io/coursecatalog/v2/terms/2018FA/subjects', {headers:{client_id:'01fce9ed7f9d4d26939a68a4126add9b', client_secret:'D4ce51aA6A32421DA9AddF4188b93255'}}) |
@@ -566,6 +574,14 @@ export default { |
566 | 574 | this.cookiesAllowed = true; |
567 | 575 | this.$cookies.set('dismissedOld', this.dismissedOld); |
568 | 576 | }, |
| 577 | + disallowCookies: function() { |
| 578 | + this.cookiesAllowed = false; |
| 579 | + this.dismissCookies(); |
| 580 | + var cookieKeys = this.$cookies.keys(); |
| 581 | + for(var k = 0; k < cookieKeys.length; k++) { |
| 582 | + this.$cookies.remove(cookieKeys[k]); |
| 583 | + } |
| 584 | + }, |
569 | 585 | updateLocal: function (id) { |
570 | 586 | this.$refs.authcomponent.updateLocal(id); |
571 | 587 | }, |
@@ -697,6 +713,12 @@ export default { |
697 | 713 | this.$cookies.set('dismissedOld', true); |
698 | 714 | } |
699 | 715 | }, |
| 716 | + dismissCookies: function() { |
| 717 | + this.dismissedCookies = true; |
| 718 | + if(this.cookiesAllowed) { |
| 719 | + this.$cookies.set('dismissedCookies', true); |
| 720 | + } |
| 721 | + }, |
700 | 722 | clickSearch: function(event) { |
701 | 723 | this.searchOpen = !this.searchOpen; |
702 | 724 | }, |
|
0 commit comments