This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| // A bit of a hack to track right-click and "Open in New Tab/Window clicks" | |
| $('#div_id a').bind("contextmenu",function(e){ | |
| var d1 = new Date (); | |
| var d2 = new Date ( d1 ); | |
| // Cookies will expire in 10 seconds, so basically the user has 10 seconds to right-click and open the link. | |
| d2.setSeconds ( d1.getSeconds() + 10 ); | |
| $.cookie('right_click_cookie', $(this).attr('href'), { | |
| expires: d2, | |
| path: '/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("PathgatherApp").factory 'CurrentFollowedUsers', (["CurrentUser", "$q", (CurrentUser, $q) -> | |
| followed_users = null | |
| followed_users_promise = null | |
| { | |
| getFollowedUsers: () -> | |
| return CurrentUser.getUser().then (current_user) -> | |
| if followed_users? | |
| deferred = $q.defer() | |
| deferred.resolve(followed_users) | |
| return deferred.promise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("PathgatherApp").factory 'CurrentUser', (["$q", "Restangular", ($q, Rectangular) -> | |
| current_user = null | |
| current_user_promise = Restangular.all("users").customGET("current") | |
| current_user_promise.then (response) -> | |
| current_user = response | |
| { | |
| getUser: () -> | |
| if current_user? | |
| deferred = $q.defer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("PathgatherApp").factory 'CurrentFollowedUsers', (["CurrentUser", "$q", (CurrentUser, $q) -> | |
| followed_users = null | |
| followed_users_promise = null | |
| { | |
| getFollowedUsers: () -> | |
| return CurrentUser.getUser().then (current_user) -> | |
| if followed_users? | |
| deferred = $q.defer() | |
| deferred.resolve(followed_users) | |
| return deferred.promise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module("PathgatherApp").directive('pgFollowBtn', ["CurrentFollowedUsers", "$compile", (CurrentFollowedUsers, $compile) -> | |
| restrict: 'A', | |
| scope: {user: '=pgFollowBtn'}, | |
| link: (scope, element, attrs) -> | |
| follow_btn = null | |
| unfollow_btn = null | |
| createFollowBtn = () -> | |
| follow_btn = angular.element( | |
| "<a href='javascript:void(0)' ng-disabled='submitting'>" + | |
| "<span>Follow</span></a>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html ng-app="AngularApp"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
| <link href="assets/css/please-wait.css" rel="stylesheet"> | |
| <link href="assets/css/default.css" rel="stylesheet"> | |
| </head> | |
| <body ng-controller="MainCtrl"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body > .inner { | |
| display: none; | |
| } | |
| body.pg-loaded > .inner { | |
| display: block; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var loading_screen = pleaseWait({ | |
| logo: "assets/images/pathgather.png", | |
| backgroundColor: '#f46d3b', | |
| loadingHtml: "<div class='sk-spinner sk-spinner-wave'><div class='sk-rect1'></div><div class='sk-rect2'></div><div class='sk-rect3'></div><div class='sk-rect4'></div><div class='sk-rect5'></div></div>" | |
| }); |