1angular.module('AboShopApp') 2 //.constant("commonConfig", {} ) 3 .config(function ($analyticsProvider) { 4 $analyticsProvider.virtualPageviews(false); 5 }) 6 .config(function($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider, commonConfig, $analyticsProvider, seoProvider, $sceDelegateProvider) { 7 $analyticsProvider.virtualPageviews(false); 8 9 $sceDelegateProvider.resourceUrlWhitelist([ 10 'self', 11 'https://loginpp*.qiota.com/**', 12 'https://connexion.groupe-telegramme.fr/**', 13 'https://ssopp-account.qiota.com/**', 14 'https://sso-account.qiota.com/**', 15 'https://connexion.groupevalmonde.fr/**' 16 ]); 17 18 configAboshop(commonConfig, CONFIG_ABOSHOP); 19 if(commonConfig.removediese){ 20 $locationProvider.html5Mode(true); 21 } 22 23 var errorTemplate = { 24 url: '', 25 abstract: true, 26 name: "message", 27 views: { 28 'error': { 29 template: '' 30 } 31 } 32 }; 33 34 var error404 = { 35 name: "message.404", 36 url: "/message/404", 37 views: { 38 'error@': { 39 templateUrl: commonConfig.commonroot+"/content/404.html?v="+commonConfig.forceversion, 40 controller: "404Ctrl" 41 } 42 }, 43 data : { pageTitle: 'DICO_ROUTING_ACCUEIL_TITRE' } 44 }; 45 46 var administration = { 47 name: "message.administration", 48 url: "/message/administration", 49 views: { 50 'error@': { 51 templateUrl: commonConfig.commonroot+"/content/administration.html?v="+commonConfig.forceversion, 52 controller: "adminCtrl" 53 } 54 } 55 }; 56 57 var error = { 58 name: "message.error", 59 url: "/message/error", 60 views: { 61 'error@': { 62 templateUrl: commonConfig.commonroot+"/content/error.html?v="+commonConfig.forceversion, 63 controller: "errorCtrl" 64 } 65 } 66 }; 67 68 $stateProvider 69 .state(errorTemplate) 70 .state(error) 71 .state(error404) 72 .state(administration); 73 74 var root = { 75 name: "root", 76 url: '', 77 abstract: true, 78 views: { 79 'header': { 80 template: '<section header></section>' 81 }, 82 'footer': { 83 template: '<section footer></section>' 84 }, 85 'modal': { 86 template: '<section cmsmodal></section><section formulemodal></section><section commentmodal></section><section pdfmodal></section><section forgetmodal></section><section addressmodal></section><section validatedmodal></section><section wishlistmodal></section><section informationmodal></section><section addtocartmodal></section><section sharemodal></section><section yesnomodal></section><section spinnermodal></section><section accesmodal></section><section detailoffremodal></section>' 87 } 88 }, 89 resolve: { 90 initResource: 'initManager', 91 initManager: function(initResource) { 92 return initResource.init(); 93 } 94 } 95 }; 96 97 commonConfig.saveCurrentUrl = window.location.origin.toString() + window.location.pathname.toString(); 98 99 // routes toujours disponibles 100 $stateProvider 101 .state(root) 102 ; 103 104 if((commonConfig.oAuthExterne !== undefined && commonConfig.oAuthExterne.ssoQiota === true) || commonConfig.useRewriteUrl){ 105 // For any unmatched url, redirect to /404 106 $urlRouterProvider.otherwise("/loading" + window.location.search); 107 108 var loading = { 109 name: "root.homeloading", 110 url: "/loading", 111 views: { 112 'container@': { 113 templateUrl: commonConfig.commonroot+"/content/home/homewait.html?v="+commonConfig.forceversion, 114 controller: "homewaitCtrl" 115 } 116 }, 117 data : { pageTitle: 'DICO_ROUTING_ACCUEIL_TITRE' } 118 }; 119 120 $stateProvider 121 .state(loading) 122 ; 123 } else { 124 // For any unmatched url, redirect to /404 125 seoProvider.registerCommonRoutes(); 126 } 127 128 $httpProvider.interceptors.push(function($q, $location, $rootScope, $localStorage) { 129 return { 130 'responseError': function(response) { 131 if($rootScope.noerror){ 132 $rootScope.noerror=false; 133 return $q.reject(response); 134 } 135 136 if($rootScope.noerroronlog){ 137 $rootScope.noerroronlog=false; 138 return $q.reject(response); 139 } 140 141 var classStatus = parseInt(response.status/100); 142 143 var data = response.data,clientConnecte=false; 144 145 if(!data || data === undefined){ 146 data = {}; 147 } 148 if(data.error === undefined){ 149 data.error = response.status+" "+response.statusText; 150 } 151 if(data.error_description === undefined){ 152 data.error_description = "No detailed description"; 153 } 154 155 if( data.error == "Token Check" && data.error_description == "Token not Found" || 156 data.error == "Token Check" && data.error_description == "Expired Token"){
157 //Sur une expiration de token, on recharge completement la page pour reinitialiser le token 158 if($rootScope.user && $rootScope.user !== undefined) { 159 if($rootScope.user.countReload === undefined) { 160 $rootScope.user.countReload = 0; 161 } 162 $rootScope.user.countReload++; 163 } 164 location.reload(); 165 return $q.reject(response); 166 } else if(data.error == "Token Check" && data.error_description == "Scope not Allowed" || 167 data.error == "Token Check" && data.error_description == "Token Technical Error" || 168 data.error == "Token Check" && data.error_description.startsWith("Token Invalid")){ 169 return $q.reject(response); 170 } 171 172 if($rootScope.user && $rootScope.user !== undefined && $rootScope.user.isClient){ 173 clientConnecte = true; 174 } 175 $rootScope.lasterror = {}; 176 data.retry = 0; 177 178 if(data.error == "Server AboWeb Error" && data.error_description == "administration"){ 179 $location.path('error/administration'); 180 } else if(data.error == "503 TIMEOUT ABOWEB" || data.error == "500 Internale Server Error"){ 181 if(clientConnecte){ 182 $rootScope.lasterror = data; 183 $location.path('common/logout'); 184 } else { 185 if($rootScope.errorOccured == false){ 186 $rootScope.lasterror = data; 187 $rootScope.errorOccured = true; 188 } 189 if(commonConfig.throwerror){ 190 throw new Error(classStatus + " " + JSON.stringify(data)); 191 } 192 $location.path('/message/error'); 193 } 194 } else if ($location.path() == "/common/login"){ 195 //Sur la page de login, on affiche lerreur 196 $q.reject(data); 197 } else if($location.path() == "/common/paymentdetails"){ 198 //Sur la page de payment, on affiche lerreur 199 $q.reject(data); 200 } else if($rootScope.signin.inProgress){ 201 //Sur demande identification 202 if(data.error_description == "#LOGIN#MAIL_NOT_SET"){ 203 $q.reject(data); 204 } else if(response.status == 401 && data.error_description == "Access to private Webservices is forbidden, customer not found in AboWeb Database"){ 205 $rootScope.lasterror = data; 206 $location.path('common/logout'); 207 } else { 208 $rootScope.signin.error=data; 209 $rootScope.goPage(undefined, 'common/login'); 210 } 211 } else { 212 if(clientConnecte){ 213 $rootScope.lasterror = data; 214 $location.path('common/logout'); 215 } else { 216 $rootScope.lasterror = data; 217 if($rootScope.lasterror.error !== undefined && data.error === "500 RETURN CODE NOT FOUND FROM ABOSHOP SERVER"){ 218 $location.path('/message/administration'); 219 } else { 220 if($rootScope.errorOccured == false){ 221 $rootScope.errorOccured = true; 222 } 223 if(commonConfig.throwerror){ 224 throw new Error(classStatus + " " + JSON.stringify(data)); 225 } 226 $location.path('/message/error'); 227 } 228 } 229 } 230 231 return $q.reject(response); 232 } 233 }; 234 }); 235});
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.