diff options
Diffstat (limited to 'static/halfnarp.js')
| -rw-r--r-- | static/halfnarp.js | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/static/halfnarp.js b/static/halfnarp.js index 5cd1ef3..e40c84e 100644 --- a/static/halfnarp.js +++ b/static/halfnarp.js | |||
| @@ -102,14 +102,14 @@ function redraw_calendar(myuid, ids) { | |||
| 102 | } | 102 | } |
| 103 | }); | 103 | }); |
| 104 | calendar += 'END:VCALENDAR\r\n'; | 104 | calendar += 'END:VCALENDAR\r\n'; |
| 105 | $('.export-url-a').attr( 'href', "data:text/calendar;filename=38C3.ics," + encodeURIComponent(calendar) ); | 105 | $('.export-url-a').attr( 'href', "data:text/calendar;filename=39C3.ics," + encodeURIComponent(calendar) ); |
| 106 | $('.export-url').removeClass( 'hidden' ); | 106 | $('.export-url').removeClass( 'hidden' ); |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | function do_the_halfnarp() { | 109 | function do_the_halfnarp() { |
| 110 | // var halfnarpAPI = 'talks_36C3.json'; | 110 | // var halfnarpAPI = 'talks_36C3.json'; |
| 111 | var halfnarpAPI = '/-/talkpreferences'; | 111 | var halfnarpAPI = '/-/talkpreferences'; |
| 112 | var halfnarpCorrs = 'corr_array_38c3.json'; | 112 | var halfnarpCorrs = 'corr_array_39c3.json'; |
| 113 | var halfnarpPubAPI = halfnarpAPI + '/public/'; | 113 | var halfnarpPubAPI = halfnarpAPI + '/public/'; |
| 114 | var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); | 114 | var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0)); |
| 115 | window.top.all_events = new Object(); | 115 | window.top.all_events = new Object(); |
| @@ -179,8 +179,8 @@ function do_the_halfnarp() { | |||
| 179 | return $(this).attr('event_id'); | 179 | return $(this).attr('event_id'); |
| 180 | }).get(); | 180 | }).get(); |
| 181 | try { | 181 | try { |
| 182 | localStorage['38C3-halfnarp'] = ids; | 182 | localStorage['39C3-halfnarp'] = ids; |
| 183 | myapi = localStorage.getItem('38C3-halfnarp-api'); | 183 | myapi = localStorage.getItem('39C3-halfnarp-api'); |
| 184 | if (myapi) { | 184 | if (myapi) { |
| 185 | myapi = myapi.replace(/.*?:\//g, ""); | 185 | myapi = myapi.replace(/.*?:\//g, ""); |
| 186 | myapi = 'https:/' + myapi.replace(/.*?:\//g, ""); | 186 | myapi = 'https:/' + myapi.replace(/.*?:\//g, ""); |
| @@ -207,9 +207,9 @@ function do_the_halfnarp() { | |||
| 207 | $('.info').text('submitted'); | 207 | $('.info').text('submitted'); |
| 208 | $('.info').removeClass('hidden'); | 208 | $('.info').removeClass('hidden'); |
| 209 | try { | 209 | try { |
| 210 | localStorage['38C3-halfnarp-api'] = data['update_url']; | 210 | localStorage['39C3-halfnarp-api'] = data['update_url']; |
| 211 | localStorage['38C3-halfnarp-pid'] = mypid = data['hashed_uid']; | 211 | localStorage['39C3-halfnarp-pid'] = mypid = data['hashed_uid']; |
| 212 | localStorage['38C3-halfnarp-uid'] = myuid = data['uid']; | 212 | localStorage['39C3-halfnarp-uid'] = myuid = data['uid']; |
| 213 | window.location.hash = mypid; | 213 | window.location.hash = mypid; |
| 214 | } catch(err) {} | 214 | } catch(err) {} |
| 215 | }, 'json' ).fail(function() { | 215 | }, 'json' ).fail(function() { |
| @@ -225,9 +225,9 @@ function do_the_halfnarp() { | |||
| 225 | contentType: "application/json", | 225 | contentType: "application/json", |
| 226 | dataType: 'json', | 226 | dataType: 'json', |
| 227 | }).done(function(data) { | 227 | }).done(function(data) { |
| 228 | localStorage['38C3-halfnarp-uid'] = myuid = data['uid']; | 228 | localStorage['39C3-halfnarp-uid'] = myuid = data['uid']; |
| 229 | if( localStorage['38C3-halfnarp-pid'] ) { | 229 | if( localStorage['39C3-halfnarp-pid'] ) { |
| 230 | window.location.hash = localStorage['38C3-halfnarp-pid']; | 230 | window.location.hash = localStorage['39C3-halfnarp-pid']; |
| 231 | } | 231 | } |
| 232 | $('.info').text('updated'); | 232 | $('.info').text('updated'); |
| 233 | $('.info').removeClass('hidden'); | 233 | $('.info').removeClass('hidden'); |
| @@ -279,18 +279,21 @@ function do_the_halfnarp() { | |||
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | /* Add callbacks for view selector */ | 281 | /* Add callbacks for view selector */ |
| 282 | if (0) { | ||
| 282 | document.querySelector('.vlist').onclick = function() { toggle_grid(0); }; | 283 | document.querySelector('.vlist').onclick = function() { toggle_grid(0); }; |
| 283 | document.querySelector('.vday1').onclick = function() { toggle_grid(1); }; | 284 | document.querySelector('.vday1').onclick = function() { toggle_grid(1); }; |
| 284 | document.querySelector('.vday2').onclick = function() { toggle_grid(2); }; | 285 | document.querySelector('.vday2').onclick = function() { toggle_grid(2); }; |
| 285 | document.querySelector('.vday3').onclick = function() { toggle_grid(3); }; | 286 | document.querySelector('.vday3').onclick = function() { toggle_grid(3); }; |
| 286 | document.querySelector('.vday4').onclick = function() { toggle_grid(4); }; | 287 | document.querySelector('.vday4').onclick = function() { toggle_grid(4); }; |
| 287 | document.querySelector('.vdays').onclick = function() { toggle_grid(5); }; | 288 | document.querySelector('.vdays').onclick = function() { toggle_grid(5); }; |
| 288 | 289 | } | |
| 289 | document.querySelector('.vlang').onclick = function() { document.body.classList.toggle('languages'); }; | 290 | document.querySelector('.vlang').onclick = function() { document.body.classList.toggle('languages'); }; |
| 290 | document.querySelector('.vtrack').onclick = function() { document.body.classList.toggle('all-tracks'); }; | 291 | document.querySelector('.vtrack').onclick = function() { document.body.classList.toggle('all-tracks'); }; |
| 291 | document.querySelector('.vnarpr').onclick = function() { $('.narpr').toggleClass('hidden'); set_random_event(); }; | 292 | document.querySelector('.vnarpr').onclick = function() { $('.narpr').toggleClass('hidden'); set_random_event(); }; |
| 292 | 293 | ||
| 294 | if (0) { | ||
| 293 | document.querySelector('.vcorr').onclick = toggle_corr_mode; | 295 | document.querySelector('.vcorr').onclick = toggle_corr_mode; |
| 296 | } | ||
| 294 | 297 | ||
| 295 | $('.vclass').click( function() { toggle_classifier( $(this).attr('classifier'), $(this).hasClass('track'), $(this).hasClass('two_poles')); }); | 298 | $('.vclass').click( function() { toggle_classifier( $(this).attr('classifier'), $(this).hasClass('track'), $(this).hasClass('two_poles')); }); |
| 296 | 299 | ||
| @@ -308,10 +311,10 @@ function do_the_halfnarp() { | |||
| 308 | /* If we've been here before, try to get local preferences. They are authoratative */ | 311 | /* If we've been here before, try to get local preferences. They are authoratative */ |
| 309 | var selection = [], friends = { }; | 312 | var selection = [], friends = { }; |
| 310 | try { | 313 | try { |
| 311 | selection = localStorage['38C3-halfnarp'] || []; | 314 | selection = localStorage['39C3-halfnarp'] || []; |
| 312 | friends = localStorage['38C3-halfnarp-friends'] || { }; | 315 | friends = localStorage['39C3-halfnarp-friends'] || { }; |
| 313 | myuid = localStorage['38C3-halfnarp-uid'] || ''; | 316 | myuid = localStorage['39C3-halfnarp-uid'] || ''; |
| 314 | mypid = localStorage['38C3-halfnarp-pid'] || ''; | 317 | mypid = localStorage['39C3-halfnarp-pid'] || ''; |
| 315 | } catch(err) { | 318 | } catch(err) { |
| 316 | } | 319 | } |
| 317 | 320 | ||
| @@ -354,7 +357,7 @@ function do_the_halfnarp() { | |||
| 354 | if( hour > 23) | 357 | if( hour > 23) |
| 355 | hour -= 24; | 358 | hour -= 24; |
| 356 | 359 | ||
| 357 | /* Fix up room for 38C3 */ | 360 | /* Fix up room for 39C3 */ |
| 358 | room = (item.room_id || '').toString().replace('1','room1').replace('2','room2').replace('3','room3'); | 361 | room = (item.room_id || '').toString().replace('1','room1').replace('2','room2').replace('3','room3'); |
| 359 | 362 | ||
| 360 | /* Apply attributes to sort events into calendar */ | 363 | /* Apply attributes to sort events into calendar */ |
| @@ -400,8 +403,8 @@ function do_the_halfnarp() { | |||
| 400 | } | 403 | } |
| 401 | }); | 404 | }); |
| 402 | 405 | ||
| 403 | $.getJSON( halfnarpCorrs, { format: 'json' }).done(function(data) { window.top.all_votes = data; }); | 406 | // $.getJSON( halfnarpCorrs, { format: 'json' }).done(function(data) { window.top.all_votes = data; }); |
| 404 | toggle_grid(5); | 407 | toggle_grid(0); |
| 405 | 408 | ||
| 406 | /* Check for a new friends public uid in location's #hash */ | 409 | /* Check for a new friends public uid in location's #hash */ |
| 407 | var shared = window.location.hash; | 410 | var shared = window.location.hash; |
| @@ -439,7 +442,7 @@ function do_the_halfnarp() { | |||
| 439 | $.getJSON( halfnarpPubAPI + friends.pid, { format: 'json' }) | 442 | $.getJSON( halfnarpPubAPI + friends.pid, { format: 'json' }) |
| 440 | .done(function( data ) { | 443 | .done(function( data ) { |
| 441 | friend.prefs = data.talk_ids; | 444 | friend.prefs = data.talk_ids; |
| 442 | localStorage['38C3-halfnarp-friends'] = friends; | 445 | localStorage['39C3-halfnarp-friends'] = friends; |
| 443 | update_friends(); | 446 | update_friends(); |
| 444 | }); | 447 | }); |
| 445 | } | 448 | } |
