Commit 24090512039d25fc8387b4789e4ea2ee1e7f2e34
1 parent
ee4b4df8
Exists in
master
and in
5 other branches
Fix JSHint errors
Showing
1 changed file
with
146 additions
and
145 deletions
Show diff stats
js/main.js
| 1 | -define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], function($, Handlebars, FastClick){ | ||
| 2 | - | ||
| 3 | - /* global Handlebars, $ */ | 1 | +/* global define */ |
| 2 | +define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers', 'piwik'], function($, Handlebars, FastClick, ProposalApp){ | ||
| 3 | + // 'use strict'; | ||
| 4 | + | ||
| 4 | // The template code | 5 | // The template code |
| 5 | var templateSource = $('#proposal-template').html(); | 6 | var templateSource = $('#proposal-template').html(); |
| 6 | 7 | ||
| @@ -21,36 +22,45 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -21,36 +22,45 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 21 | 22 | ||
| 22 | var lastHash = window.location.hash; | 23 | var lastHash = window.location.hash; |
| 23 | 24 | ||
| 24 | - var participa = true; | 25 | + var host = 'http://login.dialoga.gov.br'; |
| 26 | + var dialoga_community = 19195; | ||
| 27 | + var proposal_discussion = '103358'; //participa | ||
| 28 | + var cat_saude = 180; | ||
| 29 | + // var cat_seguranca_publica = 182; | ||
| 30 | + // var cat_educacao = 181; | ||
| 31 | + // var cat_reducao_da_pobreza = 183; | ||
| 32 | + var recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i'; | ||
| 25 | 33 | ||
| 26 | 34 | ||
| 27 | //Detects for localhost settings | 35 | //Detects for localhost settings |
| 28 | - var patt = new RegExp(":3001/"); | ||
| 29 | - if(patt.test(window.location.href)) | ||
| 30 | - participa = false; | ||
| 31 | - | ||
| 32 | - if(participa){ | ||
| 33 | - var host = 'http://login.dialoga.gov.br'; | ||
| 34 | - window.dialoga_community = 19195; | ||
| 35 | - proposal_discussion = '103358'; //participa | ||
| 36 | - var cat_saude = 180; | ||
| 37 | - var cat_seguranca_publica = 182; | ||
| 38 | - var cat_educacao = 181; | ||
| 39 | - var cat_reducao_da_pobreza = 183; | ||
| 40 | - window.recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i' | ||
| 41 | - }else{ | ||
| 42 | - var host = 'http://noosfero.com:3001'; | ||
| 43 | - window.dialoga_community = 104; | ||
| 44 | -// var proposal_discussion = '392'; //local serpro | ||
| 45 | - var proposal_discussion = '413'; //casa | ||
| 46 | - window.recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-' //http://noosfero.com/ | ||
| 47 | - var cat_saude = 23; | 36 | + var patt = new RegExp(':3001/'); |
| 37 | + if(patt.test(window.location.href)){ | ||
| 38 | + host = 'http://noosfero.com:3001'; | ||
| 39 | + dialoga_community = 104; | ||
| 40 | + proposal_discussion = '413'; //casa | ||
| 41 | + recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-'; //http://noosfero.com/ | ||
| 42 | + cat_saude = 23; | ||
| 48 | } | 43 | } |
| 49 | - window.proposal_discussion = proposal_discussion; | 44 | + |
| 50 | var BARRA_ADDED = false; | 45 | var BARRA_ADDED = false; |
| 51 | var HIDE_BARRA_DO_GOVERNO = false; | 46 | var HIDE_BARRA_DO_GOVERNO = false; |
| 52 | 47 | ||
| 53 | - Main = (function(){ | 48 | + var Main; |
| 49 | + window.Main = Main = (function(){ | ||
| 50 | + | ||
| 51 | + var API = { | ||
| 52 | + articles: '', | ||
| 53 | + proposals: '/api/v1/articles/{topic_id}/children', | ||
| 54 | + | ||
| 55 | + }; | ||
| 56 | + | ||
| 57 | + API.getProposalsURL = function (topicId){ | ||
| 58 | + return host + replace(API.proposals, '{topic_id}', topicId); | ||
| 59 | + }; | ||
| 60 | + | ||
| 61 | + function replace(str, pattern, value){ | ||
| 62 | + return str.replace(new RegExp(pattern, 'g'), value); | ||
| 63 | + } | ||
| 54 | 64 | ||
| 55 | return { | 65 | return { |
| 56 | private_token: '375bee7e17d0021af7160ce664874618', | 66 | private_token: '375bee7e17d0021af7160ce664874618', |
| @@ -68,7 +78,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -68,7 +78,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 68 | return proposalId; | 78 | return proposalId; |
| 69 | }, | 79 | }, |
| 70 | loadRandomProposal: function (topic_id, force) { | 80 | loadRandomProposal: function (topic_id, force) { |
| 71 | - var private_token = Main.private_token; | 81 | + var private_token = window.Main.private_token; |
| 72 | var $noProposals = $('.no-proposals'); | 82 | var $noProposals = $('.no-proposals'); |
| 73 | var $loading = $('.loading'); | 83 | var $loading = $('.loading'); |
| 74 | var $randomProposal = $('.random-proposal'); | 84 | var $randomProposal = $('.random-proposal'); |
| @@ -80,13 +90,13 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -80,13 +90,13 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 80 | $loading.show(); | 90 | $loading.show(); |
| 81 | $randomProposal.html(''); | 91 | $randomProposal.html(''); |
| 82 | 92 | ||
| 83 | - var url = host + '/api/v1/articles/' + topic_id + '/children'; | 93 | + var url = API.getProposalsURL(topic_id); |
| 84 | var childId = this.getProposalId(); | 94 | var childId = this.getProposalId(); |
| 85 | 95 | ||
| 86 | - if(childId != 0 && !force){ | ||
| 87 | - url += '/'+childId; | 96 | + if(childId !== 0 && !force){ |
| 97 | + url += '/' + childId; | ||
| 88 | } | 98 | } |
| 89 | - url += '?private_token=' + Main.private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,slug,abstract,created_by&content_type=ProposalsDiscussionPlugin::Proposal'; | 99 | + url += '?private_token=' + private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,slug,abstract,created_by&content_type=ProposalsDiscussionPlugin::Proposal'; |
| 90 | 100 | ||
| 91 | $.getJSON(url).done(function( data ) { | 101 | $.getJSON(url).done(function( data ) { |
| 92 | $loading.hide(); | 102 | $loading.hide(); |
| @@ -164,12 +174,6 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -164,12 +174,6 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 164 | } | 174 | } |
| 165 | }); | 175 | }); |
| 166 | 176 | ||
| 167 | - // $body.off('click', '.question-link'); | ||
| 168 | - // $body.on('click', '.question-link', function(e) { | ||
| 169 | - // var $this = $(this); | ||
| 170 | - | ||
| 171 | - // // Main.navigateTo($this.attr('href'), backTo); | ||
| 172 | - // }); | ||
| 173 | }).fail(function(){ | 177 | }).fail(function(){ |
| 174 | $loading.hide(); | 178 | $loading.hide(); |
| 175 | $('.support-proposal .alert').show(); | 179 | $('.support-proposal .alert').show(); |
| @@ -194,7 +198,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -194,7 +198,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 194 | $resultsContainer.html(resultsTemplate(data)); | 198 | $resultsContainer.html(resultsTemplate(data)); |
| 195 | $resultsContainer.find('.loading').hide(); | 199 | $resultsContainer.find('.loading').hide(); |
| 196 | $resultsContainer.find('.results-content').show(); | 200 | $resultsContainer.find('.results-content').show(); |
| 197 | - $(".timeago").timeago(); | 201 | + $('.timeago').timeago(); |
| 198 | $resultsContainer.show(); | 202 | $resultsContainer.show(); |
| 199 | 203 | ||
| 200 | $('.footable').footable(); | 204 | $('.footable').footable(); |
| @@ -399,7 +403,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -399,7 +403,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 399 | }) | 403 | }) |
| 400 | .fail(function( jqxhr, textStatus, error ) { | 404 | .fail(function( jqxhr, textStatus, error ) { |
| 401 | var err = textStatus + ', ' + error; | 405 | var err = textStatus + ', ' + error; |
| 402 | - // console.log( 'Request Failed: ' + err ); | 406 | + console.error( 'Request Failed: ' + err ); |
| 403 | }); | 407 | }); |
| 404 | }, | 408 | }, |
| 405 | display_proposal_by_category: function(item){ | 409 | display_proposal_by_category: function(item){ |
| @@ -502,7 +506,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -502,7 +506,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 502 | var regexResultados = /resultados$/; | 506 | var regexResultados = /resultados$/; |
| 503 | var regexSobreOPrograma = /sobre-o-programa$/; | 507 | var regexSobreOPrograma = /sobre-o-programa$/; |
| 504 | 508 | ||
| 505 | - if( !(regexHideBarra.exec(hash) !== null) && !HIDE_BARRA_DO_GOVERNO ){ | 509 | + if( (regexHideBarra.exec(hash) === null) && !HIDE_BARRA_DO_GOVERNO ){ |
| 506 | this.addBarraDoGoverno(); | 510 | this.addBarraDoGoverno(); |
| 507 | }else{ | 511 | }else{ |
| 508 | HIDE_BARRA_DO_GOVERNO = true; | 512 | HIDE_BARRA_DO_GOVERNO = true; |
| @@ -523,6 +527,8 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -523,6 +527,8 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 523 | this.display_article(hash.split('/')[2], lastHash); | 527 | this.display_article(hash.split('/')[2], lastHash); |
| 524 | } | 528 | } |
| 525 | 529 | ||
| 530 | + var proposalTitle; | ||
| 531 | + | ||
| 526 | if( isProposal ){ | 532 | if( isProposal ){ |
| 527 | 533 | ||
| 528 | // go to proposal | 534 | // go to proposal |
| @@ -530,8 +536,9 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -530,8 +536,9 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 530 | this.navigateToProposal(proposalId); | 536 | this.navigateToProposal(proposalId); |
| 531 | 537 | ||
| 532 | var $proposal = $('#proposal-item-' + proposalId); | 538 | var $proposal = $('#proposal-item-' + proposalId); |
| 533 | - var proposalTitle = $proposal.find('.title').text(); | 539 | + proposalTitle = $proposal.find('.title').text(); |
| 534 | var proposalOffset = $proposal.offset(); | 540 | var proposalOffset = $proposal.offset(); |
| 541 | + | ||
| 535 | if(proposalOffset){ | 542 | if(proposalOffset){ |
| 536 | scrollTop = proposalOffset.top; | 543 | scrollTop = proposalOffset.top; |
| 537 | }else{ | 544 | }else{ |
| @@ -548,22 +555,24 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -548,22 +555,24 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 548 | if($resultsContainer.css('display') === 'none') { | 555 | if($resultsContainer.css('display') === 'none') { |
| 549 | Main.loadRanking($resultsContainer, proposalId, 1); | 556 | Main.loadRanking($resultsContainer, proposalId, 1); |
| 550 | } else { | 557 | } else { |
| 551 | - $proposalDetail.find('.experience-proposal-container').show(); | ||
| 552 | - $proposalDetail.find('.talk-proposal-container').show(); | 558 | + $proposal.find('.experience-proposal-container').show(); |
| 559 | + $proposal.find('.talk-proposal-container').show(); | ||
| 553 | $resultsContainer.hide(); | 560 | $resultsContainer.hide(); |
| 554 | } | 561 | } |
| 555 | 562 | ||
| 556 | - var proposalOffset = $resultsContainer.offset(); | 563 | + proposalOffset = $resultsContainer.offset(); |
| 557 | if(proposalOffset){ | 564 | if(proposalOffset){ |
| 558 | scrollTop = proposalOffset.top; | 565 | scrollTop = proposalOffset.top; |
| 559 | } | 566 | } |
| 560 | } | 567 | } |
| 561 | } | 568 | } |
| 562 | 569 | ||
| 570 | + var categorySlug; | ||
| 571 | + | ||
| 563 | if( isCategory ){ | 572 | if( isCategory ){ |
| 564 | 573 | ||
| 565 | // go to category | 574 | // go to category |
| 566 | - var categorySlug = parts[2]; | 575 | + categorySlug = parts[2]; |
| 567 | var categoryId = parts[3]; | 576 | var categoryId = parts[3]; |
| 568 | this.navigateToCategory(categoryId); | 577 | this.navigateToCategory(categoryId); |
| 569 | 578 | ||
| @@ -592,7 +601,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -592,7 +601,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 592 | 601 | ||
| 593 | var trackPageTitle = ''; | 602 | var trackPageTitle = ''; |
| 594 | if(isArticle){ | 603 | if(isArticle){ |
| 595 | - trackPageTitle = 'Página: Sobre' | 604 | + trackPageTitle = 'Página: Sobre'; |
| 596 | } | 605 | } |
| 597 | 606 | ||
| 598 | if(isProposal){ | 607 | if(isProposal){ |
| @@ -622,7 +631,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -622,7 +631,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 622 | var regexSobreOPrograma = /sobre-o-programa$/; | 631 | var regexSobreOPrograma = /sobre-o-programa$/; |
| 623 | if(proposalId === undefined){ | 632 | if(proposalId === undefined){ |
| 624 | this.display_proposals_tab(); | 633 | this.display_proposals_tab(); |
| 625 | - }else if(regexSobreOPrograma.exec(window.location.hash) == null){ | 634 | + }else if(regexSobreOPrograma.exec(window.location.hash) === null){ |
| 626 | this.display_proposal('proposal-item-' + proposalId); | 635 | this.display_proposal('proposal-item-' + proposalId); |
| 627 | }else{ | 636 | }else{ |
| 628 | this.display_proposal_detail(proposalId); | 637 | this.display_proposal_detail(proposalId); |
| @@ -636,11 +645,13 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -636,11 +645,13 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 636 | } | 645 | } |
| 637 | }, | 646 | }, |
| 638 | oauthClientAction: function(url) { | 647 | oauthClientAction: function(url) { |
| 639 | - var child = window.open(url, "_blank"); | 648 | + var child = window.open(url, '_blank'); |
| 640 | var interval = setInterval(function() { | 649 | var interval = setInterval(function() { |
| 641 | try { | 650 | try { |
| 642 | if(!child.closed) { | 651 | if(!child.closed) { |
| 643 | - child.postMessage({ message: "requestOauthClientPluginResult" }, "*"); | 652 | + child.postMessage({ |
| 653 | + message: 'requestOauthClientPluginResult' | ||
| 654 | + }, '*'); | ||
| 644 | } | 655 | } |
| 645 | } | 656 | } |
| 646 | catch(e) { | 657 | catch(e) { |
| @@ -660,10 +671,10 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -660,10 +671,10 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 660 | successPanel.find('.message').html(text); | 671 | successPanel.find('.message').html(text); |
| 661 | successPanel.appendTo(container.closest('.categories')); | 672 | successPanel.appendTo(container.closest('.categories')); |
| 662 | successPanel.show(); | 673 | successPanel.show(); |
| 663 | - successPanel.css("top", Math.max(0, ((container.height() - successPanel.outerHeight()) / 2) + container.offset().top) + "px"); | ||
| 664 | - successPanel.css("left", Math.max(0, ((container.width() - successPanel.outerWidth()) / 2) + container.offset().left) + "px"); | 674 | + successPanel.css('top', Math.max(0, ((container.height() - successPanel.outerHeight()) / 2) + container.offset().top) + 'px'); |
| 675 | + successPanel.css('left', Math.max(0, ((container.width() - successPanel.outerWidth()) / 2) + container.offset().left) + 'px'); | ||
| 665 | 676 | ||
| 666 | - var interval = setTimeout(function() { | 677 | + setTimeout(function() { |
| 667 | successPanel.hide(); | 678 | successPanel.hide(); |
| 668 | container.css('opacity', 1); | 679 | container.css('opacity', 1); |
| 669 | successPanel.remove(); | 680 | successPanel.remove(); |
| @@ -691,28 +702,32 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -691,28 +702,32 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 691 | }, | 702 | }, |
| 692 | responseToText: function(responseJSONmessage){ | 703 | responseToText: function(responseJSONmessage){ |
| 693 | var o = JSON.parse(responseJSONmessage); | 704 | var o = JSON.parse(responseJSONmessage); |
| 694 | - var msg = ""; | 705 | + var msg = ''; |
| 695 | var fn; | 706 | var fn; |
| 696 | 707 | ||
| 697 | for (var key in o) { | 708 | for (var key in o) { |
| 698 | if (o[key] instanceof Array) { | 709 | if (o[key] instanceof Array) { |
| 699 | fn = key; | 710 | fn = key; |
| 700 | for (var i = 0; i < o[key].length; i++) { | 711 | for (var i = 0; i < o[key].length; i++) { |
| 701 | - msg += fn + " " + o[key][i] + "</br>"; | 712 | + msg += fn + ' ' + o[key][i] + '</br>'; |
| 702 | } | 713 | } |
| 703 | } | 714 | } |
| 704 | } | 715 | } |
| 705 | - msg = msg.replace('password_confirmation', "campo 'confirmação da senha'"); | ||
| 706 | - msg = msg.replace(/password/g, "campo 'senha'"); | ||
| 707 | - msg = msg.replace('login', "campo 'nome de usuário'"); | ||
| 708 | - msg = msg.replace('email', "campo 'e-mail'"); | ||
| 709 | - msg = msg.substring(0, msg.length - 5) + "."; | 716 | + msg = msg.replace('password_confirmation', 'campo "confirmação da senha"'); |
| 717 | + msg = msg.replace(/password/g, 'campo "senha"'); | ||
| 718 | + msg = msg.replace('login', 'campo "nome de usuário"'); | ||
| 719 | + msg = msg.replace('email', 'campo "e-mail"'); | ||
| 720 | + msg = msg.substring(0, msg.length - 5) + '.'; | ||
| 710 | return msg; | 721 | return msg; |
| 711 | }, | 722 | }, |
| 712 | display_events: function(cat_id, active_category) { | 723 | display_events: function(cat_id, active_category) { |
| 713 | - var url = host + '/api/v1/communities/' + window.dialoga_community + '/articles?categories_ids[]=' + cat_id + '&content_type=Event&private_token=' + '375bee7e17d0021af7160ce664874618'; | 724 | + var url = host + '/api/v1/communities/' + dialoga_community + '/articles?categories_ids[]=' + cat_id + '&content_type=Event&private_token=' + '375bee7e17d0021af7160ce664874618'; |
| 714 | $.getJSON(url).done(function (data) { | 725 | $.getJSON(url).done(function (data) { |
| 715 | - if(data.articles.length==0) return; | 726 | + |
| 727 | + if(data.articles.length === 0){ | ||
| 728 | + return; | ||
| 729 | + } | ||
| 730 | + | ||
| 716 | var dt = data.articles[0].start_date; | 731 | var dt = data.articles[0].start_date; |
| 717 | var date = dt.substr(8, 2) + '/' + dt.substr(5, 2) + '/' + dt.substr(0, 4); | 732 | var date = dt.substr(8, 2) + '/' + dt.substr(5, 2) + '/' + dt.substr(0, 4); |
| 718 | var dd = new Date(dt); | 733 | var dd = new Date(dt); |
| @@ -720,7 +735,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -720,7 +735,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 720 | var params = {event: data.articles[0], date: date, time: time, category: data.articles[0].categories[0].name, category_class: active_category}; | 735 | var params = {event: data.articles[0], date: date, time: time, category: data.articles[0].categories[0].name, category_class: active_category}; |
| 721 | $.getJSON(host+'/api/v1/articles/'+data.articles[0].id+'/followers?private_token=' + '375bee7e17d0021af7160ce664874618' + '&_='+new Date().getTime()).done(function (data) { | 736 | $.getJSON(host+'/api/v1/articles/'+data.articles[0].id+'/followers?private_token=' + '375bee7e17d0021af7160ce664874618' + '&_='+new Date().getTime()).done(function (data) { |
| 722 | //FIXME do not depend on this request | 737 | //FIXME do not depend on this request |
| 723 | - params['total_followers'] = data.total_followers; | 738 | + params.total_followers = data.total_followers; |
| 724 | $('.calendar-container').html(calendarTemplate(params)); | 739 | $('.calendar-container').html(calendarTemplate(params)); |
| 725 | $('.calendar-container .calendar.' + active_category).show(); | 740 | $('.calendar-container .calendar.' + active_category).show(); |
| 726 | // $('.calendar-container .calendar').slick(); | 741 | // $('.calendar-container .calendar').slick(); |
| @@ -768,7 +783,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -768,7 +783,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 768 | var $paragraph = $proposalItemEl.find('p'); | 783 | var $paragraph = $proposalItemEl.find('p'); |
| 769 | var lines = Main.computeLines($paragraph); | 784 | var lines = Main.computeLines($paragraph); |
| 770 | if(lines > maxLinesByParagraph ){ | 785 | if(lines > maxLinesByParagraph ){ |
| 771 | - maxLinesByParagraph = lines | 786 | + maxLinesByParagraph = lines; |
| 772 | } | 787 | } |
| 773 | }); | 788 | }); |
| 774 | // console.log('maxLinesByParagraph', maxLinesByParagraph); | 789 | // console.log('maxLinesByParagraph', maxLinesByParagraph); |
| @@ -779,7 +794,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -779,7 +794,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 779 | var $title = $proposalItemEl.find('.box__title'); | 794 | var $title = $proposalItemEl.find('.box__title'); |
| 780 | var lines = Main.computeLines($title); | 795 | var lines = Main.computeLines($title); |
| 781 | if(lines > maxLinesByTitle ){ | 796 | if(lines > maxLinesByTitle ){ |
| 782 | - maxLinesByTitle = lines | 797 | + maxLinesByTitle = lines; |
| 783 | } | 798 | } |
| 784 | }); | 799 | }); |
| 785 | // console.log('maxLinesByTitle', maxLinesByTitle); | 800 | // console.log('maxLinesByTitle', maxLinesByTitle); |
| @@ -816,9 +831,9 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -816,9 +831,9 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 816 | Main.loginCallback(true, data.private_token); | 831 | Main.loginCallback(true, data.private_token); |
| 817 | }, | 832 | }, |
| 818 | handleLoginFail: function (e){ | 833 | handleLoginFail: function (e){ |
| 819 | - // console.log('Event', e); | 834 | + console.error('handleLoginFail', e); |
| 820 | } | 835 | } |
| 821 | - } | 836 | + }; |
| 822 | })(); | 837 | })(); |
| 823 | 838 | ||
| 824 | 839 | ||
| @@ -846,7 +861,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -846,7 +861,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 846 | var url = abstract.substring(startSrcUrl , endSrcUrl); | 861 | var url = abstract.substring(startSrcUrl , endSrcUrl); |
| 847 | // console.log('url', url); | 862 | // console.log('url', url); |
| 848 | 863 | ||
| 849 | - if(url.indexOf("wmode=opaque") !== -1){ | 864 | + if(url.indexOf('wmode=opaque') !== -1){ |
| 850 | // already in opaque mode | 865 | // already in opaque mode |
| 851 | // console.debug('already in opaque mode'); | 866 | // console.debug('already in opaque mode'); |
| 852 | return; | 867 | return; |
| @@ -856,10 +871,11 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -856,10 +871,11 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 856 | c = '&'; | 871 | c = '&'; |
| 857 | } | 872 | } |
| 858 | 873 | ||
| 859 | - var resultUrl = url+c+"wmode=opaque"; | 874 | + var resultUrl = url + c + 'wmode=opaque'; |
| 860 | article.abstract = abstract.replace(url, resultUrl); | 875 | article.abstract = abstract.replace(url, resultUrl); |
| 861 | // console.log('article.abstract', article.abstract); | 876 | // console.log('article.abstract', article.abstract); |
| 862 | - }; | 877 | + } |
| 878 | + | ||
| 863 | forceWmodeIframe(data.article); | 879 | forceWmodeIframe(data.article); |
| 864 | 880 | ||
| 865 | resultsPlaceholder.innerHTML = template(data); | 881 | resultsPlaceholder.innerHTML = template(data); |
| @@ -917,7 +933,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -917,7 +933,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 917 | $(document).keyup(function(e) { | 933 | $(document).keyup(function(e) { |
| 918 | 934 | ||
| 919 | // escape key maps to keycode `27` | 935 | // escape key maps to keycode `27` |
| 920 | - if (e.keyCode == 27) { // ESC | 936 | + if (e.keyCode === 27) { // ESC |
| 921 | $loginPanel.hide(); | 937 | $loginPanel.hide(); |
| 922 | } | 938 | } |
| 923 | }); | 939 | }); |
| @@ -975,7 +991,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -975,7 +991,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 975 | // return to proposal page | 991 | // return to proposal page |
| 976 | newHash = oldHash.split('/sobre-o-programa')[0]; | 992 | newHash = oldHash.split('/sobre-o-programa')[0]; |
| 977 | }else{ | 993 | }else{ |
| 978 | - $link = $(this).siblings('.proposal-link'); | 994 | + var $link = $(this).siblings('.proposal-link'); |
| 979 | newHash = $link.attr('href'); | 995 | newHash = $link.attr('href'); |
| 980 | } | 996 | } |
| 981 | 997 | ||
| @@ -1025,10 +1041,10 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1025,10 +1041,10 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1025 | Main.updateHash($link.attr('href')); | 1041 | Main.updateHash($link.attr('href')); |
| 1026 | }); | 1042 | }); |
| 1027 | 1043 | ||
| 1028 | - $( '.proposal-selection' ).change(function(e){ | 1044 | + $( '.proposal-selection' ).change(function(){ |
| 1029 | // Update URL and Navigate | 1045 | // Update URL and Navigate |
| 1030 | Main.updateHash('#/programas/' + this.value); | 1046 | Main.updateHash('#/programas/' + this.value); |
| 1031 | - $(this).val($(this).data("proposal")).trigger("chosen:updated"); | 1047 | + $(this).val($(this).data('proposal')).trigger('chosen:updated'); |
| 1032 | }); | 1048 | }); |
| 1033 | 1049 | ||
| 1034 | var availableTags = [ ]; | 1050 | var availableTags = [ ]; |
| @@ -1053,8 +1069,8 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1053,8 +1069,8 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1053 | 1069 | ||
| 1054 | $('.save-article-form').submit(function (e) { | 1070 | $('.save-article-form').submit(function (e) { |
| 1055 | e.preventDefault(); | 1071 | e.preventDefault(); |
| 1056 | - var proposal_id = this.id.split('-').pop(); | ||
| 1057 | - var form = this; | 1072 | + // var proposal_id = this.id.split('-').pop(); |
| 1073 | + // var form = this; | ||
| 1058 | var $form = $(this); | 1074 | var $form = $(this); |
| 1059 | var $message = $form.find('.message'); | 1075 | var $message = $form.find('.message'); |
| 1060 | $message.hide(); | 1076 | $message.hide(); |
| @@ -1074,7 +1090,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1074,7 +1090,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1074 | }) | 1090 | }) |
| 1075 | .fail(function( jqxhr, textStatus, error ) { | 1091 | .fail(function( jqxhr, textStatus, error ) { |
| 1076 | var err = textStatus + ', ' + error; | 1092 | var err = textStatus + ', ' + error; |
| 1077 | - // console.log( 'Request Failed: ' + err ); | 1093 | + console.error( 'Request Failed: ' + err ); |
| 1078 | $message.show(); | 1094 | $message.show(); |
| 1079 | $message.text('Não foi possível enviar.'); | 1095 | $message.text('Não foi possível enviar.'); |
| 1080 | }); | 1096 | }); |
| @@ -1082,7 +1098,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1082,7 +1098,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1082 | }) | 1098 | }) |
| 1083 | .fail(function( jqxhr, textStatus, error ) { | 1099 | .fail(function( jqxhr, textStatus, error ) { |
| 1084 | var err = textStatus + ', ' + error; | 1100 | var err = textStatus + ', ' + error; |
| 1085 | - // console.log( 'Request Failed: ' + err ); | 1101 | + console.error( 'Request Failed: ' + err ); |
| 1086 | }); | 1102 | }); |
| 1087 | 1103 | ||
| 1088 | $(document).ready(function($) { | 1104 | $(document).ready(function($) { |
| @@ -1149,7 +1165,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1149,7 +1165,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1149 | }).fail(function(data) { | 1165 | }).fail(function(data) { |
| 1150 | 1166 | ||
| 1151 | $message.show(); | 1167 | $message.show(); |
| 1152 | - if(data.status==401){ | 1168 | + if(data.status === 401){ |
| 1153 | $message.text('Nome de usuário, e-mail ou senha incorretos, não foi possível acessar.'); | 1169 | $message.text('Nome de usuário, e-mail ou senha incorretos, não foi possível acessar.'); |
| 1154 | }else{ | 1170 | }else{ |
| 1155 | $message.text('Um erro inesperado ocorreu'); | 1171 | $message.text('Um erro inesperado ocorreu'); |
| @@ -1174,24 +1190,32 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1174,24 +1190,32 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1174 | }); | 1190 | }); |
| 1175 | 1191 | ||
| 1176 | $(document).on('click', '.new-user', function(e) { | 1192 | $(document).on('click', '.new-user', function(e) { |
| 1177 | - if(window.lastCaptcha) | 1193 | + |
| 1194 | + if(window.lastCaptcha){ | ||
| 1178 | window.lastCaptcha.destruir(); | 1195 | window.lastCaptcha.destruir(); |
| 1196 | + } | ||
| 1197 | + | ||
| 1179 | var loginForm = $(this).parents('#login-form'); | 1198 | var loginForm = $(this).parents('#login-form'); |
| 1180 | var signupForm = loginForm.siblings('#signup-form'); | 1199 | var signupForm = loginForm.siblings('#signup-form'); |
| 1181 | window.signupForm = signupForm; | 1200 | window.signupForm = signupForm; |
| 1201 | + | ||
| 1182 | loginForm.hide(); | 1202 | loginForm.hide(); |
| 1183 | signupForm.show(); | 1203 | signupForm.show(); |
| 1184 | - signupForm.find(".password").show(); | ||
| 1185 | - signupForm.find(".password-confirmation").show(); | 1204 | + |
| 1205 | + signupForm.find('.password').show(); | ||
| 1206 | + signupForm.find('.password-confirmation').show(); | ||
| 1186 | loginForm.find('.message').hide(); | 1207 | loginForm.find('.message').hide(); |
| 1187 | signupForm.find('#serpro_captcha').empty(); | 1208 | signupForm.find('#serpro_captcha').empty(); |
| 1209 | + | ||
| 1188 | var oCaptcha_serpro_gov_br; | 1210 | var oCaptcha_serpro_gov_br; |
| 1189 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); | 1211 | oCaptcha_serpro_gov_br = new captcha_serpro_gov_br(); |
| 1190 | window.lastCaptcha = oCaptcha_serpro_gov_br; | 1212 | window.lastCaptcha = oCaptcha_serpro_gov_br; |
| 1191 | - oCaptcha_serpro_gov_br.clienteId = "fdbcdc7a0b754ee7ae9d865fda740f17"; | ||
| 1192 | - oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], "css", "input", "serpro_captcha_component_"); | 1213 | + |
| 1214 | + oCaptcha_serpro_gov_br.clienteId = 'fdbcdc7a0b754ee7ae9d865fda740f17'; | ||
| 1215 | + oCaptcha_serpro_gov_br.criarUI(signupForm.find('#serpro_captcha')[0], 'css', 'input', 'serpro_captcha_component_'); | ||
| 1216 | + | ||
| 1193 | e.preventDefault(); | 1217 | e.preventDefault(); |
| 1194 | - }) | 1218 | + }); |
| 1195 | 1219 | ||
| 1196 | $(document).on('click', '.cancel-signup', function(e) { | 1220 | $(document).on('click', '.cancel-signup', function(e) { |
| 1197 | var signupForm = $(this).parents('#signup-form'); | 1221 | var signupForm = $(this).parents('#signup-form'); |
| @@ -1221,7 +1245,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1221,7 +1245,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1221 | var hasUsername = $inputUsername && $inputUsername.val().length > 0; | 1245 | var hasUsername = $inputUsername && $inputUsername.val().length > 0; |
| 1222 | var hasPassword = $inputPassword && $inputPassword.val().length > 0; | 1246 | var hasPassword = $inputPassword && $inputPassword.val().length > 0; |
| 1223 | var hasPasswordConfirmation = $inputPasswordConfirmation && $inputPasswordConfirmation.val().length > 0; | 1247 | var hasPasswordConfirmation = $inputPasswordConfirmation && $inputPasswordConfirmation.val().length > 0; |
| 1224 | - var hasPasswordEquals = $inputPassword.val() == $inputPasswordConfirmation.val(); | 1248 | + var hasPasswordEquals = $inputPassword.val() === $inputPasswordConfirmation.val(); |
| 1225 | var hasAcceptation = $inputAcceptation.val(); | 1249 | var hasAcceptation = $inputAcceptation.val(); |
| 1226 | var hasCaptcha = $inputCaptcha.val().length > 0; | 1250 | var hasCaptcha = $inputCaptcha.val().length > 0; |
| 1227 | var hasError = (!hasEmail || !hasUsername || !hasPassword || !hasPasswordConfirmation || !hasPasswordEquals || !hasAcceptation || !hasCaptcha); | 1251 | var hasError = (!hasEmail || !hasUsername || !hasPassword || !hasPasswordConfirmation || !hasPasswordEquals || !hasAcceptation || !hasCaptcha); |
| @@ -1288,11 +1312,13 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1288,11 +1312,13 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1288 | } | 1312 | } |
| 1289 | $(document).trigger('login:success', data); | 1313 | $(document).trigger('login:success', data); |
| 1290 | }) | 1314 | }) |
| 1291 | - .fail(function (data, var2) { | ||
| 1292 | - var msg = ""; | 1315 | + .fail(function (data) { |
| 1316 | + var msg = ''; | ||
| 1293 | // Reload captcha here | 1317 | // Reload captcha here |
| 1294 | - if(window.lastCaptcha) | 1318 | + if(window.lastCaptcha){ |
| 1295 | window.lastCaptcha.recarregar(); | 1319 | window.lastCaptcha.recarregar(); |
| 1320 | + } | ||
| 1321 | + | ||
| 1296 | if(data.responseJSON){ | 1322 | if(data.responseJSON){ |
| 1297 | try{ | 1323 | try{ |
| 1298 | msg = Main.responseToText(data.responseJSON.message); | 1324 | msg = Main.responseToText(data.responseJSON.message); |
| @@ -1323,32 +1349,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1323,32 +1349,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1323 | } | 1349 | } |
| 1324 | }); | 1350 | }); |
| 1325 | 1351 | ||
| 1326 | - // var popupCenter = function(url, title, w, h) { | ||
| 1327 | - // var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left; | ||
| 1328 | - // var dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top; | ||
| 1329 | - | ||
| 1330 | - // var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; | ||
| 1331 | - // var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; | ||
| 1332 | - | ||
| 1333 | - // var left = ((width / 2) - (w / 2)) + dualScreenLeft; | ||
| 1334 | - // var top = ((height / 3) - (h / 3)) + dualScreenTop; | ||
| 1335 | - | ||
| 1336 | - // var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); | ||
| 1337 | - | ||
| 1338 | - // // Puts focus on the newWindow | ||
| 1339 | - // if (window.focus) { | ||
| 1340 | - // newWindow.focus(); | ||
| 1341 | - // } | ||
| 1342 | - // }; | ||
| 1343 | - | ||
| 1344 | - // $(document).on('click', '.social a.popup', {}, function popUp(e) { | ||
| 1345 | - // var self = $(this); | ||
| 1346 | - // popupCenter(self.attr('href'), self.find('.rrssb-text').html(), 580, 470); | ||
| 1347 | - // e.preventDefault(); | ||
| 1348 | - // }); | ||
| 1349 | - | ||
| 1350 | $(document).on('click', '#logout-button', function (e){ | 1352 | $(document).on('click', '#logout-button', function (e){ |
| 1351 | - var self = $(this); | ||
| 1352 | $.removeCookie('_dialoga_session'); | 1353 | $.removeCookie('_dialoga_session'); |
| 1353 | $.removeCookie('votedProposals'); | 1354 | $.removeCookie('votedProposals'); |
| 1354 | $.removeCookie('*'); | 1355 | $.removeCookie('*'); |
| @@ -1363,36 +1364,36 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1363,36 +1364,36 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1363 | }); | 1364 | }); |
| 1364 | 1365 | ||
| 1365 | // hack-fix to support z-index over video/iframe | 1366 | // hack-fix to support z-index over video/iframe |
| 1366 | - function checkIframes () { | ||
| 1367 | - | ||
| 1368 | - $('iframe').each(function(){ | ||
| 1369 | - var $iframe = $(this); | ||
| 1370 | - var url = $iframe.attr('src'); | ||
| 1371 | - var c = '?'; | ||
| 1372 | - | ||
| 1373 | - if(url.indexOf("youtube") === -1){ | ||
| 1374 | - // is not a iframe of youtube | ||
| 1375 | - // console.debug('is not a iframe of youtube'); | ||
| 1376 | - return; | ||
| 1377 | - } | ||
| 1378 | - | ||
| 1379 | - if(url.indexOf("wmode=opaque") !== -1){ | ||
| 1380 | - // already in opaque mode | ||
| 1381 | - // console.debug('already in opaque mode'); | ||
| 1382 | - return; | ||
| 1383 | - } | ||
| 1384 | - | ||
| 1385 | - if(url.indexOf('?') !== -1){ | ||
| 1386 | - c = '&'; | ||
| 1387 | - } | 1367 | + // function checkIframes () { |
| 1368 | + | ||
| 1369 | + // $('iframe').each(function(){ | ||
| 1370 | + // var $iframe = $(this); | ||
| 1371 | + // var url = $iframe.attr('src'); | ||
| 1372 | + // var c = '?'; | ||
| 1373 | + | ||
| 1374 | + // if(url.indexOf("youtube") === -1){ | ||
| 1375 | + // // is not a iframe of youtube | ||
| 1376 | + // // console.debug('is not a iframe of youtube'); | ||
| 1377 | + // return; | ||
| 1378 | + // } | ||
| 1379 | + | ||
| 1380 | + // if(url.indexOf("wmode=opaque") !== -1){ | ||
| 1381 | + // // already in opaque mode | ||
| 1382 | + // // console.debug('already in opaque mode'); | ||
| 1383 | + // return; | ||
| 1384 | + // } | ||
| 1385 | + | ||
| 1386 | + // if(url.indexOf('?') !== -1){ | ||
| 1387 | + // c = '&'; | ||
| 1388 | + // } | ||
| 1388 | 1389 | ||
| 1389 | - $iframe.attr("src",url+c+"wmode=opaque"); | ||
| 1390 | - // console.debug('iframe changed to opaque mode'); | ||
| 1391 | - }); | 1390 | + // $iframe.attr("src",url+c+"wmode=opaque"); |
| 1391 | + // // console.debug('iframe changed to opaque mode'); | ||
| 1392 | + // }); | ||
| 1392 | 1393 | ||
| 1393 | - setTimeout(checkIframes, 500); | ||
| 1394 | - } | ||
| 1395 | - checkIframes(); | 1394 | + // setTimeout(checkIframes, 500); |
| 1395 | + // } | ||
| 1396 | + // checkIframes(); | ||
| 1396 | 1397 | ||
| 1397 | }); | 1398 | }); |
| 1398 | 1399 | ||
| @@ -1404,11 +1405,11 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1404,11 +1405,11 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1404 | }); | 1405 | }); |
| 1405 | 1406 | ||
| 1406 | if('onhashchange' in window){ | 1407 | if('onhashchange' in window){ |
| 1407 | - window.onhashchange = function(){ | 1408 | + window.onhashchange = function(){ |
| 1408 | Main.locationHashChanged.apply(Main); | 1409 | Main.locationHashChanged.apply(Main); |
| 1409 | - } | 1410 | + }; |
| 1410 | }else{ | 1411 | }else{ |
| 1411 | - // console.log('The browser not supports the hashchange event!'); | 1412 | + console.warn('The browser not supports the hashchange event!'); |
| 1412 | } | 1413 | } |
| 1413 | 1414 | ||
| 1414 | // Handle resize event | 1415 | // Handle resize event |
| @@ -1437,7 +1438,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | @@ -1437,7 +1438,7 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
| 1437 | 1438 | ||
| 1438 | timeout = setTimeout(delayed, threshold || 100); | 1439 | timeout = setTimeout(delayed, threshold || 100); |
| 1439 | }; | 1440 | }; |
| 1440 | - } | 1441 | + }; |
| 1441 | 1442 | ||
| 1442 | // smartresize | 1443 | // smartresize |
| 1443 | jQuery.fn[sr] = function(fn){ | 1444 | jQuery.fn[sr] = function(fn){ |