Commit 76e5124df273ceafbd27f434c2c24de9866334e9
1 parent
c54c2250
Exists in
master
and in
8 other branches
Fix oauth and merge
Showing
1 changed file
with
7 additions
and
8 deletions
Show diff stats
js/main.js
... | ... | @@ -34,6 +34,10 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ |
34 | 34 | // Load data from localhost when it is dev env. |
35 | 35 | var noosferoAPI = host + '/api/v1/articles/' + proposal_discussion + '?private_token=' + private_token + '&fields=id,children,categories,abstract,title,image,url,setting'; |
36 | 36 | |
37 | + window.oauthPluginHandleLoginResult = function(loggedIn, token) { | |
38 | + loginCallback(loggedIn, token); | |
39 | + } | |
40 | + | |
37 | 41 | $.getJSON(noosferoAPI) |
38 | 42 | .done(function( data ) { |
39 | 43 | data.host = host; |
... | ... | @@ -135,8 +139,7 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ |
135 | 139 | $( '.proposal-selection' ).change(function(e){ |
136 | 140 | e.preventDefault(); |
137 | 141 | |
138 | - // Update URL and Navigate | |
139 | - Main.updateHash('#/programas/' + this.value); | |
142 | + Main.display_proposal('proposal-item-' + this.value); | |
140 | 143 | }); |
141 | 144 | |
142 | 145 | var availableTags = [ ]; |
... | ... | @@ -306,9 +309,6 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ |
306 | 309 | loginButton.siblings('.login-container').show(); |
307 | 310 | } |
308 | 311 | }, |
309 | - oauthPluginHandleLoginResult: function(loggedIn, token) { | |
310 | - loginCallback(loggedIn, token); | |
311 | - }, | |
312 | 312 | guid: function() { |
313 | 313 | function s4() { |
314 | 314 | return Math.floor((1 + Math.random()) * 0x10000) |
... | ... | @@ -355,7 +355,6 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ |
355 | 355 | $('.results-container .results-content').hide(); |
356 | 356 | $('.experience-proposal-container').show(); |
357 | 357 | $('.talk-proposal-container').show(); |
358 | - $('.calendar').slick(); | |
359 | 358 | var topic_id = proposal_id.split('-').pop(); |
360 | 359 | this.loadRandomProposal(topic_id, private_token); |
361 | 360 | }, |
... | ... | @@ -371,11 +370,11 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ |
371 | 370 | $('.results-container').hide(); |
372 | 371 | $('.experience-proposal-container').hide(); |
373 | 372 | $('.talk-proposal-container').hide(); |
374 | - $('#proposal-item-' + proposal_id + ' .body').show(); | |
373 | + $('.body').show(); | |
375 | 374 | |
376 | 375 | var url = host + '/api/v1/articles/' + proposal_id + '?private_token=' + private_token + '&fields=id,body&content_type=ProposalsDiscussionPlugin::Topic'; |
377 | 376 | $.getJSON(url).done(function( data ) { |
378 | - $('#proposal-item-' + proposal_id + ' .body-content').replaceWith(data.article.body); | |
377 | + $('.body-content').replaceWith(data.article.body); | |
379 | 378 | }) |
380 | 379 | .fail(function( jqxhr, textStatus, error ) { |
381 | 380 | var err = textStatus + ', ' + error; | ... | ... |