1angular 2 .module('dating.models.pages', []) 3 .service('PagesModel', function ($http, $rootScope, ApiPrefixService, globalParamsService) { 4 var GLOBALS = globalParamsService.GLOBALS; 5 var model = this, 6 currentPage, 7 URLS = { 8 GET_SIGN_OUT: '/site/signout', 9 GET_FULL_PAGE: '/site/fullPageAd', 10 GET_REDIRECT_LANDING: '/site/redirectLanding', 11 GET_REG_OFFER_ONE: '/site/regOfferOne', 12 GET_EMAIL_OFFER: '/site/emailOffer', 13 GET_UN_SUBSCRIBE: '/unsubscribe/index', 14 POST_RE_SUBSCRIBE: '/unsubscribe/resubscribe', 15 POST_PRIVACY_FORM: '/site/processMailToPrivacyRequest', 16 CURRENT_CREDITS_INFO: '/profile/currentCreditsInfo', 17 GET_MONETIZATION_CHECK: '/ad/monetisationUrl', 18 GET_NAUGHTY_SPIN_INDEX: '/naughtySpin', 19 GET_NAUGHTY_SPIN_ACTION: '/naughtySpin/spin', 20 POST_NAUGHTY_SPIN_TRACK: '/naughtySpin/track' 21 }; 22 23 if (GLOBALS.isHeadless) { 24 for (var key in URLS) { 25 if (Object.prototype.hasOwnProperty.call(URLS, key)) { 26 URLS[key] = ApiPrefixService.prefixUrl(URLS[key]); 27 } 28 } 29 } 30 31 model.setCurrentPage = function (page) { 32 currentPage = page; 33 var classes = $('body').attr('class') ? $('body').attr('class').split(' ') : []; 34 $.each(classes, function () { 35 if (this.match(/Page$/)) { 36 $('body').removeClass(this.toString()); 37 } 38 }); 39 $('body').addClass(currentPage + 'Page' + (GLOBALS.i18nDefaultLang ? ' ' + GLOBALS.i18nDefaultLang : '')); 40 $.fancybox.close(); 41 }; 42 model.getCurrentPage = function () { 43 return currentPage; 44 }; 45 model.isCurrentPage = function (page) { 46 return page === currentPage; 47 }; 48 model.signOut = function () { 49 return $http.get(URLS.GET_SIGN_OUT); 50 }; 51 model.fullPage = function (monetizationFlag, overrideGroup) { 52 return $http.get(URLS.GET_FULL_PAGE, { 53 headers: {}, 54 params: { monetisationFlag: monetizationFlag, overrideGroup: overrideGroup } 55 }); 56 }; 57 model.redirectLanding = function (monetizationFlag) { 58 return $http.get(URLS.GET_REDIRECT_LANDING, { 59 headers: {}, 60 params: { monetisationFlag: monetizationFlag } 61 }); 62 }; 63 model.regOfferOne = function () { 64 return $http.get(URLS.GET_REG_OFFER_ONE); 65 }; 66 model.emailOffer = function () { 67 return $http.get(URLS.GET_EMAIL_OFFER); 68 }; 69 model.unSubscribe = function (data) { 70 return $http.get(URLS.GET_UN_SUBSCRIBE, { headers: {}, params: data }); 71 }; 72 model.reSubscribe = function (data) { 73 return $http.post(URLS.POST_RE_SUBSCRIBE, data); 74 }; 75 model.sendFormForUser = function (data) { 76 return $http.post(URLS.POST_PRIVACY_FORM, data); 77 }; 78 model.currentCreditsInfo = function () { 79 return $http.get( 80 GLOBALS.backendUrl + '/user/' + GLOBALS.userInfo.uuid + '/creditsInfo?siteName=' + GLOBALS.siteName, 81 { headers: { 'X-Auth-Token': GLOBALS.authToken } } 82 ); 83 }; 84 model.monetizationCheck = function (id) { 85 return $http.get(URLS.GET_MONETIZATION_CHECK, { 86 headers: {}, 87 params: { monetisationOptionId: id } 88 }); 89 }; 90 model.naughtySpinCheck = function () { 91 return $http.get(URLS.GET_NAUGHTY_SPIN_INDEX); 92 }; 93 model.naughtySpinAction = function () { 94 return $http.get(URLS.GET_NAUGHTY_SPIN_ACTION); 95 }; 96 model.naughtySpinTrack = function (event) { 97 return $http.post(URLS.POST_NAUGHTY_SPIN_TRACK, { event: event }); 98 }; 99 });
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.