PageSourceSearch

https://pipelbiz.com/js/controller/HeaderCtrl.js?ver=1761830182

js pipelbiz.com collected 2026-09-26 11:49:32 UTC 7,236 bytes, 210 lines download raw bytes

1pipelbizControllers.controller("HeaderCtrl", [
2    "$state",
3    "blogService",
4    "$scope",
5    "$location",
6    "$rootScope",
7    "$timeout",
8    "$mdSidenav",
9    "$transitions",
10    "$filter",
11    "$http",
12    function CreateCampaignCtrl($state, blogService, $scope, $location, $rootScope, $timeout, $mdSidenav, $transitions, $filter, $http) {
13        $timeout(function () {
14            $scope.appDetails.secondPagePartStartLoading = true;
15        }, 2000);
16        $scope.bannerHebrew = "";
17        $scope.bannerEnglish = "";
18
19        function getBannerData() {
20            $http.get(api_url + 'home.php', {
21                params: {
22                    oper: 'getHomeBannerData',
23                    lang: $scope.lang
24                }
25            }).then(function (response) {
26
27                if ($scope.lang == "en") {
28                    $scope.bannerEnglish = response.data.data
29                } else {
30                    $scope.bannerHebrew = response.data.data
31                }
32                console.log($scope.bannerHebrew);
33
34            })
35        }
36
37        getBannerData();
38
39        $scope.showSupportPopup = false;
40
41        $scope.toggleSp = function () {
42            $scope.showSupportPopup = !$scope.showSupportPopup;
43        };
44        $scope.supportModal = function () {
45            $("#pplsupport").modal("show");
46        };
47        $scope.toggle = false;
48        $scope.toogleMyAcount = function () {
49            $scope.toggle = true;
50            $(".userName ul").slideToggle();
51        };
52        $scope.loginPage = function (term) {
53            $state.go("login");
54        };
55
56        $scope.toggleAdminMenu = false;
57        $scope.preventDef = false;
58
59        $transitions.onStart({}, function (trans) {
60            try {
61                tinymce.EditorManager.editors = [];
62            } catch (err) {
63                console.log("tinymce is not defined");
64            }
65        });
66
67        $scope.checkCounter = 0;
68        $transitions.onSuccess({}, function () {
69            $("#copyPasteInput").val(location.href);
70            $("html,body").scrollTop(0);
71
72            // call only once in 5 times
73            if ($scope.checkCounter >= 6 || $scope.checkCounter == 0) {
74                $scope.checkCounter++;
75                $timeout(
76                    function () {
77                        $scope.checkLoginStatus();
78                    },
79                    1000,
80                    false
81                );
82            } else {
83                $scope.checkCounter = 1;
84            }
85
86            console.log("$routeChangeSuccess called.");
87
88            $scope.appDetails.path = $location.path();
89
90            var parts = $location.path().split("/");
91            $scope.appDetails.view = parts[1];
92
93            if ($scope.appDetails.view == "Post" && !$scope.isMobile) {
94                $("#at4-share").show();
95                $(".addthis-smartlayers, div#at4-follow, div#at4-share, div#at4-thankyou, div#at4-whatsnext").show();
96            } else {
97                $("#at4-share").hide();
98                $(".addthis-smartlayers, div#at4-follow, div#at4-share, div#at4-thankyou, div#at4-whatsnext").hide();
99            }
100
101            // $scope.sendAE("pageView", {
102            //   pageName: $scope.appDetails.view,
103            // });
104
105            $.fancybox.close();
106        });
107
108        $scope.logoutToHome = function () {
109            $scope.logout();
110            $state.go("/");
111        };
112
113        $scope.openNav = function () {
114            $("body").toggleClass("seeNav");
115        };
116        $scope.openNav = function () {
117            console.log("HEY?");
118            $("#sidenav").modal("show");
119        };
120        $scope.openLoginModal = function () {
121            // $scope.sendAE('LoginModalOpen', {})
122            $scope.appDetails.loginModalOpenedBy = "login";
123            $("#ppl2login").modal("show");
124        };
125        $scope.registerPage = function () {
126            $scope.appDetails.currentCampaign = null;
127            $scope.appDetails.currentInvestAmmount = "";
128            if ($scope.lang == 'he') {
129                $state.go("register");
130            } else {
131                $state.go("registerEng");
132            }
133        };
134        $scope.loginPage = function () {
135            $scope.appDetails.currentCampaign = null;
136            $scope.appDetails.currentInvestAmmount = "";
137            if ($scope.lang == 'he') {
138                $state.go("login");
139            } else {
140                $state.go("loginEng");
141            }
142        };
143        $scope.openRegisterModal = function () {
144            // $scope.sendAE('RegisterModalOpen', {})
145            $scope.appDetails.loginModalOpenedBy = "register";
146            $("#ppl2login").modal("show");
147        };
148
149        $scope.shouldShowBanner = function () {
150            return decodeURIComponent(window.location.pathname) === "/";
151        }
152
153        $scope.shouldShowHeader = function () {
154            // if (decodeURIComponent(window.location.pathname).indexOf("invest") !== -1) {
155            //   return false;
156            // }
157            if (decodeURIComponent(window.location.pathname).indexOf($filter("translate")("URL_LOGIN")) !== -1) {
158                return false;
159            }
160            if (decodeURIComponent(window.location.pathname).indexOf($filter("translate")("URL_REGISTER")) !== -1) {
161                return false;
162            }
163            return true;
164        };
165        $scope.shouldShowHeader2 = function () {
166            if (decodeURIComponent(window.location.pathname).indexOf($filter("translate")("URL_LOGIN")) !== -1) {
167                $scope.appDetails.regOrLogin = "login";
168                return true;
169            }
170            if (decodeURIComponent(window.location.pathname).indexOf($filter("translate")("URL_REGIST
170ER")) !== -1) {
171                $scope.appDetails.regOrLogin = "reg";
172                return true;
173            }
174            return false;
175        };
176
177        $scope.toggleDashboardProfileMenu = function () {
178            console.log("toggleDashboardMenu")
179            $('.dashboard-profile-menu').slideToggle();
180        }
181        $scope.hideMenu = function () {
182            console.log("toggleDashboardMenu")
183            $('.dashboard-profile-menu').hide();
184        }
185        $scope.toggleDashboardMobileMenu = function () {
186            $('.dashboard-mobile-menu').slideToggle();
187            if ($('.topHeaderBanner').is(':visible')) {
188                $('.topHeaderBanner').hide();
189            } else {
190                $('.topHeaderBanner').show();
191            }
192
193        }
194
195        $scope.shouldShowDashboardHeader = function () {
196
197            const querystring = window.location.search;
198
199            const isLogged = $scope.userDetails && $scope.userDetails.usr_type;
200            return isLogged;
201            // return isLogged && querystring === '?dashboard=true';
202
203            // const paths = decodeURIComponent(window.location.pathname).split('/');
204            // const userDetails = $scope.userDetails && $scope.userDetails.usr_type;
205
206            // return userDetails && paths.some(path => ['MyInvestments', 'MyCharges', 'MyConventions', 'MyUpdates', 'Dashboard', 'contact', 'צור-קשר', 'investments', 'השקעות'].indexOf(path) > -1);
207        };
208
209    },
210]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.